# Dataset

> The Dataset is a structured collection of data used to train, validate or test AI models.

## What is a dataset in machine learning?

The collection of examples used to train, validate and test a model. Its size, quality, diversity and licensing directly affect the result: biased or noisy data leads to biased or unreliable models.

- Topic: Basics
- Type: concept

## Example

Wrong:

```js
const shuffled = shuffle(rows);
const train = shuffled;
const test = shuffled.slice(0, 200);
```

Right:

```js
const shuffled = shuffle(rows);
const test = shuffled.slice(0, 200);
const train = shuffled.slice(200);
```

The test rows are no longer part of the training set, so the score measures how the model does on unseen data.

## Common mistakes

- Evaluating a model on data it already saw during training.

## Key points

- Training, validation and test splits do not share the same examples.
- The test set is never used for training or for tuning settings.

## Interview questions

### What is the difference between training, validation and test sets?

The training set fits the model, the validation set tunes settings and picks versions, and the test set gives a final score on unseen data.

### How big should a dataset be?

It depends on the task and model. Quality and coverage of real cases usually matter more than raw size, especially for fine-tuning.

### What is data leakage?

Data leakage happens when information from the test set reaches training, making scores look better than the model really performs.

## Related cards

- [Training](https://wonderium.dev/ai/training.md)
- [Overfitting](https://wonderium.dev/ai/overfitting.md)
- [Synthetic Data](https://wonderium.dev/ai/synthetic-data.md)
- [Data Poisoning](https://wonderium.dev/ai/data-poisoning.md)
- [Evals](https://wonderium.dev/ai/evals.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/dataset
- Last updated: 2026-11-25
