leokury
leokury

Reputation: 429

Print CatBoost hyperparameters

How to print CatBoost hyperparameters after training a model?

In sklearn we can just print model object that it will show all parameters but in catboost it only print object's reference: <catboost.core.CatBoostRegressor object at 0x7fd441e5f6d8>.

from catboost import CatBoostRegressor
# Initialize data

train_data = [[1, 4, 5, 6],
              [4, 5, 6, 7],
              [30, 40, 50, 60]]

eval_data = [[2, 4, 6, 8],
             [1, 4, 50, 60]]

train_labels = [10, 20, 30]
# Initialize CatBoostRegressor
model = CatBoostRegressor(iterations=2,
                          learning_rate=1,
                          depth=2)
# Fit model
model.fit(train_data, train_labels)
# Get predictions
preds = model.predict(eval_data)
print (model)

Upvotes: 1

Views: 2603

Answers (2)

Parthiban
Parthiban

Reputation: 557

Use print(model.get_all_params()) to print all default parameters.

Upvotes: 1

Anna Veronika Dorogush
Anna Veronika Dorogush

Reputation: 1223

print(model.get_params()) should do

Upvotes: 4

Related Questions