Model Examples

This topic provides examples of using a model for inference and deploying models to various deployment environments.

Model inference

This notebook uses an ElasticNet model trained on the diabetes dataset described in Train a scikit-learn model and save in scikit-learn format. This notebook shows how to:

  • Select a model to deploy using the MLflow experiment UI
  • Load the trained model as a scikit-learn model
  • Export the model as a PySpark UDF
  • Apply the UDF to add a prediction column to a DataFrame

scikit-learn model deployment on SageMaker

This notebook uses ElasticNet models trained on the diabetes dataset described in Train a scikit-learn model and save in scikit-learn format. The notebook shows how to:

  • Select a model to deploy using the MLflow experiment UI
  • Deploy the model to SageMaker using the MLflow API
  • Query the deployed model using the sagemaker-runtime API
  • Repeat the deployment and query process for another model
  • Delete the deployment using the MLflow API

For information on how to configure AWS authentication so that you can deploy MLflow models in AWS SageMaker from Databricks, see Set up AWS Authentication for SageMaker Deployment.

MLeap model deployment on SageMaker

This notebook uses a PySpark model trained and logged in MLeap format described in Train a PySpark model and save in MLeap format. The notebook shows how to deploy the saved MLeap model to SageMaker.