monitor_schema.models.analyzer.baseline#

Define various baselines.

Attributes#

Classes#

NoExtrasBaseModel

No extras base model.

TimeRange

Support for a specific time range.

BaselineType

Supported baseline types.

_Baseline

Base class for a baseline.

_SegmentBaseline

Base class for a baseline.

ReferenceProfileId

A baseline based on a static reference profile.

TrailingWindowBaseline

A dynamic trailing window.

TimeRangeBaseline

A static time range.

SingleBatchBaseline

Using current batch.

Module Contents#

monitor_schema.models.analyzer.baseline.DATASET_ID_DEF#
class monitor_schema.models.analyzer.baseline.NoExtrasBaseModel[source]#

Bases: pydantic.BaseModel

No extras base model.

Inherit to prevent accidental extra fields.

class monitor_schema.models.analyzer.baseline.TimeRange[source]#

Bases: NoExtrasBaseModel

Support for a specific time range.

start: datetime.datetime#
end: datetime.datetime#
class monitor_schema.models.analyzer.baseline.BaselineType[source]#

Bases: str, enum.Enum

Supported baseline types.

BatchTimestamp = 'BatchTimestamp'#
Reference = 'Reference'#
TrailingWindow = 'TrailingWindow'#
TimeRange = 'TimeRange'#
CurrentBatch = 'CurrentBatch'#
class monitor_schema.models.analyzer.baseline._Baseline[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Base class for a baseline.

datasetId: str | None#
class monitor_schema.models.analyzer.baseline._SegmentBaseline[source]#

Bases: _Baseline

Base class for a baseline.

inheritSegment: bool | None#
class monitor_schema.models.analyzer.baseline.ReferenceProfileId[source]#

Bases: _Baseline

A baseline based on a static reference profile.

A typical use case is to use a “gold” dataset and upload its profile to WhyLabs. This can be a training dataset as well for an ML model.

type: Literal[BaselineType]#
profileId: str#
class monitor_schema.models.analyzer.baseline.TrailingWindowBaseline[source]#

Bases: _SegmentBaseline

A dynamic trailing window.

This is useful if you don’t have a static baseline to monitor against. This is the default mode for most monitors.

type: Literal[BaselineType]#
size: int#
offset: int | None#
exclusionRanges: List[monitor_schema.models.commons.TimeRange] | None#
class monitor_schema.models.analyzer.baseline.TimeRangeBaseline[source]#

Bases: _SegmentBaseline

A static time range.

Instead of using a single profile or a trailing window, user can lock in a “good” period.

type: Literal[BaselineType]#
range: monitor_schema.models.commons.TimeRange#
class monitor_schema.models.analyzer.baseline.SingleBatchBaseline[source]#

Bases: _SegmentBaseline

Using current batch.

This is used when you want to use one batch to monitor another batch in a different metric entity.

type: Literal[BaselineType]#
offset: int | None#
datasetId: str#