A few simple changes to allow categorical features (such as for example CatBoost uses, but also xgboost and some sklearn models). The catboost_demo.ipynb notebook shows a demonstration. (Can be deleted)
Usespandas.api.types.is_numeric_dtype to detect non-numeric columns, labels the feature_type as 'categorical' in which case the grid values are given by feature_grids = _dataset[feature].unique().tolist().
If the model is able to handle categorical columns, then it will simply give the right prediction, so the rest of the library works as expected.
A few simple changes to allow categorical features (such as for example CatBoost uses, but also xgboost and some sklearn models). The
catboost_demo.ipynb
notebook shows a demonstration. (Can be deleted)Uses
pandas.api.types.is_numeric_dtype
to detect non-numeric columns, labels the feature_type as'categorical'
in which case the grid values are given byfeature_grids = _dataset[feature].unique().tolist()
.If the model is able to handle categorical columns, then it will simply give the right prediction, so the rest of the library works as expected.