google / yggdrasil-decision-forests

A library to train, evaluate, interpret, and productionize decision forest models such as Random Forest and Gradient Boosted Decision Trees.
https://ydf.readthedocs.io/
Apache License 2.0
498 stars 53 forks source link

Saving and loading models trained using quickscorer #32

Closed JoseAF closed 11 months ago

JoseAF commented 1 year ago

Hi

I'm working on saving and loading models to file. I have a GradientBoostedTreesBinaryClassificationQuickScorerExtended model and am using the model_library SaveModel/LoadModel to save/load it to/from a directory. When doing this, the library creates a directory with 2 files, a header and a data_spec. I'm not sure whether these contain the whole trained model, but I suspect not, because when I load the model (and cast it to GradientBoostedTreeModel and create the specialized model GradientBoostedTreesBinaryClassificationQuickScorerExtended), I seem to have lost the actual trees as shown when calling DescriptionAndStatistics (the metadata is still there though). Also, this loaded model is not able to predict anymore. Do these SaveModel and LoadModel methods work correctly with these kind of specialized models or should I be taking a different approach here?

Thanks for your help.

achoum commented 11 months ago

Similar issue as https://github.com/google/yggdrasil-decision-forests/issues/31