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

# Smart Sample

> ML-powered workflow for curating relevant subsets of data to label, explore, share, and more

![Screen Shot 2022-07-01 at 12.56.26 PM](https://mintcdn.com/scale-full-docs/0LAM4ucKzAG9Dmk0/assets/nucleus/8b6c60a-Screen_Shot_2022-07-01_at_12.56.26_PM.webp?fit=max\&auto=format\&n=0LAM4ucKzAG9Dmk0\&q=85\&s=4fc500832e21451234a29e3fef370b2a)

# Description

Smart Sample allows you to filter and sample down to a highly relevant subset of data. Fine tune by applying filters on your [Metadata](https://api-reference.scale.com/docs/nucleus/uploading-images.md#updating-metadata) and [Autotags](https://api-reference.scale.com/docs/nucleus/introduction-to-autotag.md#what-is-autotag), and sample down the result by removing duplicates or applying random selection.

`Pre-reqs`: Dataset with embeddings

# Steps

1. Open an indexed dataset.
2. Enter the Smart Sample menu by clicking "Smart Sample" in the top right.
3. Add Metadata and/or Autotag filters (see [Filters](https://api-reference.scale.com/docs/nucleus/smart-sample.md#filters)). This step is optional.
4. Apply sampling if the Item Count (after filters, if any) is still too high.
   a. Set your desired target number. This must be less than the Item Count after filters.
   b. Choose a sampling strategy (see [Sampling Strategies](https://api-reference.scale.com/docs/nucleus/smart-sample.md#sampling-strategies)).
5. Click "Create Slice" in the bottom right and name the finished Slice.

## Filters

1. Choose a filter option in 'Add Filter'.
2. For an Autotag filter, you can choose the range of Autotag scores that you want to filter the dataset down to. The lower the score, the less relevant the item is to the Autotag.
3. For a Metadata filter, you can choose the image metadata key you want to compare against and set a value.
4. When your filter is valid, the item count will be updated on the right hand side of the filter. This new value will represent the sample size after applying your filter and all the filters above it.

## Sampling Strategies

> [!WARNING]
>
> Sampling Strategies are applied *after* all filters are applied first, if any; i.e. Nucleus samples the filter results.
>
> Also, sampling is only applied when the target number is less than the Item Count after filters, if any.

### Uniqueness Sampling

Removes any near-duplicates and samples down to the most representative subset of the filter results.

Similar to active learning, Nucleus will curate the subset of data that would best improve model performance based on embeddings. The default embeddings are based on [CLIP](https://openai.com/blog/clip/), but we highly recommend supplying your own [custom embeddings](https://api-reference.scale.com/docs/nucleus/custom-embeddings.md).

### Random Sampling

Randomly selects from the filter results until the target number is reached.

### Highest and Lowest Sampling

Sorts the filter results based on a metadata field of your choosing, then selects starting from the top/highest or bottom/lowest until the target number is reached.

Null metadata values will be selected last in both cases.
