benedekrozemberczki / karateclub

Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)
https://karateclub.readthedocs.io
GNU General Public License v3.0
2.17k stars 247 forks source link

save graph2vec model #110

Closed riyaj8888 closed 2 years ago

riyaj8888 commented 2 years ago

Hi, How can we save/load the graph2vec model after training?

tomlincr commented 2 years ago

@riyaj8888 you can use the standard techniques for scikit-learn models like pickle, joblib etc.

For example:

from joblib import dump, load
dump(model, 'saved_model.joblib') 
model2 = load('saved_model.joblib') 
embedding = model2.get_embedding()

Reference:

https://scikit-learn.org/stable/model_persistence.html