Model Endpoints

Hosting predictive models using scikit-learn and Keras as web endpoints.

Now that we know how to set up a web service and load pre-trained predictive models, we can set up a web service that provides a prediction result in response to a passed-in instance. We’ll deploy models for the games data set using scikit-learn and Keras.

Scikit-Learn

To use scikit-learn to host a predictive model, we’ll modify our echo service built with Flask.

The main changes we need to make are loading a scikit-learn model using MLflow, parsing out the feature vector to pass to the model from the input parameters, and adding the model result to the response payload. The updated Flask application for using scikit-learn is shown in the following snippet:

Get hands-on with 1400+ tech skills courses.