---
title: Publish a recipe
description: Publish a recipe to push down transformations to your data source and generate an output dataset.

---

# Publish a recipe {: #publish-a-recipe }

Once the recipe is built and the live sample looks ready for modeling, you can publish the recipe, pushing it down as a query to the data source. There, the query is executed by applying the recipe to the entire dataset and materializing a new output dataset. The output is sent back to DataRobot and added to the Use Case.

See the associated [considerations](wb-data-ref/index#wrangle-data) for important additional information.

To publish a recipe:

1. After you're done wrangling a dataset, click **Publish recipe**.

    ![](images/wb-publish-5.png)

2. Enter a name for the output dataset. DataRobot will use this name to register the dataset in the AI Catalog and Data Registry.

    ![](images/wb-publish-3.png)

3. (Optional) Configure [Automatic downsampling](#configure-downsampling).

    ![](images/wb-publish-4.png)

4. Click **Publish**.

    DataRobot sends the published recipe to Snowflake and where it is applied to the source data to create a new output dataset. In DataRobot, the output dataset is registered in the Data Registry and added to your Use Case.

## Publish to your data source {: #publish-to-your-data-source }

!!! info "Public preview"

    === "Snowflake"

        In-source materialization for Snowflake is on by default. 

        <b>Feature flags:</b> 
        
           - Enable Snowflake In-Source Materialization in Workbench
           - Enable Dynamic Datasets in Workbench

    === "Google BigQuery"     
    
        In-source materialization for BigQuery is on by default. 

        <b>Feature flags:</b> 
        
           - Enable BigQuery In-Source Materialization in Workbench
           - Enable Dynamic Datasets in Workbench

    === "Azure Databricks"

        In-source materialization for Azure Databricks, and the associated feature flags, are on by default.

        <b>Feature flags:</b> 
        
        - Enable Databricks Driver
        - Enable Databricks Wrangling           
        - Enable Databricks In-Source Materialization in Workbench
        - Enable Dynamic Datasets in Workbench

When you publish a wrangling recipe, those operations and settings are pushed down into your virtual warehouse, allowing you to leverage the security, compliance, and financial controls specified within its environment. Selecting this option materializes an output dynamic dataset in DataRobot's Data Registry as well as your data source.

!!! warning "Required permissions"
    You must have `write` access to the selected schema and database.

To enable in-source materialization (for Snowflake in this example):

1. In the **Publishing Settings** modal, click **Publish to Snowflake**.

    ![](images/wb-snow-mat-1.png)

2. Select the appropriate Snowflake **Database** and **Schema** using the dropdowns.

    ![](images/wb-snow-mat-2.png)

3. From here, you can:

    - Publish your recipe.
    - [Configure downsampling](#configure-downsampling).

## Configure downsampling {: #configure-downsampling }

Automatic downsampling is a technique used to reduce the size of a dataset by reducing the size of the majority class using random sampling.  Consider enabling automatic downsampling if the size of your source data exceeds that of [DataRobot's file size requirements](file-types){ target=_blank }.

To configure downsampling:

1. Enable the **Automatic downsampling** toggle in the **Publishing Settings** modal.

    ![](images/wb-publish-1.png)

2. Specify the **Maximum number of rows** and **Estimated size** in megabytes.

    ![](images/wb-publish-2.png)

## Configure smart downsampling {: #configure-smart-downsampling }

!!! info "Public preview"
     Smart downsampling in Workbench is on by default.

     <b>Feature flag:</b> Enables Smart Downsampling in Wrangle Publishing Settings

You can use smart downsampling to reduce the size of your output dataset when publishing a wrangling recipe. Smart downsampling is a data science technique to reduce the time it takes to fit a model without sacrificing accuracy; it is particularly useful for imbalanced data. This downsampling technique accounts for class imbalance by stratifying the sample by class. In most cases, the entire minority class is preserved, and sampling only applies to the majority class. Because accuracy is typically more important on the minority class, this technique greatly reduces the size of the training dataset (reducing modeling time and cost), while preserving model accuracy.

To configure smart downsampling:

1. Enable the **Automatic downsampling** toggle and click **Smart**.

     ![](images/wb-smart-down-1.png)

2. Select a **Target** feature&mdash;a binary classification or zero-inflated feature. If the dataset does not contain either feature type, the option to apply smart downsampling is unavailable. 

     ![](images/wb-smart-down-3.png)

3. (Optional) Enter a name for the **Weights feature**. This column, which contains downsampling weights, is computed and added to your output dataset as a result of smart downsampling.

4. Enter the desired **Maximum number of rows** _or_ **Estimated Size (MB)**. These values are linked, so if you change the value in one field, the other field updates automatically. See [DataRobot's dataset requirements](file-types) to ensure the output dataset is below the file size limit.

     ![](images/wb-smart-down-2.png)

!!! note 
     Any rows with `null` as a value in the target column will be filtered out after smart downsampling.

## Next steps {: #next-steps }

From here, you can:

- [Add more data.](wb-add-data/index)
- [View exploratory data insights to determine if you want to continue data wrangling.](wb-data-tab)
- [Use the dataset to set up an experiment and start modeling.](wb-experiment/index)

## Read more {: #read-more}

To learn more about the topics discussed on this page, see:

- [Snowflake documentation on pushdown.](https://docs.snowflake.com/en/developer-guide/pushdown-optimization){ target=_blank }
- [DataRobot file size requirements.](file-types){ target=_blank }
