如何从XGBoost(XGBClassifier)获取/返回max_depth参数?
我训练了幼稚的XGBClassifier()。安装我的分类器后具有参数:
XGBClassifier(base_score=0.5, booster='gbtree', callbacks=None,
colsample_bylevel=1, colsample_bynode=1, colsample_bytree=1,
early_stopping_rounds=None, enable_categorical=False,
eval_metric=None, gamma=0, gpu_id=-1, grow_policy='depthwise',
importance_type=None, interaction_constraints='',
learning_rate=0.300000012, max_bin=256, max_cat_to_onehot=4,
max_delta_step=0, max_depth=6, max_leaves=0, min_child_weight=1,
missing=nan, monotone_constraints='()', n_estimators=10, n_jobs=0,
num_parallel_tree=1, objective='binary:logistic',
predictor='auto', random_state=0, reg_alpha=0, ...)
如何获得max_depth参数? 如果我跑步:
xgbc_naive.max_depth
我一无所获。 有什么想法吗?
I trained naive XGBClassifier(). After fitting my classifier has params:
XGBClassifier(base_score=0.5, booster='gbtree', callbacks=None,
colsample_bylevel=1, colsample_bynode=1, colsample_bytree=1,
early_stopping_rounds=None, enable_categorical=False,
eval_metric=None, gamma=0, gpu_id=-1, grow_policy='depthwise',
importance_type=None, interaction_constraints='',
learning_rate=0.300000012, max_bin=256, max_cat_to_onehot=4,
max_delta_step=0, max_depth=6, max_leaves=0, min_child_weight=1,
missing=nan, monotone_constraints='()', n_estimators=10, n_jobs=0,
num_parallel_tree=1, objective='binary:logistic',
predictor='auto', random_state=0, reg_alpha=0, ...)
How can I get max_depth parameter?
If I run:
xgbc_naive.max_depth
I get None.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该是正确的,如果您的型号名称为XGBC_NAIVE,并且培训进行得很好,
这些都应显示Max_depth
您是否训练了您是否使用:
PS如果您保存模型并使用load_model再次加载了型号,请尝试:
That should be correct, if your model name is xgbc_naive and training went well
These should all show the max_depth
Did you train with :
P.S. if you saved your model and loaded it again using load_model, try: