- Create an experiment and a model run.
- Create a slice from model run data.
Example: create and retrieve model slice
Before you start
You must import these libraries to use the code examples in this section.API_KEY
with a valid API key to connect to the Labelbox client.
Create a model experiment and a model run
To interact with model slices, you must create a model experiment with a model run and then create a model slice through the platform. The steps below go over this process. See Slices Slicesfor more informationCreate a model experiment
To create a model experiment, you will need to create an ontology. See Ontology for more informationCreate a model run from a model experiment
In this step, you will need to create a dataset to attach data rows to our model run.Create a model slice
Use the Labelbox app to create a model slice.1
From Model, select Experiment and select your model experiment.

2
A filter must be active to create a slice. From the Search menu, select Data row and then set the Condition menu to is not one of.
3
Set Search for an id to test and then press Enter to activate the filter. You can add additional filter conditions as needed.

Example of final view after executing step 2 -3
4
Select Save slice, name your slice, and then select Save. When you do this, the Slice menu displays the name of your slice and the number of matching data rows.
5
From the Slice menu, select Copy slice ID.

Example of final view after executing step 4 - 6
6
Paste the Slice ID into your your code: