As you can see, I have a problem with using sklearn (lightgbm
, GridSearchCV
).
Please let me know how to solve this error.
My code is the following:
import lightgbm as lgb
from lightgbm.sklearn import LGBMClassifier
estimator = lgb.LGBMClassifier()
param_grid = {
'num_leaves': [15, 30, 60],
'min_data_in_leaf': [18, 36, 72],
'learning_rate': [0.05, 0.1, 0.2],
'n_estimators': [4, 8, 16]
}
from sklearn.model_selection import GridSearchCV
grid = GridSearchCV(estimator, param_grid, cv=5)
lgb_grid = grid.fit(X_train, y_train)
And it raises this error:
/usr/local/lib/python3.6/dist-packages/sklearn/model_selection/_validation.py:536: FitFailedWarning: Estimator fit failed. The score on this train-test partition for these parameters will be set to nan. Details:
ValueError: bad input shape (33120, 4)
FitFailedWarning)