pyLightGBM icon indicating copy to clipboard operation
pyLightGBM copied to clipboard

Direct using of categorical features

Open sashulyak opened this issue 8 years ago • 1 comments

LightGBM can use categorical feature directly.

There is a categorical_feature parameter in LightGBM docs to deal with this behavior: https://github.com/Microsoft/LightGBM/blob/master/docs/Parameters.md

It would be nice to add categorical feature support to pyLightGBM.

sashulyak avatar Feb 16 '17 15:02 sashulyak

I can see from the regression example here that you integerise categorical features and then include these with continuous variables:

le = LabelEncoder()

for col in df.columns.tolist():
    if 'cat' in col:
        df[col] = le.fit_transform(df[col])

I agree it would be nice to add categorical feature support to pyLightGBM rather than training on mixed continuous and integerised categories (which doesn't make sense to me)

gw00207 avatar Jun 14 '17 16:06 gw00207