Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Catboost default hyperparameters

How do I return all the hyperparameters of a CatBoost model?

NOTE: I do not think this is a dup of Print CatBoost hyperparameters since that question/answer doesn't address my need.

For example, with sklearn I can do:

rf = ensemble.RandomForestClassifier(min_samples_split=2)
print rf

RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',
            max_depth=None, max_features='auto', max_leaf_nodes=None,
            min_impurity_decrease=0.0, min_impurity_split=None,
            min_samples_leaf=1, min_samples_split=2,
            min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1,
            oob_score=False, random_state=None, verbose=0,
            warm_start=False)

This returns all the hyperparameters, those I defined and the other defaults.

With Catboost I can use .get_params() but it seems to return only user specified parameters:

cat = CatBoostClassifier(loss_function='Logloss',
                         verbose = False,
                        eval_metric='AUC',
                        iterations=500,
                         thread_count = None,
                        random_state=SEED)
print cat.get_params()

{'iterations': 500, 'random_state': 42, 'verbose': False, 'eval_metric': 'AUC', 'loss_function': 'Logloss'}

For example, I'd like to know what learning_rate was used, but Ideally get the whole list.

like image 550
ADJ Avatar asked Jan 02 '23 02:01

ADJ


2 Answers

You can try change your

print cat.get_params()

to

print cat.get_all_params()

Source: get_all_params documentation

like image 132
Ralph Deint Avatar answered Jan 12 '23 13:01

Ralph Deint


You can find a detailed description of all training parameters with their default values here: https://catboost.ai/docs/concepts/python-reference_parameters-list.html#python-reference_parameters-list

like image 34
Robert Lacok Avatar answered Jan 12 '23 13:01

Robert Lacok