Baseline

Baseline

Baseline for drift detection and model performance monitoring.

A Baseline defines a reference point for comparing production data against expected patterns. It serves as the foundation for detecting data drift, model performance degradation, and distributional changes in ML systems.

Example

# Create a static baseline from training data
baseline = Baseline(
    name=”production_baseline_v1”,
    model_id=model.id,
    environment=EnvType.PRE_PRODUCTION,
    dataset_id=training_dataset.id,
    type_=”STATIC”
).create()

# Create a rolling 30-day baseline
rolling_baseline = Baseline(
    name=”rolling_30day”,
    model_id=model.id,
    environment=EnvType.PRODUCTION,
    type_=”ROLLING_WINDOW”,
    window_bin_size=WindowBinSize.DAY,
    offset_delta=30
).create()

# Monitor drift detection
print(f”Baseline ‘{baseline.name}’ has {baseline.row_count} records”)
print(f”Created: {baseline.created_at}”)

Baselines are immutable once created. To modify baseline parameters, create a new baseline and update your monitoring configurations.

Initialize a Baseline instance.

Creates a baseline configuration for drift detection and monitoring. The baseline serves as a reference point for comparing production data against expected patterns.

Parameters

Parameter
Type
Required
Default
Description

name

str

None

Human-readable name for the baseline. Should be descriptive and unique within the model context.

model_id

UUID | str

None

UUID of the model this baseline belongs to. Must be a valid model that exists in the Fiddler platform.

environment

None

Environment type (PRE_PRODUCTION or PRODUCTION). Determines the data environment this baseline monitors.

dataset_id

UUID | str | None

None

UUID of the reference dataset. Required for STATIC baselines, optional for time-based baselines.

start_time

int | None

None

Start timestamp for time-based baselines (Unix timestamp). Defines the beginning of the reference period.

end_time

int | None

None

End timestamp for time-based baselines (Unix timestamp). Defines the end of the reference period.

offset_delta

int | None

None

Time offset in days for rolling/previous period baselines. For ROLLING_WINDOW: size of the sliding window. For PREVIOUS_PERIOD: how far back to compare.

window_bin_size

WindowBinSize | str | None

None

Aggregation window for time-series analysis. Controls how data is grouped for comparison.

Example

After initialization, call create() to persist the baseline to the Fiddler platform. The baseline configuration cannot be modified after creation.

classmethod get(id_)

Retrieve a baseline by its unique identifier.

Fetches a baseline from the Fiddler platform using its UUID. This method returns the complete baseline configuration including metadata and statistics.

Parameters

  • id – The unique identifier (UUID) of the baseline to retrieve. Can be provided as a UUID object or string representation.

  • id_ (UUID | str)

Returns

The baseline instance with all configuration and metadata populated from the server.

Return type: Baseline

Raises

  • NotFound – If no baseline exists with the specified ID.

  • ApiError – If there’s an error communicating with the Fiddler API.

Example

This method makes an API call to fetch the latest baseline information from the server, including any updated statistics or metadata.

classmethod from_name(name, model_id)

Get the baseline instance of a model from baseline name

Parameters

Parameter
Type
Required
Default
Description

name

str

None

Baseline name

model_id

UUID | str

None

Model identifier

Returns

Baseline instance

Return type: Baseline

classmethod list(model_id, type_=None, environment=None)

Get a list of all baselines of a model.

Return type: Iterator[Baseline]

create()

Create a new baseline.

Return type: Baseline

delete()

Delete a baseline.

Return type: None

Last updated

Was this helpful?