From model fitting to production in seconds

Original article was published on Artificial Intelligence on Medium

From model fitting to production in seconds

The shortest tutorial I was able to write for deploying ML & AI models efficiently

Putting ML models in production is a challenge; over 60 percent of models never actually make it to production. This need not be the case: putting models into production efficiently can be done using only a few lines of code.

Model fitting

As fitting is not the aim of this tutorial, I will just fit an XGBoost model on the standard scikit-learn breastcancer data:

(I am ignoring model checking and validation; let’s focus on deployment)

Deploying the model

Now we have the fitted model; let’s deploy it using the sclblpy package:

Done.

Using the deployed model

Within seconds after running the code above I received the following email:

Model deployment done.

Clicking the big blue button get’s me to a page where I can directly run inferences:

Generating inferences on the web

While this is nice, you probably want to make a nicer application to use the deployed model. Simply copy-paste code you need for your project:

Simple copy-paste integration of a deployed model into a software project.

And off you go!

Wrap up

There is much more to say about model deployment (and about doing so efficiently: the procedure above actually transpiles your model to WebAssembly to make it efficient and portable), I won’t.

This is just the shortest tutorial I could think of.

Disclaimer

It’s good to note my own involvement here: I am a professor of Data Science at the Jheronimus Academy of Data Science and one of the cofounders of Scailable. Thus, no doubt, I have a vested interest in Scailable; I have an interest in making it grow such that we can finally bring AI to production and deliver on its promises. The opinions expressed here are my own.