我训练了朴素的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我什么都没得到。有什么想法吗?
发布于 2022-05-28 16:55:59
这应该是正确的,如果您的模型名为xgbc_naive,并且培训进行得很顺利。
这些都应该显示max_depth
model.get_params
model.get_xgb_params
model.max_depth # should show max_depth used你是否接受过下列训练:
xgbc_naive = XGBClassifier(etc, etc)如果您保存了模型并再次使用load_model加载,请尝试:
model.score # show a list of the params usedhttps://stackoverflow.com/questions/72378132
复制相似问题