Skip to content
40 changes: 28 additions & 12 deletions models/runs/color-code-runs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ To use metric or configuration-based colors for your runs, you need to configure

### Turn on key-based colors

<Note>
Key-based colors are disabled while run grouping is active. Turn off run grouping before you continue.
</Note>

1. Navigate to your W&B project.
2. Select the **Workspace** tab from the project sidebar.
3. Click on the **Settings** icon in the top right corner.
3. Click the **Settings** icon in the top right corner.
4. From the drawer, select **Runs**.
5. In the **Run colors** section, select **Key-based colors**.
6. Configure the following options:
Expand All @@ -20,15 +24,15 @@ To use metric or configuration-based colors for your runs, you need to configure
- Set the number of buckets to a value from 2 to 8.

<Note>
When you use key-based colors, the option to [customize run colors](/models/runs/run-colors) is not available.
When you use key-based colors, the option to [customize run colors](/models/runs/run-colors) isn't available.
</Note>

The following sections describe how to set the metric and y value and as how to customize the buckets used for assigning colors to runs.
The following sections describe how to set the metric and y value and how to customize the buckets used for assigning colors to runs.

### Example: Key-based coloring with loss metric

In this example plot, runs are colored with a gradient where darker colors represent higher loss values and lighter colors represent lower loss values. The Y value is set to `latest` to use the most recent loss value for each run.
After you configure the previous settings and close the drawer, line plots in your **Workspace** tab update to use the new colors. In this example plot, **Key** is set to `loss` and **Y value** is set to `Latest`. Runs are colored with a gradient where darker colors represent higher loss values and lighter colors represent lower loss values.

<Image src="/images/app_ui/run-colors-key-based.png" alt="W&B workspace showing runs colored based on their loss values using key-based coloring." />

## Set a metric
Expand Down Expand Up @@ -91,22 +95,34 @@ Within the **Key** dropdown, `"learning_rate"`, `"batch_size"`, and `"optimizer"

You can choose from the following options:

- **Latest**: Determine color based on Y value at last logged step for each line.
- **Latest**: Color based on Y value at last logged step for each line.
- **Max**: Color based on highest Y value logged against the metric.
- **Min**: Color based on lowest Y value logged against the metric.

## Customize buckets

Buckets are ranges of values that W&B uses to categorize runs based on the metric or configuration key you select. Buckets are evenly distributed across the range of values for the specified metric or configuration key and each bucket is assigned a unique color. Runs that fall within that bucket's range are displayed in that color.
Buckets are ranges of values that W&B uses to categorize runs based on the metric or configuration key you select. Buckets are evenly distributed across the range of values for the specified metric or configuration key and each bucket is assigned a unique color. Runs that fall within that bucket's range are displayed in that color.

Consider the following:
To view or edit buckets, open the workspace settings drawer where you enabled key-based colors:

1. Navigate to your W&B project and select the **Workspace** tab.
2. Click the **Settings** icon in the top right corner.
3. In the drawer, select **Runs**, then select the **Colors** tab.
4. Set **Run colors** to **Key-based colors**. The **Color palette** setting is hidden and the **Key** dropdown appears.
5. From the **Key** dropdown, select a metric or configuration key. The controls that appear next depend on the type of key you select:
- For a **metric**, use the **Y value** dropdown to choose **Min**, **Max**, or **Latest**, set the **Number of buckets** to a value from 2 to 8, and review the **Buckets** section. Each bucket lists a value range and its color.
- For a **configuration** key, use the **Grouping** dropdown to choose **Continuous** or **Discrete**. **Continuous** groups values into numeric **Buckets**. **Discrete** groups values into **Categories** instead of buckets.

The following screenshot shows the **Runs** settings panel with buckets configured for an accuracy metric:

<Frame>
<img src="/images/track/color-coding-runs.png" alt="Color coded runs" />
<img src="/images/track/color-coding-runs.png" alt="Runs settings panel showing key-based colors with buckets configured for the accuracy metric." />
</Frame>

In this example:

- **Key** is set to `"Accuracy"` (abbreviated as `"acc"`).
- **Y value** is set to `"Max"`
- **Y value** is set to `"Max"`.

With this configuration, W&B colors each run based on their accuracy values. The colors vary from a light yellow color to a deep color. Lighter colors represent lower accuracy values, while deeper colors represent higher accuracy values.

Expand All @@ -119,8 +135,8 @@ Six buckets are defined for the metric, with each bucket representing a range of
- Bucket 5: (0.8214 - 0.8409)
- Bucket 6: (0.8409 - Max)

In the line plot below, the run with the highest accuracy (0.8232) is colored in a deep purple (Bucket 5), while the run with the lowest accuracy (0.7684) is colored in a light orange (Bucket 2). The other runs are colored based on their accuracy values, with the color gradient indicating their relative performance.
After you close the settings drawer, line plots in the workspace update to use the bucket colors. In the following line plot, the run with the highest accuracy (0.8232) is colored in a deep purple (Bucket 5), while the run with the lowest accuracy (0.7684) is colored in a light orange (Bucket 2). The other runs are colored based on their accuracy values, with the color gradient indicating their relative performance.

<Frame>
<img src="/images/track/color-code-runs-plot.png" alt="Color coded runs plot" />
<img src="/images/track/color-code-runs-plot.png" alt="Workspace line plot with runs colored by their maximum accuracy bucket." />
</Frame>
Loading