I have been playing around with a lot of different machine learning models (clustering, neural nets, etc...), but I am sort of stuck on understanding what happens after you finish building the model in Python or Matlab.

For example, let's say that I trained a basic neural network model for a binary classification problem. How does one deploy that to colleagues, for example, so that they can load in the dataset to spit out a prediction? I have trained a model, but what happens to that model, now? How do I "save" that model that I just trained in Python?

I see a lot of tutorials on how to pre-process data, train the model, spit out the statistics and predictions; but, what comes next?

Obviously Facebook, Google, and anyone else heavily involved in machine learning / AI applications are creating a framework to use their models. But, is there software that allows you to pull in data and then apply it to your Python code? Is this what Weka, TensorFlow, and these other packages do?

  • 1
    $\begingroup$ It depends on the model and server environment; there's no industry standard. You might use the same software you used to train (e.g., scikit-learn or tensorflow), or something completely different that accepts your model's parameters (specified using JSON or PMML). Where your server is going to run will strongly influence your options. $\endgroup$
    – Emre
    Commented Mar 11, 2017 at 1:12
  • $\begingroup$ A related question and answer, in particular about scikit-learn: datascience.stackexchange.com/a/33496/53479 $\endgroup$
    – mapto
    Commented Jun 27, 2018 at 6:24
  • $\begingroup$ Possible duplicate of How does real world machine learning production systems run? $\endgroup$
    – mapto
    Commented Feb 27, 2019 at 10:20

2 Answers 2


what comes after training a model is persisting (in layman terms, saving) a model, if you want to save the parameters for later deployment.

All companies that do serious machine learning spend many hours (sometimes even days or weeks) training the models. Obviously, when you need rapid predictions in a deployment mode, you use a pre-trained model to generate said prediction.

In python, for example, there are a number of way to persist models. The most common libraries used are pickle and cpickle (i/o much faster I believe as the core is in C).

Here is a link to model persistence in sklearn:



Here is an example of how to Integrate a Machine Learning Model into a Web app https://www.youtube.com/watch?v=mu-R0dQ3-Qo and the code can be found here https://github.com/shivasj/Integrating-a-Machine-Learning-Model-into-a-Web-app


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.