To get a list of all alert rules for project, model, and other filtering parameters
Input Parameters | Type | Default | Description |
---|---|---|---|
project_id | Optional [str] | None | The unique identifier for the project. |
model_id | Optional [str] | None | The unique identifier for the model. |
alert_type | Optional[fiddler.AlertType] | None | Alert type. One of: AlertType.PERFORMANCE, AlertType.DATA_DRIFT, AlertType.DATA_INTEGRITY, or AlertType.SERVICE_METRICS |
metric | Optional[fiddler.Metric] | None | When alert_type is SERVICE_METRICS: Metric.TRAFFIC. When alert_type is PERFORMANCE, choose one of the following based on machine learning model. 1) For binary_classfication: One of Metric.ACCURACY, Metric.TPR, Metric.FPR, Metric.PRECISION, Metric.RECALL, Metric.F1_SCORE, Metric.ECE, Metric.AUC 2) For Regression: One of Metric.R2, Metric.MSE, Metric.MAE, Metric.MAPE, Metric.WMAPE 3) For Multi-class: Metric.ACCURACY, Metric.LOG_LOSS 4) For Ranking: Metric.MAP, Metric.MEAN_NDCG When alert_type is DRIFT: Metric.PSI or Metric.JSD When alert_type is DATA_INTEGRITY: One of Metric.RANGE_VIOLATION, Metric.MISSING_VALUE, Metric.TYPE_VIOLATION |
column | Optional[str] | None | [Optional] column name on which alert rule is to be created. It can take ANY to check for all columns |
offset | Optional[int] | None | Pointer to the starting of the page index |
limit | Optional[int] | None | Number of records to be retrieved per page, also referred as page_size |
ordering | Optional[List[str]] | None | List of Alert Rule fields to order by. Eg. [‘critical_threshold’] or [‘- critical_threshold’] for descending order. |
Info
The Fiddler client can be used to get a list of alert rules with respect to the filtering parameters.
import fiddler as fdl
alert_rules = client.get_alert_rules(
project_id = 'project-a',
model_id = 'model-a',
alert_type = fdl.AlertType.DATA_INTEGRITY,
metric = fdl.Metric.MISSING_VALUE,
column = "age",
ordering = ['critical_threshold'], #['-critical_threshold'] for descending
limit= 4, ## to set number of rules to show in one go
offset = 0, # page offset (multiple of limit)
)
Return Type | Description |
---|---|
List[AlertRule] | A List containing AlertRule objects returned by the query. |