# Hyperparameter Tuning
URL: https://docs.datarobot.com/en/docs/workbench/nxt-workbench/experiments/experiment-insights/hyperparam-tuning.html

> Manually set model hyperparameters, overriding the DataRobot selections for a model, and create a named “tune.” In some cases, by experimenting with hyperparameter settings you can improve model performance.

# Hyperparameter Tuning

| Tab | Description |
| --- | --- |
| Details | Allows manually setting of model hyperparameters, overriding the DataRobot selections for a model. In some cases, by experimenting with hyperparameter settings, you can improve model performance. |

Hyperparameter Tuning allows you to manually set model hyperparameters, overriding the DataRobot selections for a model, and create a new Leaderboard model using the new settings. In some cases, experimenting with hyperparameter settings can improve model performance. When you create models via this insight, the newly created Leaderboard models can later be blended together or further tuned.

When you provide new exploratory values, save, and build using new hyperparameter values, DataRobot creates a new child model using the best of each parameter value and adds it to the Leaderboard.

You can further tune that model and create a child of the child. In other words, you do not iterate and continue to tune a single child model, instead you modify the child and create another new model, providing a lineage of changes. You can also create a new child from the original parent.

|  | Element | Description |
| --- | --- | --- |
| (1) | Search | Filters the display to include only those hyperparameters matching the search strings. If a task has no matching hyperparameters, it does not display. |
| (2) | Task name | Provides the pre- or post-processing steps (tasks) that make up the model, with a link to the DataRobot model documentation, which describes the task in detail. Under each task are listed: Parameter: The individual hyperparameters, which are tunable, that make up that task. Current value: The single best value of all searched values for preprocessing or final prediction model hyperparameters. This is the value that was used to build the model. On the editing page, this value is displayed in the Parent column, because tuning results in a new model.Searched values: All values DataRobot searched before selecting the best value. |
| (3) | Tune parameters | Opens the editing window, allowing you to modify hyperparameter values. |

## Create a tuned model

Customize hyperparameter settings, testing individual values or ranges, to create new Leaderboard models. You can set new values for preprocessing tasks, with availability dependent on the model and project type. To create a new model—a version (child) of the parent but with hyperparameter modifications—do the following:

1. ClickTune parametersto open the hyperparameter tuning editor.
2. Select the hyperparameter to tune, either by scrolling though the list or filtering by search string. Click on the name.
3. Edit the value; save changes for each modification.
4. Select a search method
5. ClickTrain new model. Once clicked, DataRobot begins training one or more new models. Expand the right panel to follow progress.
6. On the Leaderboard, find the new child by searching for theTunedbadgeand comparing the model IDs. The model card also includes a summary of changes.
7. Open the new model, return toDetails > Hyperparameter tuningandevaluate the new child compared model.

### Edit hyperparameter values

To edit a hyperparameter value, first click Tune parameters and then click a selection to open. You can modify up to 12 hyperparameters per model.

There are a variety of accepted value types and ranges; each hyperparameter includes instruction and reports the parent value.

**Categorical:**
[https://docs.datarobot.com/en/docs/images/hyp-tune-5.png](https://docs.datarobot.com/en/docs/images/hyp-tune-5.png)

**Single value:**
[https://docs.datarobot.com/en/docs/images/hyp-tune-6.png](https://docs.datarobot.com/en/docs/images/hyp-tune-6.png)

**Multiple values:**
[https://docs.datarobot.com/en/docs/images/hyp-tune-7.png](https://docs.datarobot.com/en/docs/images/hyp-tune-7.png)


Many values provide the option to select `User-defined`. When selected, the entry expands to include a field for entering the desired value. Validation checks the entry, indicating the issue and turning from red to white when the entry passes.

Click Save changes after each modification; hyperparameters are marked with an Edited badge and the entry is added to the edited parameters list in the right panel. Before training a new tuned model, you must modify at least one parameter.

### Select a search method

Set the search type to configure the level of search detail, which in turn affects resource usage.

| Search type | Description |
| --- | --- |
| Bayesian search | Provides a balanced search by using Bayesian optimization to intelligently balance exploration with time spent tuning. That is, it uses previous results to direct next search actions. When selecting Bayesian, also set the max iterations, max time (in hours), and random seed. |
| Smart search | Performs a sophisticated pattern search (optimization) that emphasizes areas where the model is likely to do well and, for faster results, skips hyperparameter points that are less relevant to the model. DataRobot explores parameter values by starting with initial grid points and then iteratively finding the best-performing points. Results are returned when all promising regions are explored or maximum iterations are reached. |
| Brute force | Evaluates each data point and all possible parameter value combinations for maximized accuracy, likely increasing time and resource use. |

Once a method is selected, optionally enter a tune description. The panel also provides a summary of all hyperparameters modified, reporting an error if too many have been tuned.

## Evaluate child models

Once a child model is trained, it is listed on the Leaderboard with the [Tuned](https://docs.datarobot.com/en/docs/reference/pred-ai-ref/leaderboard-ref.html#tags-and-indicators) badge and a summary of modifications. Open the model and navigate to the same insight— Details > Hyperparameter Tuning —to see changes. From there, you can:

|  | Element | Description |
| --- | --- | --- |
| (1) | Parameters table/Grid search | Compare and evaluate changes—use Parameters table for list view or Grid search for a graphical format. |
| (2) | Search parameters | When in table view, use Show only tuned parameters to see only those you have changed. If you choose to re-tune the model, all parameters are displayed. |
| (3) | Tune parameters | Re-tune the model based on the settings of this child model. |
| (3) | Open parent model | Click to change the view to the parent model. If you are making modifications to a child model, the listed parent model is the original parent, not the child that the "child of the child" was trained from. |

### Parameters table

The table view lists all tunable hyperparameters of the model, in the same breakdown as the when tuning was available for the parent model. In this view, however, in addition to the current and searched values, DataRobot displays the value used by the original parent.

From here, you can create an iteration of the child by clicking Tune parameters or return to the parent ( Open parent model) to create a "second generation" model

### Grid search

The grid search visualization, available on models for which DataRobot ran a grid search, plots parameters against score for child models. It visualizes patterns across numeric parameter-to-score relationships, helping to identify which parameter combinations lead to the best model performance. The number and detail of the graphs vary based on model type. Not all model types or hyperparameters generate grid search graphs since not all use a grid search to find the best value.

DataRobot graphs those parameters that take a numeric or decimal value and displays them against a score. In the example above, the top three graphs each plot one of the parameters used to build the current model. The points on the graph indicate each value DataRobot tried for that parameter. The starred dot is the value selected, and dots are represented in a worst-to-best color scheme.

The additional rows of graphs provide parameter-to-parameter information that illustrates an analysis of co-occurrence—plotting the parameter values against each other. The graphs can be helpful in experimenting with parameter selection because they provide a visual indicator of the values that DataRobot tried. So, for example, to try something completely different, you can look for empty regions in the graph and set parameter values to match an area in the empty region. Or, if you want to try tweaking something that you know did well, you can identify values in the region near to the star that represents the best value.

---
