client.get_alert_rules

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

Input ParametersTypeDefaultDescription
project_idOptional [str]NoneA unique identifier for the project.
model_idOptional [str]NoneA unique identifier for the model.
alert_typeOptional[fdl.AlertType]NoneAlert type. One of: AlertType.PERFORMANCE, AlertType.DATA_DRIFT, AlertType.DATA_INTEGRITY, or AlertType.SERVICE_METRICS
metricOptional[fdl.Metric]NoneWhen alert_type is SERVICE_METRICS: Metric.TRAFFIC.

When alert_type is PERFORMANCE, choose one of the following based on the 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
columnsOptional[List[str]]None [Optional] List of column names on which alert rule was created. Please note, Alert Rule matching any columns from this list will be returned.
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,
    columns = ["age", "gender"], 
    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.