Skip to main content

Installation

SuperAlign SDK & CLI can be directly installed using pip.

For additional project requirements we will need to install the following packages

You can use the following command to install the packages.
OR you can create a requirements.txt file with the following contents
and run the following command

Download and load your dataset

Download your dataset from here. Start by creating a function to load the dataset into a DataFrame. We will use the @load_data() decorator from SuperAlign SDK.

Preprocess the data

We can add a few more functions to preprocess the data. We will use the @transformer() decorator from SuperAlign SDK. with transformer functions. We specify the parent of the functions using the parent argument. This will ensure that the functions are executed in the order specified.
A transformer can have multiple parents. In this case, the transformer will be executed after all the parents have been executed. The output of the parents will be passed as input to the transformer.

Creating a dataset

We can now create a dataset from the pipeline. The dataset will be created by executing the pipeline and saving the output of the last transformer in the pipeline. The dataset can be created by using the @dataset decorator. The decorator takes the following arguments:
  • label: The name of the dataset
  • parent: The name of the transformer whose output will be saved as the dataset
  • upload: If True, the dataset will be uploaded to the cloud. If False, the dataset will be saved locally.

Creating a model to classify the dataset

With the SuperAlign model module, you can perform a variety of actions related to creating and managing models. SuperAlign assists you with training and tracking all of your machine learning project information, including ML models and datasets, using semantic versioning and full artifact logging. We can make a separate python file for the model. The model file will contain the model definition and the training code. The model training function can be created by using the @model decorator. The decorator takes the model name as the argument in the format model_name.
Once our training is complete our model will be ready to rock and roll🎸✨. But that’s too much of a hassle. So for now, let’s just do some predictions

Add prediction to your model

For registered models, prediction function along with its requirements and resources can be logged to be used for further processes like evaluating and packaging. SuperAlign predict module has a method add. Here we are using the following arguments:
  • label: The name of the model (model_name:version)
  • paths: The path to the predict.py file and requirements.txt file.
Our predict.py file has the script to load the model and make predictions. The requirements.txt file has the dependencies required to run the predict.py file.
You can know more about the prediction process here
store the above python code as predict.py. The predict file is specific for this example

Create your first Evaluation

Congrats! You have successfully created your first evaluation. You can now apply polices in Dashboard.
To know more about applying policies, you can refer to the documentation here To know more about the Documents upload, you can refer to the documentation here To know more about the Questionaire, you can refer to the documentation here To know more about the Forms, you can refer to the documentation here To know more about Report Generation, you can refer to the documentation here