John Pace
  • Home
  • About
  • Contact

​​
​
Data Scientist, husband, father of 3 great daughters, 5x Ironman triathlon finisher, just a normal guy who spent a lot of time in school.
Let’s explore data science, artificial intelligence, machine learning, and other topics together.

Curious how to Operationalize Machine Learning Models?

3/10/2020

0 Comments

 
Picture

Customers often ask me about how to operationalize the machine learning models they have created.  It’s common that they have the model, but are struggling with how to apply it to new or existing business data sets. Another line of questioning is about “How do we move the machine learning model forward into production?”

I wrote this article to provide an overview of the basic steps of operationalizing machine learning models.

Creating a logistic regression model that can be operationalized 


Believe it or not, you simply create the model and save it to a file.  This is typically done in a script that is separate from the script that will be used in production.  pickle and joblib are common ways to save random forest, logistic regression, or other classical machine learning models. In this post, I will show the process for pickle.  joblib is very similar.  For neural networks created with Keras, it is recommended to use keras.models.  Once the file is created, you later load it and use it to score your data.

Create the model file and save it
  1. Create (fit) your model
  2. Save it to a file

​Import the model from the file and use it on new data
  1. Import (load) your model file
  2. Get results using the loaded model

​Example:  Logistic Regression

    

That’s all there is to it!  For more in-depth instructions on how to operationalize models using joblib from scikit-learn or saving and loading models in Keras, check out the following helpful websites:


Jason Brownlee
’s Machine Learning Mastery website - 
https://machinelearningmastery.com/save-load-machine-learning-models-python-scikit-learn/
Picture
Picture

Kaggle - 
https://www.kaggle.com/prmohanty/python-how-to-save-and-load-ml-models

Picture

keras.io - 
https://keras.io/getting-started/faq/#how-can-i-save-a-keras-model


Do you work with clients who need help with operationalizing machine learning models? I’d love to hear what questions you commonly come across. Please share by adding a comment below.

If you have questions and want to connect, you can message me on LinkedIn, Twitter:
Follow me on Twitter @pacejohn, LinkedIn https://www.linkedin.com/in/john-pace-phd-20b87070/, and follow my company, Mark III Systems, on Twitter @markiiisystems

#ai #machinelearning #MLDL #artificialintelligence #operationalize #production #python #keras #scikit-learn ​
0 Comments



Leave a Reply.

    Archives

    November 2020
    September 2020
    August 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    May 2019
    April 2019
    March 2019
    April 2018
    March 2018
    January 2018
    November 2017

    Tweets by pacejohn
Proudly powered by Weebly
  • Home
  • About
  • Contact