I have trained scikit learn model and now I want to use in my python code. Is there a way I can re-use the same model instance? In a simple way, I can load the model again whenever I need it, but as my needs are more frequent I want to load the model once and reuse it again.
Is there a way I can achieve this in python?
Here is the code for one thread in prediction.py:
clf = joblib.load('trainedsgdhuberclassifier.pkl')
clf.predict(userid)
Now for another user I don't want to initiate prediction.py again and spend time in loading the model. Is there a way, I can simply write.
new_recommendations = prediction(userid)
Is it multiprocessing that I should be using here? I am not sure !!