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

# Overview

> Learn how to create, manage, and utilize datasets for batch testing and evaluation.

Datasets in Latitude are collections of data, used primarily for running prompt experiments in the [playground](/guides/prompt-manager/playground) or in the context of [an evaluation](/guides/evaluations/running-evaluations#running-evaluations-on-datasets-run-experiment). They allow you to test your prompts against a consistent set of inputs and expected outputs.

## What is a Dataset?

A dataset consists of rows and columns, where:

* **Input Columns**: Represent the parameters your prompt expects (e.g., `customer_query`, `product_name`).
* **Output/Label Columns (Optional)**: Contain the ground truth or expected outputs for specific inputs (e.g., `expected_sentiment`, `ideal_summary`). These are required for evaluations like Exact Match or Semantic Similarity.

Each row represents a single test case for your prompt.

<img src="https://mintcdn.com/latitudellms/NYIRJRDqJuCM5TjZ/assets/golden-nps-dataset.png?fit=max&auto=format&n=NYIRJRDqJuCM5TjZ&q=85&s=deec01c12065608b37870122c3bcb707" alt="Golden NPS Dataset Example" width="1191" height="885" data-path="assets/golden-nps-dataset.png" />

## Creating Datasets

You can create datasets in Latitude in several ways:

### 1. Uploading CSV Files

This is the most common method for bringing existing test data into Latitude.

1. Navigate to the "Datasets" section in your project.
2. Click "Upload Dataset".
3. Drag and drop your CSV file or browse to select it.
   <img src="https://mintlify.s3.us-west-1.amazonaws.com/latitudellms/assets/upload-dataset.png" alt="" />
4. **Preview and Configure**: Latitude will show a preview of your data. You may need to confirm:
   * Column headers are correctly identified.
   * Data types are inferred correctly.
5. Give your dataset a descriptive name.
6. Click "Create Dataset".

### 2. Generating Synthetic Data

Latitude can use an AI model to generate synthetic datasets based on your specifications, useful for quickly creating test cases or exploring variations.

1. Navigate to the [Datasets](https://app.latitude.so/datasets) section.
2. Click **Generate Dataset**.
3. Describe the data you need:
   * Specify the desired columns (e.g., `user_query`, `expected_category`).
   * Provide instructions on the type of data for each column (e.g., "Generate realistic user support questions", "Assign a category from \[Billing, Technical, General]").
   * Indicate the number of rows to generate.
     <img src="https://mintcdn.com/latitudellms/NYIRJRDqJuCM5TjZ/assets/generate_dataset.png?fit=max&auto=format&n=NYIRJRDqJuCM5TjZ&q=85&s=35af16d734bb6683e26b7945ae9d9fbc" alt="" width="1658" height="1158" data-path="assets/generate_dataset.png" />
4. Click "Generate Dataset".

<Note>
  The generator has limits on complexity and runtime. For large or very complex
  datasets, uploading a CSV is often more reliable. Start with smaller
  generation requests (e.g., 20-50 rows) to test.
</Note>

### 3. Saving Logs as Datasets

You can create a new dataset directly from existing production logs, which is excellent for evaluating prompts against real-world interactions.

1. Navigate to the **Logs** section of one of your prompts.
2. Select the logs you want to include in the dataset.
3. Click the **Save logs to Dataset** button (or similar option).
   <img src="https://mintcdn.com/latitudellms/Ssq9dzRdSVyjHEcj/assets/save-logs-to-dataset.png?fit=max&auto=format&n=Ssq9dzRdSVyjHEcj&q=85&s=4e4255c3a3e5b9c8f0d777b94ccae66b" alt="" width="1276" height="860" data-path="assets/save-logs-to-dataset.png" />
4. Choose in the form whether to create a new dataset or save the logs to an existing dataset.
5. Confirm your selection

## Managing Datasets

Once created, you can manage your datasets from the main "Datasets" page:

* **View**: Click on a dataset name to view its contents.
* **Edit**: Modify, add and remove dataset rows or columns.
* **Rename**: Change the dataset's name.
* **Download**: Export the dataset as a CSV file.
* **Delete**: Permanently remove a dataset.

### Marking an Expected Output Column as a Label

You can mark an expected output column as a label by:

1. Click on the edit button next to the column's name:
   <img src="https://mintcdn.com/latitudellms/NYIRJRDqJuCM5TjZ/assets/datasets-edit-column.png?fit=max&auto=format&n=NYIRJRDqJuCM5TjZ&q=85&s=7f260b4438175d82b683e5bfe7169aaa" alt="Edit column" width="470" height="242" data-path="assets/datasets-edit-column.png" />
2. Set the column's role to "label":
   <img src="https://mintcdn.com/latitudellms/NYIRJRDqJuCM5TjZ/assets/datasets-label-column.png?fit=max&auto=format&n=NYIRJRDqJuCM5TjZ&q=85&s=bfc45a855433c607e57ad039b6702f91" alt="Label column" width="599" height="386" data-path="assets/datasets-label-column.png" />

## Linking Datasets to Evaluations

The primary use of datasets is to run evaluations in batch mode:

1. Go to the specific evaluation you want to run (under a prompt's "Evaluations" tab).
2. Initiate an [Experiment in the evaluation](/guides/evaluations/running-evaluations#running-evaluations-on-datasets-batch-mode).
3. Select the dataset you want to use.
4. If the evaluation requires ground truth (e.g., Exact Match), map the evaluation's expected output requirement to the relevant column in your dataset (e.g., link `expected_output` to the `ideal_summary` column).

Latitude then runs the prompt for each row in the dataset and applies the evaluation, comparing the output to the corresponding data in the dataset row.

## Next Steps

* Learn about establishing [Golden Datasets for Regression Testing](/guides/datasets/golden-datasets)
* Understand how to [Run Evaluations](/guides/evaluations/running-evaluations)
* Explore [Using Datasets for Fine-tuning](/guides/datasets/datasets-for-finetuning)
