gpt4 book ai didi

python - 打印 CatBoost 超参数

转载 作者:行者123 更新时间:2023-12-01 08:08:00 27 4
gpt4 key购买 nike

训练模型后如何打印 CatBoost 超参数?

sklearn我们可以打印模型对象,它将显示所有参数,但在 catboost 中它只打印对象的引用:<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)

最佳答案

print(model.get_params()) 应该做

关于python - 打印 CatBoost 超参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55440566/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com