Hi! I have a question.
Abhinav Chauhan

How frequently are you going to re-train your model? One scenario is that you want to do this infrequently, let’s say once a day, so you just call that endpoint, replace clf in memory, and persist the object on disk, which should be OK. Another scenario is if you want to do it more frequently (maybe with the arrival of each new data point), in that case you may want to use incremental (aka online) learning (http://scikit-learn.org/stable/modules/scaling_strategies.html). In that case you may rightly be concerned with pickling the model with every new data point. One solution is to use partial_fit to update the model in real-time and then run a batch job every day to re-train the model and store the pickled version (you need to log all the incoming data to be able to re-train the model in batch). The architecture becomes a little more complicated in the latter case.

Like what you read? Give Amir Ziai a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.