> ## Documentation Index
> Fetch the complete documentation index at: https://docs.labelbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload predictions to a model run

> Learn how to upload your model predictions to a model run to enable model error analysis and active learning workflows.

Check out these end-to-end developer guides to learn how to upload predictions.

**Developer Guides**:

<CardGroup>
  <Card title="Upload image predictions" href="/horizon/developer-guides/upload-image-predictions" icon="image" horizontal />

  <Card title="Upload video predictions" href="/horizon/developer-guides/upload-video-predictions" icon="video" horizontal />

  <Card title="Upload text predictions" href="/horizon/developer-guides/upload-text-predictions" icon="text" horizontal />

  <Card title="Upload geospatial predictions" href="/horizon/developer-guides/upload-geospatial-predictions" icon="map" horizontal />

  <Card title="Upload HTML predictions" href="/horizon/developer-guides/upload-html-predictions" icon="code" horizontal />
</CardGroup>

## Overview

You will need to upload your model predictions to Labelbox to perform model error analysis, use model-assisted labeling, or set up active learning workflows. This page contains instructions for uploading model predictions to a model run, which is a container for the predictions, annotations, and metrics of a specific experiment in your ML model development cycle.

You can include confidence scores and custom metrics when you upload your model predictions to a model run. However, given the predictions and annotations in a model run, Labelbox will automatically calculate some [auto-generated metrics](/horizon/guides/model-runs#auto-generated-metrics) upon upload.

## How to upload predictions to a model run

### Step 1: Import data rows

To upload predictions in a model run, you'll need to have a set of data rows to upload the predictions on. If you do not already have a set of data rows, you'll need to import data rows in a dataset in Catalog.

To learn how to import data rows via the Python SDK (Step 1), see this [tutorial](/horizon/developer-guides/upload-image-predictions#step-1-import-data-rows-into-catalog).

To learn more about creating data rows, see [Create a dataset in Catalog](/horizon/guides/datasets-datarows).

### Step 2: Create/select an ontology for your model predictions

When you create a Model - to upload a set of predictions - you'll need to specify the ontology (also called taxonomy) that corresponds to the set of predictions. You may want to re-use an ontology that already exists in Labelbox - e.g. an ontology already used for a labeling project. Or, you may want to use an ontology for your model predictions that does not exist in Labelbox yet. In the latter case, you'll need to create an ontology.

To learn how to create an ontology via the Python SDK (Step 2), see this [tutorial](/horizon/developer-guides/upload-image-predictions#step-2-set-up-ontology-for-predictions).

To learn more about creating ontologies, see [Create/modify ontologies](/horizon/guides/labelbox-ontology).

### Step 3: Create an experiment and a model run

Before you can upload your predictions, you'll need to make sure you have an experiment and a model run to contain them. You cannot simply upload predictions without specifying which Model and model run they'll be associated with. An experiment is attached to an ontology: it defines the predictions that can be contained in it. An experiment can contain any number of model runs. Each model run corresponds to an experiment in your ML model development cycle. If you do not already have a Model and a model run, you will need to create a Model, then attach the ontology that fits your predictions, and finally create a model run.

To learn how to set up a Model and model run via the Python SDK (step 3), see this [tutorial](/horizon/developer-guides/upload-image-predictions#step-3-create-model-and-model-run).

For more information, see [experiments](/horizon/guides/experiments), [Create a model run](/horizon/guides/create-a-model-run), [Create a project](/horizon/guides/create-a-project).

### Step 4: Send a set of data rows to the model run

Now that you have your Model, model run, and ontology configured, you'll need to send a set of data rows to the model run.

To learn how to send data rows to a model run via the Python SDK (Step 4), see this [tutorial](/horizon/developer-guides/upload-image-predictions#step-4-send-data-rows-to-model-run).

### Step 5: Optionally, send annotations to the model run

After you have successfully configured your model run with the correct ontology and sent data rows to the model run, you can optionally send annotations to the model run.

To learn how to send annotations to a model run via the Python SDK (Step 5), see this [tutorial](/horizon/developer-guides/upload-image-predictions#step-5-create-prediction-payloads).

### Step 6: Create the predictions payload

<Info>
  ### Uploading confidence scores with each model prediction

  Labelbox now supports specifying the confidence score associated with every model prediction. It is optional.
</Info>

After you have successfully configured your model run with the correct ontology and sent data rows (and optionally annotations) to the model run, you are ready to prepare the predictions payload. To do this, you will need to use our Python SDK. Each imported prediction will need to reference a feature class within the ontology (see step 2 above) and a specific data row ID. Labelbox supports two formats for the predictions payload: NDJSON and Python Annotation types.

<CardGroup>
  <Card title="Option A: Import predictions via Python Annotation types (recommended)" href="/horizon/developer-guides/upload-image-predictions#step-5-create-prediction-payloads" icon="python" horizontal />

  <Card title="Option B: Import predictions via NDJSON" href="/horizon/developer-guides/upload-image-predictions#step-5-create-prediction-payloads" icon="code" horizontal />
</CardGroup>

Use the table below to find a prediction payload sample for your asset type. The "-" symbol indicates that importing predictions to a model run is not supported for that prediction/asset type combination. To learn how to create a prediction payload (Step 6), see this [tutorial](/horizon/developer-guides/upload-image-predictions#step-6-create-the-predictions-payload).

| | Image | Video | Text | Documents | Geospatial | Audio | Conversational text |
| - | - | - | - | - | - | - | - |
| **Bounding box** | [Payload](/horizon/developer-guides/import-image-annotations#bounding-box) | [Payload](/horizon/developer-guides/import-video-annotations#bounding-box-frame-based) | N/A | [Payload](/horizon/developer-guides/import-document-annotations#bounding-box-page-specific) | [Payload](/horizon/developer-guides/import-geospatial-annotations#bounding-box) | N/A | N/A |
| **Polygon** | [Payload](/horizon/developer-guides/import-image-annotations#polygon) | - | N/A | N/A | [Payload](/horizon/developer-guides/import-geospatial-annotations#polygon) | N/A | N/A |
| **Point** | [Payload](/horizon/developer-guides/import-image-annotations#point) | [Payload](/horizon/developer-guides/import-video-annotations#point-frame-based) | N/A | N/A | [Payload](/horizon/developer-guides/import-geospatial-annotations#point) | N/A | N/A |
| **Polyline** | [Payload](/horizon/developer-guides/import-image-annotations#polyline) | [Payload](/horizon/developer-guides/import-video-annotations#polyline-frame-based) | N/A | N/A | [Payload](/horizon/developer-guides/import-geospatial-annotations#polyline) | N/A | N/A |
| **Segmentation mask** | [Payload](/horizon/developer-guides/import-image-annotations#segmentation-mask) | [Payload](/horizon/developer-guides/import-video-annotations#masks-frame-based) | N/A | N/A | - | N/A | N/A |
| **Text entity** | N/A | N/A | [Payload](/horizon/developer-guides/import-text-annotations#entity) | [Payload](/horizon/developer-guides/import-document-annotations#entity-page-specific) | N/A | N/A | [Payload](/horizon/developer-guides/import-conversational-text-annotations#entity-message-based) |
| **Classification - Radio** | [Payload](/horizon/developer-guides/import-image-annotations#classification-radio-single-choice) | [Payload](/horizon/developer-guides/import-video-annotations#classification-radio-frame-based) | [Payload](/horizon/developer-guides/import-text-annotations#classification--radio-single-choice) | [Payload](/horizon/developer-guides/import-document-annotations#classification-radio-single-choice-global) | [Payload](/horizon/developer-guides/import-geospatial-annotations#classification-radio-single-choice) | [Payload](/horizon/developer-guides/import-audio-annotations#classification-radio-single-choice) | [Payload](/horizon/developer-guides/import-conversational-text-annotations#classification-radio-single-choice-message-based) |
| **Classification - Checklist** | [Payload](/horizon/developer-guides/import-image-annotations#classification-checklist-multi-choice) | [Payload](/horizon/developer-guides/import-video-annotations#classification-checklist-frame-based) | [Payload](/horizon/developer-guides/import-text-annotations#classification-checklist-multi-choice) | [Payload](/horizon/developer-guides/import-document-annotations#classification-checklist-multi-choice-global) | [Payload](/horizon/developer-guides/import-geospatial-annotations#classification-checklist-multi-choice) | [Payload](/horizon/developer-guides/import-audio-annotations#classification-checklist-multi-choice) | [Payload](/horizon/developer-guides/import-conversational-text-annotations#classification-checklist-multi-choice-message-based) |
| **Classification - Free-form text** | [Payload](/horizon/developer-guides/import-image-annotations#classification-free-form-text) | - | [Payload](/horizon/developer-guides/import-text-annotations#classification-free-form-text) | [Payload](/horizon/developer-guides/import-document-annotations#classification-free-form-text-global) | [Payload](/horizon/developer-guides/import-geospatial-annotations#classification-free-form-text) | [Payload](/horizon/developer-guides/import-audio-annotations#classification-free-form-text) | [Payload](/horizon/developer-guides/import-conversational-text-annotations#classification-free-form-text-message-based) |
| **Relationship** | [Payload](/horizon/developer-guides/import-image-annotations#relationship-with-bounding-box) | - | [Payload](/horizon/developer-guides/import-text-annotations#relationship-with-ner) | [Payload](/horizon/developer-guides/import-document-annotations#relationships-with-entity-page-specific) | - | N/A | [Payload](/horizon/developer-guides/import-conversational-text-annotations#relationship-with-entity-message-based) |

### Step 7: Upload the predictions payload to the model run

After you have constructed your predictions payload, you are ready to upload it to the model run. To do this you will need to use our Python SDK. See the table in the next section to find the end-to-end tutorial that most closely fits your use case.

To learn how to upload a prediction payload via the SDK (Step 7), see this [tutorial](/horizon/developer-guides/upload-image-predictions#step-7-send-annotations-to-a-model-run).
