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 | A unique identifier for the project. |
model_id | Optional [str] | None | A unique identifier for the model. |
alert_type | Optional[fdl.AlertType] | None | Alert type. One of: AlertType.PERFORMANCE , AlertType.DATA_DRIFT , AlertType.DATA_INTEGRITY , or AlertType.SERVICE_METRICS |
metric | Optional[fdl.Metric] | None | When 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 |
columns | Optional[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. |
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,
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 Type | Description |
---|---|
List[AlertRule] | A List containing AlertRule objects returned by the query. |