DeepchecksClient.add_alert_rule#
- DeepchecksClient.add_alert_rule(model_name: str, check_name: str, threshold: float, frequency: int, alert_severity: str = 'medium', aggregation_window: Optional[int] = None, greater_than: bool = True, kwargs_for_check: Optional[Dict[str, Any]] = None, monitor_name: Optional[str] = None, add_monitor_to_dashboard: bool = False) int #
Create a new alert rule for provided model based on selected check.
The alert will run the selected check on data in defined time intervals and verify if the check return value meets the defined condition.
- Parameters
- model_name: str
name of the model to which the alert rule will be added
- check_name: str
The check to monitor. The alert will monitor the value produced by the check’s reduce function.
- threshold: float
The value to compare the check value to.
- frequency: int, default: None
Control the frequency the alert will be calculated, provided in seconds.
- aggregation_window: int
The aggregation window of each calculation of the alert. If None, the aggregation window will be the same as the frequency. TODO: better explanation
- alert_severity: str, default: “medium”
The severity level associated with the alert. Possible values are: critical, high, medium and low.
- greater_than: bool, default: True
Whether the alert condition requires the check value to be larger or smaller than provided threshold.
- kwargs_for_check: t.Dict, default = None
Additional kwargs to pass on to check.
- monitor_name: str, default: None
Name for the created monitor.
- add_monitor_to_dashboard: bool, default: False
Whether to add a corresponding monitor to the dashboard screen.
- Returns
- int
created alert rule id