from lightgbm import LGBMClassifier
model = LGBMClassifier()
model.fit(X_train, y_train)
This is my code. I got this error in model.fit()
:
AttributeError Traceback (most recent call last)
<ipython-input-76-6b35b759d36e> in <module>
1 from lightgbm import LGBMClassifier
2 model = LGBMClassifier()
----> 3 model.fit(X_train, y_train)
4 y_pred = model.predict_proba(X_valid)
/usr/local/lib/python3.6/dist-packages/lightgbm/basic.py in c_str(string)
110 def c_str(string):
111 """Convert a Python string to C string."""
--> 112 return ctypes.c_char_p(string.encode('utf-8'))
113
114
AttributeError: 'tuple' object has no attribute 'encode'
X_train
is a DataFrame
and has (2500,56) shape that all the dtypes are float64.
y_train
is a Series
and has (2500,) shape that the dtype is int64.
It worked well in other models like Xgb and RandomForest.