Skip to content

Feature Monitoring Window Configuration#

MonitoringWindowConfig #

id property #

id: int | None

Id of the window configuration.

row_percentage property writable #

row_percentage: float | None

The percentage of rows to fetch and compute the statistics on. Only used for windows of type ROLLING_TIME and ALL_TIME.

specific_value property writable #

specific_value: float | None

The specific value to use as reference. Only used for windows of type SPECIFIC_VALUE.

time_offset property #

time_offset: str | None

The time offset from the current time to the start of the time window. Only used for windows of type ROLLING_TIME.

training_dataset_version property writable #

training_dataset_version: int | None

The version of the training dataset to use as reference. Only used for windows of type TRAINING_DATASET.

window_config_type property writable #

window_config_type: WindowConfigType

Type of the window. It can be one of ALL_TIME, ROLLING_TIME, TRAINING_DATASET or SPECIFIC_VALUE.

window_length property writable #

window_length: str | None

The length of the time window. Only used for windows of type ROLLING_TIME.

__init__ #

__init__(
    id: int | None = None,
    window_config_type: str
    | WindowConfigType
    | None = WindowConfigType.SPECIFIC_VALUE,
    time_offset: str | None = None,
    window_length: str | None = None,
    training_dataset_version: int | None = None,
    specific_value: float | None = None,
    row_percentage: float | None = None,
    **kwargs,
)

Configuration to define the slice of data to compute statistics on.

Example
# Detection or reference window
## Rolling Time Window
monitoring_window_config = MonitoringWindowConfig(
    time_offset="1d", # data inserted up to 1 day ago
    window_length="1h", # data inserted until an one hour after time_offset
    row_percentage=0.2, # include only 20% of the rows when computing statistics
)

## Rolling Commit Window (not supported yet)
monitoring_window_config = MonitoringWindowConfig(
    commit_offset=10, # data inserted up to 10 commits ago
    commit_num=5, # include 5 commits after commit_offset
)

# Only available for reference window
## Specific value
monitoring_window_config = MonitoringWindowConfig(specific_value=0.5)

## Training dataset
monitoring_window_config = MonitoringWindowConfig(
    training_dataset_version=my_training_dataset.version
)
PARAMETER DESCRIPTION
id

int, optional The id of the monitoring window config.

TYPE: int | None DEFAULT: None

window_config_type

str, optional The type of the monitoring window config. One of ROLLING_TIME, TRAINING_DATASET, SPECIFIC_VALUE.

TYPE: str | WindowConfigType | None DEFAULT: WindowConfigType.SPECIFIC_VALUE

time_offset

str, optional The time offset of the monitoring window config. Only used for INSERT and SNAPSHOT window config types.

TYPE: str | None DEFAULT: None

window_length

str, optional The window length of the monitoring window config. Only used for INSERT and SNAPSHOT window config types.

TYPE: str | None DEFAULT: None

training_dataset_version

int, optional The version of the training dataset to use as reference. Only used for TRAINING_DATASET window config type.

TYPE: int | None DEFAULT: None

specific_value

float, optional The specific value to use as reference. Only used for SPECIFIC_VALUE window config type.

TYPE: float | None DEFAULT: None

row_percentage

float, optional The fraction of rows to use when computing statistics [0, 1.0]. Only used for ROLLING_TIME and ALL_TIME window config types.

TYPE: float | None DEFAULT: None

RAISES DESCRIPTION
AttributeError

If window_config_type is not one of INSERT, SNAPSHOT, BATCH, TRAINING_DATASET, SPECIFIC_VALUE.