- Create models to track and assess their relevance using generic model data.
- Automatically version models to efficiently organize model runs. SuperAlign logs model parameters, metrics, and other metadata that changes for each registered model.
- Fetch stored models and their metadata through our API.
Creating Models
With the SuperAlign model module, you can perform a variety of actions related to creating and managing models. Here’s an overview of the available methods: Creating a Model To create a new model, import the pureml module and use themodel.init
method:
label parameter consists of model name in the following format:
_\<name>:\<version>_
For initializing a model, version is not required. So, we use <name>: as the label.label should not contain any spaces. Special characters other than ”-”
and ”_” are not allowed.
Created a model? No? Create one
now. Yes? Here’s what you
should do next.
Register Models
SuperAlign assists you with creating, training, and tracking all of your machine learning project information, including ML models and datasets, using semantic versioning and full artifact logging. This short tutorial will show you how to register and track machine learning models using SuperAlign.Train and Register your Model Version
We will train aXGBClassifier
to predict the classes of samples from Iris dataset
in this tutorial. This is a straightforward training function that returns the trained model and prints the accuracy
of our model. We will utilize the Iris
data from sklearn.
Now let’s register our model to pureml
To register the model, add the@model
decorator to the training function. SuperAlign will register the returned trained model to your SuperAlign project.
Let’s also replace print()
with pureml.log()
to register obtained model metrics to the project.
Fetching a Model
Once you register your model to SuperAlign, you can load the model from SuperAlign usingmodel
module.
Let’s look at how to load and generate predictions with your model:
fetch
method fetches latest
version of the model. A particular version
of a model can be fetched by providing version parameter as the following.
v3
of the model iris_classifier
.
Listing Models
To list all available models, use themodel.list
method: