Segments (APIs)

Overview

Segmentation enables monitoring for specific use cases as well as more granular root cause analysis when a model is not performing as expected. Add static segments to policies to target and analyze subsets of data within the full data. In order to provide deeper analysis and insight into model health and performance, the ability to create and monitor segments of feature, prediction or ground truth data supports differential analysis, lower-level analysis, and the ability to drill down into a model’s performance on specific parts of the data.

Each static segment defines a value range of one or more features. Segments may include one or more filters that define certain conditions of feature, prediction, or ground truth data to create a target subset from the full dataset. You can create a segment with multiple filters that use a combination of features, mathematical operators, values, and conjunctions to narrow the full dataset, for example state = CA, temperature > 50 F, or state = CA & age > 12 & age < 25. In a tabular dataset, this will produce a subset of the rows in the dataset.

Segments object

{
    "model_uuid": "123-abc-456",
    "name": "Name of segment",
    "description": "Segment description",
    "filters": [
        {
            "feature_name": "feature-xyz",
            "value": [
                "10",
                "5"
            ],
            "operator": "=",
            "conjunction": null,
            "grouped_filters": null
        }
    ],
    "id": 18,
    "status": "inactive",
    "created_ts": 1679338024238.15,
    "modified_ts": 1679338024238.15,
    "created_by": "user1",
    "modified_by": "user2",
    "policies": null
}
Property Type Description
model_uuid string Unique identifier for the related model.
name string Name of the segment.
description string Description of the segment, if specified.
filters array One or more filters that create the segment as a subset of the full dataset. See table, below.
id int Id that the platform assigns to this segment.
status string Current status of the segment. Either active or inactive (paused).
created_ts Timestamp (Unix time in milliseconds) Timestamp when the segment was created.
modified_ts Timestamp (Unix time in milliseconds) Timestamp when the segment was last modified.
created_by string User who created the segment.
modified_by string User who last modified the segment.
policies array Policies in which this segment is configured. Includes policy uuid, deployment and model names, model version, model stage, and policy name. Value is null if the segment is not configured in any policies.

Filters object

Example of a simple filter that includes only values greater than or equal to 50 for feature trip_distance.

"filters": [
    {
        "feature_name": "trip_distance",
        "value": 50,
        "operator": ">=",
        "conjunction": null
    }
]

Example of a complex nested filter that includes data where departure_location is Boston, NYC, or Los Angeles and the value of trip_distance is 6000 or 8000 or value of passenger_id is 1001 or 3001.

"filters": [
    {
        "feature_name": "departure_location",
      	"value": [
            "Boston",
            "NYC",
            "Los Angeles"
        ],
        "operator": "=",
        "conjunction": "and"
    },
    {
        "grouped_filters": [
            {
                "feature_name": "trip_distance",
              	"value": [
                    6000,
                    8000
                ],
                "operator": "=",
                "conjunction": "or"
            },
            {
                "feature_name": "passenger_id",
              	"value": [
                    1001,
                    3001
                ],
                "operator": "=",
                "conjunction": null
            }
        ],
        "conjunction": null
    }
]

Fields are case-insensitive for supported values.

Property Type Description
feature name string Name of a feature in the model dataset to use for filtering.
value string Value of the feature to use with the operator to create the filter.
operator string Operation to do on the feature field. Supported operators: =, >, <, <=, >=, BETWEEN, TOP, BOTTOM, DISTINCT
conjunction string Relationship to next filter (AND, OR) or null if there is no next filter. Default is null.
grouped_filters list object Contain one or more nested filters using features from the feature set, operators, feature values, and conjunctions. Use to create more complex filter.
TABLE OF CONTENTS