I’m trying to use LGBMClassifier and for some reason, he does not accept the types of my data (all features are not accepted, I tested it).
When we look at my data we can clearly see that all dtypes are either category, float or int (pd.DataFrame.info())
JavaScript
x
2
1
dtypes: category(275), float64(115), int64(9)
2
When I eventually try to train my LGBMClassifier I get the follwoing Error:
JavaScript
1
2
1
ValueError: Series.dtypes must be int, float or bool
2
Has anyone an idea what is wrong?
Advertisement
Answer
I figured out that the error:
JavaScript
1
2
1
ValueError: Series.dtypes must be int, float or bool
2
refers in my case to the label, thus to the only passed series to the lgb.train() method. My label had the type category which can not be handled by lgb.train(). I had to change the dtype from ‘category’ to ‘int’. Then It worked.