# Modify a blueprint
URL: https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/cml/cml-blueprint-edit.html

> Describes how a blueprint works and the basics of using the blueprint editor.

# Modify a blueprint

This section describes the blueprint editor. A blueprint represents the high-level end-to-end procedure for fitting the model, including any preprocessing steps, modeling, and post-processing steps. The description of the [Describe > Blueprints](https://docs.datarobot.com/en/docs/api/reference/public-api/blueprints.html) tab provides a detailed explanation of blueprint elements.

When you create your own blueprints, DataRobot [validates modifications](https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/cml/cml-blueprint-edit.html#blueprint-validation) to ensure that changes are intentional, not to enforce requirements. As such, blueprints with validation warnings are saved and can be trained, despite the warnings. While this flexibility prevents erroneously constraining you, be aware that a blueprint with warnings is not likely to successfully build a model.

## How a blueprint works

Before working with the editor, make sure you understand the kind of data processing a blueprint can handle, the components for building a pipeline, and how tasks within a pipeline work.

### Blueprint data processing abilities

A blueprint is designed to implement training pipelines, including modeling, calibration, and model-specific preprocessing steps. Other types of data preparation are best addressed using other tools. When deciding where to implement data processing steps, consider that the following aspects apply to all blueprints:

- Input data is limited to a single post-EDA2dataset. No joins can be defined inside a blueprint. All joins should be accomplished prior to EDA2 (using, for example,Spark SQL,Feature Discovery,or code.
- Output data is limited to predictions for the project’s target, as well as information about those predictions (Prediction Explanations).
- Post-processing that produces output in a different format should be defined outside of the blueprint.
- No filtering or aggregation is allowed inside a blueprint but can be accomplished withSpark SQL,Feature Discovery, or code.

### Blueprint task types

DataRobot supports two types of tasks—estimator and transform.

- Estimator taskspredict new value(s) (y) by using the input data (x). The final task in any blueprint must be an estimator. During scoring, the estimator's output must always align with the target format. For example for multiclass blueprints, an estimator must return a probability of each class for each row. Examples of estimator tasks areLogisticRegression,LightGBM regressor, andCalibrate.
- Transform taskstransform the input data (x) in some way. Its output is always a dataframe, but unlike estimators, it can contain any number of columns and any data types. Examples of transforms areOne-hot encoding,Matrix n-gram, and more. Both estimator and transform tasks have afit()method that is used for training and learning data characteristics. For example, a binning task requiresfit()to define the bins based on training data, and then applies those bins to all future incoming data. While both task types use  thefit()method, estimators use ascore()hook while transform tasks use atransform()hook. See thedescriptions of these hookswhen creating custom tasks for more information. Transform and estimator tasks can each be used as intermediate steps inside a blueprint. For example,Auto-Tuned N-Gramis an estimator, providing the next task with predictions as input.

### How data passes through a blueprint

Data is passed through a blueprint sequentially, task by task, left to right. When data is passed to a transform, DataRobot:

1. Fits it on the received data.
2. Uses the trained transform to transform the same data.
3. Passes the result to the next task.

Once passed to an estimator, DataRobot:

1. Fits it on the received data.
2. Uses the trained estimator to predict on the same data.
3. Passes the predictions to the next task. To reduce overfitting, DataRobot passes stacked predictions when the estimator is not the final step in a blueprint.

When the trained blueprint is used to make predictions, data is passed through the same set of steps (with the difference that the `fit()` method is skipped).

## Access the blueprint editor

You can access the blueprint editor from Leaderboard, the Repository, and the AI Catalog.

From the Leaderboard, select a model to use as the basis for further exploration and click to expand (which opens the Describe > Blueprint tab). From the Repository, select and expand a model from the library of modeling blueprints available for a selected project. From the AI Catalog, select the Blueprints tab to list an inventory of user blueprints.

In either method, once the blueprint diagram is open, choose Copy and Edit to open the blueprint editor, which makes a copy of the blueprint.

When you then make modifications, they are made to a copy and the original is left intact (either on the Leaderboard or the Repository, depending on where you opened it from). Click and drag to move the blueprint around on the canvas.

When you have finished editing the blueprint:

- Click +Add to AI Catalog if you want to save it to the AI Catalog for further editing, use in other projects, and sharing.
- Click Train to run the blueprint and add the resulting model to the Leaderboard.

## Use the blueprint editor

A blueprint is composed of nodes and connectors:

- Anodeis the pipeline step—it takes in data, performs an operation, and outputs the data in its new form.Tasksare the elements that complete those actions. From the editor, you can add, remove, and modify tasks and task hyperparameters.
- Aconnectoris a representation of the flow of data. From the editor, you can add or remove task connectors.

### Work with nodes

The following table describes actions you can take on a node.

| Action | Description | How to |
| --- | --- | --- |
| Modify a node | Change characteristics of the task contained in the node. | Hover over a node and click the associated pencil () icon. Edit the task or parameters as needed. |
| Add a node | Add a node to the blueprint. | Hover over the node that will serve as the new node's input and click the plus sign (). This creates a new branch with an empty node. Use the accompanying Select a task window to configure the task. |
| Connect nodes | Connect tasks to direct the data flow. | Hover over the starting point node, drag the diagonal arrow () icon to the end point node, and click. |
| Remove a node | Remove a node and its associated task from the blueprint, as well as downstream nodes. | Hover over a node and click the associated trash can () icon. If you remove a node, its entire branch is removed (all downstream nodes). Click the undo () icon on the top left to restore the removed nodes. |

> [!NOTE] Note
> If an action isn't applicable to a node, the icon for the action is not available.

Click the following buttons to undo and redo edits:

|  | Action | Description |
| --- | --- | --- |
|  | Undo | Cancels the most recent action and resets the blueprint graph to its prior state. |
|  | Redo | Restores the most recent action that was undone using the Undo action. |

### Work with connectors

The following table describes actions you can take on a connector.

| Action | Description | How to |
| --- | --- | --- |
| Add a node | Add a node to the blueprint. | Hover over the connector and click the plus sign () to create an empty node. Use the accompanying Select a task window to configure the task. |
| Remove a connector | Disconnect two nodes. | Hover over a connector and click the resulting trash can () icon. If the icon does not appear, the connector cannot be deleted because its removal will make the blueprint invalid. |

> [!NOTE] Note
> If an action isn't applicable to a connector, the icon for the action is not available.

### Modify a node

Use these steps to change an existing node or to add hyperparameters to a node newly added to the blueprint.

1. On the node to be changed, hover to display the task requirements and the available actions.
2. Click the pencil icon to open the task window. DataRobot presents a list of all parameters that define the task. The following table describes the actions available from the task window: ElementClick to...1Open documentation linkOpen the model documentation to read a description of the task and its parameters.2Task selectorChoose an alternative task. Click through the options to select or search for a specific task. To learn about a task, use theOpen documentationlink.3Recommended valuesReset all parameter values to the safe defaults recommended by DataRobot.4Value entryChange a parametervalue. When you select a parameter, a dropdown displays acceptable values. Click outside the box to set the new value.

#### Use the task selector

Click the task name to expand the task finder. Either enter text into the search field or expand the task types to see options listed. If you previously created [custom tasks](https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/cml/cml-custom-tasks.html), they also are available in the list. You can also [create a task from this modal](https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/cml/cml-blueprint-edit.html#launch-custom-task-creation-workflow) before proceeding.

When you click to select a new task, the blueprint editor loads that task's parameters for editing (if desired). When you are finished, click Update. DataRobot replaces the task in the blueprint.

> [!NOTE] Tasks that generate word clouds
> If you create a blueprint that generates a word cloud in both prediction and non-prediction tasks, DataRobot uses the non-prediction vertex to generate the cloud, since that type is always populated with text inputs. For example, in the blueprint below, both the Auto-Tuned Text Model and the Elastic-Net Regressor include a word cloud. In this case, DataRobot defaults to the Auto-Tuned Text Model's non-prediction word cloud.
> 
> [https://docs.datarobot.com/en/docs/images/cml-wordcloud.png](https://docs.datarobot.com/en/docs/images/cml-wordcloud.png)

#### Launch custom task creation workflow

You can access the custom task creation workflow by clicking the add a custom task link at the top of the task selector modal. The Add Custom Task modal opens in a new browser tab, initiating the [task creation workflow](https://docs.datarobot.com/en/docs/classic-ui/modeling/special-workflows/cml/cml-quickstart.html#create-a-custom-task).

Once the environment is set and the code is uploaded, close the tab. From the Select a task modal, click Refresh to make the new task available. You can find it either by expanding the Custom dropdown or searching:

### Add a data type

You can change input data types available in a blueprint. Click on the Data node—the editor highlights the node and the included data types. Click the pencil icon to select or remove data types:

### Pass selected columns into a task

To pass a single or group of columns into a task, use the Task Multiple Column Selector. This task selects specific features in a dataset such that downstream transformations are only applied to a subset of columns. To use this task, add it directly after a data type (for example, directly after “Categorical Variables”), then use the task’s parameters to specify which features should or should not be passed to the next task.

To configure the task, use the column_names parameter to specify columns that should or should not be passed to the next task. Use the method parameter to specify whether those columns should be included or excluded from the input into the next task. Note that if you need to pass all columns of a certain type to a task, you don't need MCPICK, just connect the task to the data type node.

Click Add to see the new task referencing the chosen column(s).

Note that referencing specific columns in a blueprint requires that those columns be present to train the blueprint. DataRobot provides a warning reminder when editing or training a blueprint that the named columns may not be present in the current project.

## Blueprint validation

DataRobot validates each node based on the incoming and outgoing edges, checking to ensure that data type, sparse vs. dense data, and shape (number of columns) requirements are met. If you have made changes that cause validation warnings, those affected nodes are displayed in yellow on the blueprint:

Hover on the node to see specifics:

In addition to checking a task's input and output, DataRobot validates that a blueprint doesn't form [cycles](https://en.wikipedia.org/wiki/Directed_acyclic_graph). If a cycle is introduced, DataRobot provides a warning, indicating which nodes are causing the issue.

## Train new models

After changes have been made and saved for a blueprint, the option to [train a model](https://docs.datarobot.com/en/docs/classic-ui/modeling/build-models/build-basic/repository.html#create-a-new-model) using that blueprint becomes available. Click Train to open the window and then select a [feature list](https://docs.datarobot.com/en/docs/classic-ui/modeling/build-models/build-basic/feature-lists.html), sample size, and the number of [folds](https://docs.datarobot.com/en/docs/reference/pred-ai-ref/data-partitioning.html#k-fold-cross-validation-cv) used in cross validation. Then, click Train model.

The model becomes available to the project on the model Leaderboard. If errors were encountered during model building, DataRobot provides several indicators.

You can view the errored node from the Describe > Blueprint tab. Click on the problematic task to see the error message or validation warning.

If a custom task fails, you can find the full error traceback in the [Describe > Log](https://docs.datarobot.com/en/docs/classic-ui/modeling/analyze-models/describe/log-classic.html) tab.

> [!NOTE] Note
> You can train a model even if the blueprint has warnings. To do so, click Train with warnings.

## More info...

The following sections provide details to help ensure successful blueprint creation.

### Boosting

Boosting is a technique that can improve accuracy by training a model using predictions of another model. It uses multiple estimators together, which in turn either use data in multiple forms or help calibrate predictions.

A boosting pipeline has two key components:

- Booster task: A node that boosts the predictions (Text fit on Residuals (L2/Binomial Deviance)in the example above). The list of built-in booster tasks available can be found in the task selector underModels > Regression > Boosted Regression(or similarly under the otherModelssub-categories). For example:
- Boosting input: A node that supplies the prediction to boost (eXtreme Gradient Boosted Trees Classifier with Early stoppingin the example) and other tasks that pass extra variables of the booster (Matrix of word-grams occurrences).

It must meet the following criteria:

- There must be only one task that provides predictions to boost.
- There must be at least one task providing extra explanatory variables to the booster, other than the predictions (Matrix of word-grams occurrencesin the example).

---
