Print CatBoost hyperparameters

主宰稳场 提交于 2019-12-24 07:56:49

问题


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)

回答1:


print(model.get_params()) should do



来源:https://stackoverflow.com/questions/55440566/print-catboost-hyperparameters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!