> 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/explore/sdv-bundles/targeted-sampling.md).

# ❖ Targeted Sampling

The **Targeted Sampling** bundle allows you to create synthetic data that is specific and targeted to your usage. You can use targeted sampling to:

:star: **Create minimum viable synthetic test sets** for software testing and QA. Define the exact values that you need across multiple tables, and let SDV handle the rest.

:star: **De-bias and rebalance your datasets**. Adjust the proportions of values to generate in the synthetic data to create a more balanced, fairer representation of the data you'd like to use for ML development.

:star: **Generate hypothetical scenarios.** Create edge cases and situations that don't exist in the real data — but are theoretically possible to observe.

{% hint style="info" icon="user" %}
Bundles are available to licensed users. Sign up now to get your license key. You can then complete your installation on-prem and begin using the features.

<p align="center"><a href="https://portal.datacebo.com/signup" class="button primary">Get Started</a><a href="https://datacebo.com/pricing/" class="button secondary">View Pricing</a></p>
{% endhint %}

## Included Features

The Targeted Sampling bundle currently supports [**multi-table conditional sampling**](/sdv/sampling/conditional.md) for the HSA and Independent Synthesizers.

```python
from sdv.sampling import Condition, MultiTableCondition

# Step 1: Create Single-Table Conditions
resort_hotels = Condition(
    num_rows=10,
    table_name='hotels',
    column_values={'classification': 'RESORT'})

suite_guests_with_rewards = Condition(
    table_name='guests'
    column_values={'room_type': 'SUITE', 'has_rewards': True})

# Step 2: Compose Multi-Table Conditions    
suites_in_resorts = MultiTableCondition(
    conditions=[resort_hotels, suite_guests_with_rewards])

# Step 3: Sample Synthetic Data
synthetic_data = synthesizer.sample_from_conditions([suite_guests_with_rewards])
```

## Installation

Use your SDV Enterprise credentials to install SDV Enterprise and all bundles that you have access to.

```bash
% pip install sdv-installer --upgrade
% sdv-installer install --upgrade
```

```
Username: <email>
License Key: ********************************

Installing SDV Enterprise:
sdv-enterprise (version 0.30.0) - Installed!

Installing Bundles:
bundle-cag - Installed!
bundle-xsynthesizers - Installed!

Success! All packages have been installed. You are ready to use SDV Enterprise.
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sdv.dev/sdv/explore/sdv-bundles/targeted-sampling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
