XGBClassifier 默认参数在 Python 中打印为 None
我正在尝试在 python 笔记本中使用 XGBClassifier 作为:
from xgboost import XGBClassifier
要查看我使用的默认参数的值:
XGBClassifier()
它打印以下输出,其中 None 是所有参数的默认值:
XGBClassifier(base_score=None, booster=None, colsample_bylevel=None,
colsample_bynode=None, colsample_bytree=None,
enable_categorical=False, gamma=None, gpu_id=None,
importance_type=None, interaction_constraints=None,
learning_rate=None, max_delta_step=None, max_depth=None,
min_child_weight=None, missing=nan, monotone_constraints=None,
n_estimators=100, n_jobs=None, num_parallel_tree=None,
predictor=None, random_state=None, reg_alpha=None,
reg_lambda=None, scale_pos_weight=None, subsample=None,
tree_method=None, validate_parameters=None, verbosity=None)
有人可以告诉我为什么所有这些值都是 None 吗?
I am trying to use XGBClassifier in python notebook as:
from xgboost import XGBClassifier
To see the value of default parameters used I did:
XGBClassifier()
It prints the following output with None being the default value of all parameters:
XGBClassifier(base_score=None, booster=None, colsample_bylevel=None,
colsample_bynode=None, colsample_bytree=None,
enable_categorical=False, gamma=None, gpu_id=None,
importance_type=None, interaction_constraints=None,
learning_rate=None, max_delta_step=None, max_depth=None,
min_child_weight=None, missing=nan, monotone_constraints=None,
n_estimators=100, n_jobs=None, num_parallel_tree=None,
predictor=None, random_state=None, reg_alpha=None,
reg_lambda=None, scale_pos_weight=None, subsample=None,
tree_method=None, validate_parameters=None, verbosity=None)
Can someone please tell me why all these values are None?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有点不幸的是,这些是 python 类的默认参数 (来源)。真正的默认超参数存储在 python 包装器调用的 C++ 代码中。
Somewhat unfortunately, those are the default parameters for the python class (source). The real default hyperparameters are stored in the C++ code that the python wrapper calls on.