Catboost에는 실제로 이러한 제한이 있습니다. 그러나 그것은 순열과는 아무런 관련이 없습니다. 왜냐하면 그들은 순응 단계에서만 적용되기 때문입니다.
과 fit
앞에 동일한 방법 catboost.Pool._check_data_empty
이 적용되는 것이 문제입니다. 그리고 피팅을 위해, 하나 이상의 관찰을 갖는 것이 정말로 중요합니다.
이제 확인 기능에는 실제로는 이상한 sum(x.shape)>2
이 필요합니다. 당신은 predict
를 호출하기 전에 하나 개 또는 두 개 더 가짜 행을 추가하여 잘 할 수있는, 지금은
import catboost
import numpy as np
x_train3 = np.array([[1,2,3,], [2,3,4], [3,4,5]])
x_train1 = np.array([[1], [2], [3]])
y_train = np.array([1,2,3])
x_test3_2 = np.array([[4,5,6], [5,6,7]])
x_test3_1 = np.array([[4,5,6,]])
x_test1_2 = np.array([[4], [5]])
x_test1_1 = np.array([[4]])
model3 = catboost.CatBoostRegressor().fit(x_train3, y_train)
model1 = catboost.CatBoostRegressor().fit(x_train1, y_train)
print(model3.predict(x_test3_2)) # OK
print(model3.predict(x_test3_1)) # OK
print(model1.predict(x_test1_2)) # OK
print(model1.predict(x_test1_1)) # Throws an error!
: 다음 코드는 문제를 보여줍니다. 원래 행의 출력에는 영향을 미치지 않습니다.