1.lgb(lightgbm)处理类别特征遇到的问题:
ValueError: DataFrame.dtypes for data must be int, float or bool. Did
not expect the data types in the following fields: Sex, Embarked
加上这些代码,完美解决,记得点赞
from sklearn import preprocessing
encoder = preprocessing.LabelEncoder()
encoder.fit(list(X["Sex"].values))
X

最低0.47元/天 解锁文章
8119

被折叠的 条评论
为什么被折叠?



