AnacletoLAB / grape

🍇 GRAPE is a Rust/Python Graph Representation Learning library for Predictions and Evaluations
MIT License
545 stars 39 forks source link

Saving classifier models #14

Open caufieldjh opened 2 years ago

caufieldjh commented 2 years ago

Could support for saving classifier models please be added? This came up while meeting with @LucaCappelletti94 recently but it's become relevant again in the course of updating neat-ml to use grape classifiers.

Training classifiers isn't a major time commitment, but on our neat runs we've separated the process of training+testing vs. applying classifiers, so being unable to save or at least pickle the classifier object means we need to redo training for each model.

LucaCappelletti94 commented 2 years ago

Hello Harry! I have been trying to figure out how to decently generalize a saving procedure for a while now, so I will most likely switch to implementing a custom one for most models. Do you have some specific model I should prioritize?

caufieldjh commented 2 years ago

Great - for now, being able to save a perceptron during the course of link prediction would be helpful.

LucaCappelletti94 commented 2 years ago

Ok so, I have introduced support for saving and loading all sklearn models and the edge prediction perception. The TensorFlow-based models will be next.

LucaCappelletti94 commented 2 years ago

In the version of 🍇 currently available on PyPi it is now possible to save and load all non-TensorFlow models. We'll get to them in the next version, so we don't block you for your work on NEAT.

mdawas commented 1 year ago

Hi guys, We are evaluating the grape framework at Choreograph (one of WPP group companies) and we are currently training some model for edge predictions, but we did not manage yet to save the trained model. Is it possible to save the KipfGCNEdgePrediction model? I get an error that dump is not implemented for Kipf GCN for Edge Prediction.

LucaCappelletti94 commented 1 year ago

I had forgotten about this, as TensorFlow had some issues dumping and loading the models at the time. I'm currently testing whether they fixed these issues, and I'll get back to you hopefully soon.

LucaCappelletti94 commented 1 year ago

Resolved. In the upcoming version, it will be supported. I need to finish some other things in Ensmallen before publishing it, but should be available in a couple days most likely.

mdawas commented 1 year ago

Amazing! thank you very much. I will test it on my side when it's available.

roenciso commented 1 year ago

Hi @LucaCappelletti94, just wondering if the code was checked-in? I see options to dump other models, but for AbstractClassifierModel it seems to not be implemented. I would like to be able to use the link prediction model for an application at work. TIA!