Getting parameters from serialized Booster

If I save a model to disk and later load it, is there some way to get the model’s parameters back out?

What do you mean by “parameters”? Do you mean training options? I don’t think the model stores the training options you used; after all, a tree is a tree whether it was trained with ‘exact’ or ‘hist’.

Thanks, that makes sense. I had a bunch of old models I was going through, but had lost the scripts I used to train them, so was looking to see if there was a way of recovering them from the model.

Hi Dave,
If your model is something like below, I’ve found this (in python):

clf = xgb.XGBModel(**param_dist)
clf.fit(...)
clf.get_params(deep=False) # Get parameters.
clf.get_xgb_params() #Get xgboost type parameters

Hope it helps!

However I also want to print the hyperparameters used to train my model (ex.: num_leaves, num_features, etc) but my model is a XGBoostClassificationModel. Didn’t find a way to do it. Any idea?

Thanks!