client.get_alert_rules

To get a list of all alert rules for project, model, and other filtering parameters

Input ParametersTypeDefaultDescription
project_idOptional [str]NoneThe unique identifier for the project.
model_idOptional [str]NoneThe unique identifier for the model.
alert_typeOptional[fiddler.AlertType]NoneAlert type. One of: AlertType.PERFORMANCE, AlertType.DATA_DRIFT, AlertType.DATA_INTEGRITY, or AlertType.SERVICE_METRICS
metricOptional[fiddler.Metric]NoneWhen 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
columnOptional[str]None [Optional] column name on which alert rule is to be created. It can take ANY to check for all columns
offsetOptional[int]NonePointer to the starting of the page index
limitOptional[int]NoneNumber of records to be retrieved per page, also referred as page_size
orderingOptional[List[str]]NoneList 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 TypeDescription
List[AlertRule]A List containing AlertRule objects returned by the query.