Segments

Define ML segments to focus on problematic model cohorts

Segments Overview

A segment, sometimes referred to as a cohort or slice, represents a distinct subset of model values crucial for performance analysis and troubleshooting. Model segments can be defined using various model dimensions, such as specific time periods or sets of features. Analyzing segments proves invaluable for understanding or troubleshooting specific cohorts of interest, particularly in tasks like bias detection, where overarching datasets might obscure statistical intricacies.

How to Define a Segment

Fiddler makes it easy to define custom segments using either the Fiddler UI or the Fiddler Python client. Instructions for both approaches are covered in more detail below. In either case, Fiddler Segments are constructed using the Fiddler Query Language (FQL).

You can use any of the constants, operators, and functions mentioned in the page linked above in a Segment definition.

However, every Segment definition must return a boolean row-level expression. In other words, each inference will either satisfy the segment expression and thus belong to the segment or it will not.

Examples

Let us illustrate further by providing a few examples. A segment can be defined by:

  • A condition on some column (e.g. age > 50)
  • A condition on some combination of columns (e.g. (age / max_age) < 1.0)

For details on all supported functions, see the Fiddler Query Language (FQL) page.

Adding a Segment

Note: To add a Segment using the Python client, see fdl.Segment.create()

From the model schema page within the UI, you can access Segments by clicking the Segments tab at the top of the page.

Then click Add Segment to add a new Segment.

Finally, enter the Name, Description, and Definition for your Segment and click Save.

Accessing Segments in Charts and Alerts

After your Segment is saved, it can be selected from Charts and Alerts.

Charts:

Alerts:

Modifying Segments

Since alerts can be set on Segments, making modifications to a Segment may introduce inconsistencies in alerts.

Therefore, Segments cannot be modified once they are created.

If you'd like to try out a new Segment, you can create a new one with a different Definition.

Deleting Segments

Note: To delete a Segment using the Python client, see segment.delete()

From the Segments tab, you can delete a Segment by clicking the trash icon next to the Segment of interest.