1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to MLflow

Connected

Exercise

Creating a custom Python Class

MLflow provides a way to create custom models in order to provide a way to support a wide variety of use cases. To create custom models, MLflow allows for users to create a Python Class which inherits mlflow.pyfunc.PythonModel Class. The PythonModel Class provides customization by providing methods for custom inference logic and artifact dependencies.

In this exercise, you will create a new Python Class for a custom model that loads a specific model and then decodes labels after inference. The mlflow module will be imported.

Instructions

100 XP
  • Create a Python Class with the name CustomPredict.
  • Define the load_context() method used for loading artifacts within a custom Class.
  • Define the predict() method for defining custom inference.