-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify cat_features for the catboost learner? #161
Comments
Why can't it be saved by save_model() and how does your customized learner solve that problem? |
Hi @sonichi: Sorry I misunderstood the portability and there is no issue with this aspect now. However, the dilemma I am facing is: If I build the customized catboost learner as above, I have difficulties specifying cat_features. There is an error message "CatBoostError: features data: pandas.DataFrame column 'V1' has dtype 'category' but is not in cat_features list", in which 'V1" is the first categorical variable in the modeling data. If I set the class of the customized learner as CatBoostEstimator from flaml.model, everything runs well but as mentioned in another issue, the tunable parameters for catboost in FLAML are very limited; actually just n_estimators and learning_rate. As a result, the final model is not optimized enough. Any suggestions? Thank you |
You can set the cat_features in the same way as in flaml: Lines 720 to 724 in 10082b9
|
@stepthom is exploring it. @AlgoAIBoss made some suggestions in that thread. I'll be curious what’s a good search space for catboost. Maybe you can discuss on gitter with them and share with each other what you found. If you have a recommended search space, we can run some benchmark experiments to verify its effectiveness. |
Got it. Thank you very much! |
Hi:
I am using a customized catboost learner but having difficulties in specifying cat_features.
The codes for the customized learner is:
from catboost import CatBoostClassifier
class MyMonotonicCatboostClassifier(BaseEstimator):
If I use CatBoostEstimator from flaml.model as the class, cat_features can be specified in params; however, the final model lost the portability, which means that it cannot be saved by save_model() and ported into R.
If I set the class as self.estimator_class = CatBoostClassifier, I kept getting an error message stating that cat_features is missing.
I am running the codes above in R via reticulate; not sure whether it is related.
Appreciate your help!
Thank you.
The text was updated successfully, but these errors were encountered: