# Dataset health, splits, and versions

## Overview

Dataset health checks help identify insufficient data, unsuitable splits, and class imbalance before training. Dataset versions
freeze a training input so you can reproduce a run even after the working dataset changes.

> **Note**
> Health and split sizes count samples whose annotation status is Completed. Review and complete approved samples before using these indicators to judge readiness.

## Review dataset metadata and health

Open a dataset and select Metadata. The summary shows the total completed size, completed samples in each split, and the number of
uncompleted samples.

Review the overall health status and each health row. The page also lists task names, task types and classes, a split-distribution
chart, and per-class annotation counts.

Use these details to decide whether to collect more data, complete more annotations, adjust splits, or address class imbalance.

### Health-check reference

| Check | Healthy signal | Unhealthy or failed signal | Why it matters |
| --- | --- | --- | --- |
| Size | At least 1,000 completed samples | Fewer than 16 fails; 16–999 is unhealthy | Very small datasets make it difficult to
learn patterns that generalize |
| Split distribution | Completed samples are distributed roughly 80/10/10 across train, validation, and test | One or more splits
differ substantially from their intended share | Training needs most of the data, while validation and test need enough
independent examples to be meaningful |
| Class distribution | Every class is represented and none is far below an even share | A class is absent or severely
under-represented | Strong imbalance can bias the model toward frequent classes |

The overall result is Fail if any check fails, otherwise Unhealthy if any check is unhealthy, and Healthy when all checks are
healthy.

> **Health is advisory**
> A healthy status is not a guarantee of model quality, and an unhealthy status does not by itself block a run. Training does require at least one completed training sample. If validation is empty, the training workflow falls back to the train split. An evaluation run requires completed samples in the validation or test split you select.

## Understand splits

Splits keep model optimization separate from model assessment:

 * The Train split is seen repeatedly while model weights are updated.
 * The Validation split is checked during training to tune decisions and select the best checkpoint.
 * The Test split is reserved for a final, less-biased measurement after training choices have been made.

An approximate 80/10/10 distribution is a useful default, but the best proportions depend on dataset size and how much independent
validation and test coverage the problem needs. More important than exact percentages is preventing near-duplicate scenes from
leaking across splits, because that can make evaluation appear better than real deployment performance.

To redistribute the working dataset, open its action menu and select Re-split. Choose percentages that total 100; Hub applies the
change as a background job. Re-splitting changes the working dataset but not existing read-only versions.

## Version a dataset for training

A version copies the selected state of a dataset into a frozen, read-only resource. In Hub, versions are normally created from the
training run form.

From a project, open New Training Run and enable Version Dataset. The version uses the run name so the data snapshot is easy to
associate with its run.

Select tags when the run should use only part of the dataset. AND requires every selected tag, while OR includes samples with any
selected tag. Leave the filter empty to version the full dataset.

When you submit the run, the Version and Start Training Run job creates or reuses the version before training begins.

Use the Version filter on the dataset page to inspect a read-only snapshot. Dataset-version selectors and the run's Linked Dataset
Version field provide direct access to the same resource.

Versioning adds copy time before training starts, especially for large datasets, so it is optional. When nothing has changed since
the latest version created with the same tag filter, Hub reuses that version.

Use versions when you need to:

 * reproduce a run after the working dataset changes;
 * compare architectures or settings on identical samples and annotations;
 * audit which data produced a deployed model;
 * preserve a tag-selected training cohort while continuing to collect data.

Continue with [Training & Evaluation Runs](https://docs.luxonis.com/cloud/hubai/training/runs.md) to use a dataset or dataset
version in a project.
