> For the complete documentation index, see [llms.txt](https://docs.sdv.dev/sdv/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sdv.dev/sdv/modeling/configuration/range-extrapolation.md).

# ❖ Range Extrapolation

{% hint style="info" %}
❖ **SDV Enterprise Bundle**. This feature is available as part of the **Targeted Sampling** bundle, an optional add-on to SDV Enterprise. For more information, please visit the [Targeted Sampling](/sdv/explore/sdv-bundles/targeted-sampling.md) page.
{% endhint %}

By default, your synthesizers learns the patterns based on the training data you provide, including the possible ranges within each column. The **range extrapolation** feature allows you to create synthetic data that is **outside the ranges of your training data**.

## Usage

This feature is meant for extrapolating outside of the ranges that your training data contains. This covers:

* Extrapolating the possible min and max for continuous attributes like numerical or datetime columns
* Creating brand new category values that were not present in your original training data
* Allowing null (or non-null) values in a column even when your training data doesn't have this scenario covered

### Specify Ranges in the Metadata

Make sure that your metadata object contains the full ranges that you want to specify. This includes the min/max values of ranges, full lists of category values, and more.&#x20;

For more information, see the [Metadata API](/sdv/integration/metadata.md).

### Use Your Synthesizer as Usual

The range extrapolation will automatically be applied when you create a synthesizer with the metadata.

```python
from sdv.multi_table import HSASynthesizer

synthesizer = HSASynthesizer(metadata)
```

## What's Next?

Be sure to fit your syntheizer for the extrapolation to work.

```python
my_synthesizer.fit(data)
```

After fitting, you can sample synthetic data as usual. The synthetic data will now contain the full ranges that you specified in your dictionary as opposed to the ranges from the training data.

```python
synthetic_data = my_synthesizer.sample(scale=10)
```

Note that you may need to sample many data points in order to see the extrapolated values. Alternatively, you can request the extrapolated values explicitly. For example, say your training data only included users aged 25-60 but your range extrapolation extends the ranges from 18-100. You can then request synthesizing any age between 18 and 100.

```python
from sdv.sampling import Condition

older_users = Condition(
    num_rows=10,
    table_name='users',
    column_values={'age': '90'})

younger_users = Condition(
    num_rows=10,
    table_name='users',
    column_values={'age': '18'})

synthesizer.sample_from_conditions([older_users, younger_users])
```

For more information, see the API docs for [conditional sampling](/sdv/sampling/conditional.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sdv.dev/sdv/modeling/configuration/range-extrapolation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
