python - xgboost如何复制模型

标签 python xgboost

xgboost 文档中,他们引用了 copy() 方法,但我不知道如何使用它,因为 if foo > 是我的模型, bar = foo.copy()bar=xgb.copy(foo) 都不起作用(xgboost 找不到模块或模型的 copy() 属性)。有什么建议吗?

最佳答案

事实证明,copy()Booster 对象的一个​​方法,但(比如说)XGBClassifier 不是 一个,所以如果使用 sklearn 前端,你就可以 bar = foo.get_booster().copy()

关于python - xgboost如何复制模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62309466/

相关文章:

python - 为什么调用 fit 会重置 XGBClassifier 中的自定义目标函数?

python - Windows 上的 Xgboost 安装错误 .OSError : [WinError 127] The specified procedure could not be found

python - 如何使用accuracy_score(或其他建议的函数)测量xgboost回归器的准确性

python-3.x - eli5解释预测XGBoost模型

python - 如何在Excel文件中导出wxpython gui文本?

python - 在 python 上的水平箱和晶须图上标记 Q1、Q2、Q3、最小值和最大值

python - 使用 stride_tricks 创建重叠子数组

python - python中关于邻接矩阵的Dijkstra算法

Python 正则表达式 : Replace all urls in string with <img> and <a> tags

python - 在 Python 和 R 之间移植 XGBoost 模型