SPORF icon indicating copy to clipboard operation
SPORF copied to clipboard

save forest

Open MrAE opened this issue 5 years ago • 2 comments

  • [ ] In Python?
  • [ ] in R?
  • [ ] in C++ (not ideal?)

MrAE avatar Mar 28 '19 19:03 MrAE

how can we save a trained model in c++. This is what I am trying to do right now

jdubz93 avatar Aug 26 '21 21:08 jdubz93

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).

megh1241 avatar Aug 26 '21 21:08 megh1241

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?

pepetikesavasiddhardha avatar Jul 04 '23 16:07 pepetikesavasiddhardha

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.

MrAE avatar Jul 04 '23 20:07 MrAE

So can you please tell me is there any way to save the object @MrAE ?

pepetikesavasiddhardha avatar Jul 05 '23 01:07 pepetikesavasiddhardha

I am not aware of a way to save the object.

MrAE avatar Jul 05 '23 10:07 MrAE