SPORF
SPORF copied to clipboard
save forest
- [ ] In Python?
- [ ] in R?
- [ ] in C++ (not ideal?)
how can we save a trained model in c++. This is what I am trying to do right now
Currently, this library does not support saving model in C++. You can refer to https://github.com/megh1241/blockset for a package that performs some of the same optimizations as SPORF (i.e packing) and allows you to efficiently serialize and de-serialize models from external memory. It takes an sklearn/xgboost trained model, packs it and provides functions to perform inference on the packed model. We haven't integrated this with SPORF yet. You can refer to our recent paper published at KDD 2021 for details (https://dl.acm.org/doi/10.1145/3447548.3467368).
I am actually working on a Oblique random forest(rerf) classifier. Where I have to save the trained python model and If some test data is given then I have to load it and perform the classification. But when I am trying to use traditional methods of saving like using joblib, pickle libraries it is giving me an error TypeError: cannot pickle 'pyfp.fpForest' object I was unable to figure out how to resolve this and it is very much important to my project. So can some one please tell how can I save a trained rerf classifier?
Saving the object using the pickle library will not work, as stated above, because the object is a C++ object.
Active development on this library is no longer occurring.
So can you please tell me is there any way to save the object @MrAE ?
I am not aware of a way to save the object.