Create a model run

A Model Run is a model training experiment within a Model directory. Each Model Run provides a versioned data snapshot of the Data Rows, annotations, and data splits for that Model Run. You can upload predictions to the Model Run and compare its performance against other Model Runs in a Model directory.

Overview

Once you Create a Model and choose the labeled Data Rows for training, you can add a Model Run to keep track of your model training experiment. It is important to put your Model Run into the model directory with the correct Data Rows and ontology configured in the previous steps.

📘

Multiple experiments

If you are iterating multiple model experiments on a machine learning task, it is best practice to put your Model Runs under the same Model directory. This allows you to visualize and compare the performance of the different Model Runs.

During the Model Run creation process, you can specify how you want to split the selected data rows into training, validation, and testing sets. To learn more, see Curate data splits.

Labelbox versions your Data Rows, annotations, and data splits at the time of training, making it easy for you to reproduce your Model and compare Models trained on different data versions.

Create a Model Run via the UI

  1. First, select the model you just created under the Models tab. Make sure to choose the right Model directory, because the Model Run will access the Data Rows and ontology defined by the Model in the previous step.

  2. If you already have Model Runs in this Model directory, you should see the previous Model Runs' evaluation results. In this case, we are going to create our first Model Run for the newly created Model.

To create a new Model run, click + New Model Run. This will lead you to configure a new model experiment and create data splits.

Create a model run using the SDK

First, follow the instructions in Create a model to create a model.

Each Model Run requires you to specify a list of ground truth label IDs. You can access the ground truth label IDs by exporting labels from your project.

# scripts omitted for creating a model lb_model
lb_model_run = lb_model.create_model_run("model interation 1")

# Add ground truth labels (list of label IDs) to model run. Example: ['cl2mebix4ci3y10ad96kgfnpg', 'cl2mebj9ici4010ad8frvfh5j']
lb_model_run.upsert_labels(ground_truth_labels)
client = labelbox.Client(LB_API_KEY)
project = client.get_project(LABELBOX_PROJECT_ID)

labels_gen = project.label_generator().as_list()
ground_truth_labels = labels_gen._data

### Prepare list of ground truth label IDs: ['cl2mebix4ci3y10ad96kgfnpg', 'cl2mebj9ici4010ad8frvfh5j']
ground_truth_labels_list = [label.uid for label in ground_truth_labels]

run_name = '{}.{}'.format(0,1)
model_name = "My model"

model = client.create_model(name = model_name, ontology_id = project.ontology().uid)
model_run = model.create_model_run(run_name)
model_run.upsert_labels(ground_truth_labels_list)

What’s Next
Did this page help you?