xgb.train
is the low level API to train an xgboost
model in Python.
XGBClassifier
, which is a wrapper and calls xgb.train
when
a model is trained, I can print the XGBClassifier
object and the
hyperparameters are printed.xgb.train
I have no idea how to check the parameters after
trainingCode:
bst = xgb.train(params, dtrain)
bst.params # does not work!
The save_config
method noted here can be used to create a string representation of the model's configuration. This can be converted to a dict:
import json
config = json.loads(bst.save_config())
The result is somewhat deeply nested, but the hyperparameters are found like this:
config['learner']['gradient_booster']['updater']['grow_colmaker']['train_param']