Performance drift (APIs)

Create performance policies to get updated performance metrics to see how your model is performing when compared to actual data or when compared to other models (such as those used in the same business use case). This object specifies the type of experiment and metric to use in performance comparison, and target and baseline windows for comparison.

"policy": {
    "window_parameters": {
        "target": {
            "window_type": "week",
            "process_date": null,
            "offset_type": null,
            "offset": null,
            "start_of_week": null,
            "quarter_start": null,
            "year_start": null
        },
        "baseline": {
            "window_method": "last",
            "window_type": "week",
            "last_amount": 2,
            "process_date": null,
            "offset_type": null,
            "offset": null,
            "start_of_week": null,
            "quarter_start": null,
            "year_start": null
        }
    },
    "warning_level": 1,
    "critical_level": 2, 
    "schedule": "0 8 * * *",
    "deployment_name": "deployment_xyz",
    "method": "preprocess",
    "hotspot_analysis": null,
    "metric": "balanced_accuracy",
    "ground_truth_threshold": 0.5
}

Fields are case-insensitive for supported values.

{
  "data": {
    "h-0": "Property",
    "h-1": "Type",
    "h-2": "Description",
    "0-0": "window_parameters",
    "0-1": "array",
    "0-2": "Settings for the windows of target performance results and baseline performance results. The target performance values are compared to the baseline performance values to determine drift. See table below for params.",
    "1-0": "warning_level",
    "1-1": "float",
    "1-2": "Threshold value for flagging warning events. For example, if set to .1, then a warning alert is signaled when the drift measure exceeds .1.",
    "2-0": "critical_level",
    "2-1": "float",
    "2-2": "Threshold value for flagging critical events. For example, if set to .15 then a critical alert is signaled when the drift measure exceeds .15.",
    "3-0": "schedule",
    "3-1": "cron string",
    "3-2": "Schedule for calculating drift. Defined as a cron expression with a maximum of 5 fields. If needed, see an example [cron expression generator](https://crontab.cronhub.io/). For example, to calculate drift every day at 8am:  \n`\"schedule\": \"0 8 * * *\"`.",
    "4-0": "deployment_name",
    "4-1": "string",
    "4-2": "User-defined name of the deployment.",
    "5-0": "method",
    "5-1": "string",
    "5-2": "Method for saving performance policy data. Set this value to `preprocess` (the default value). ",
    "6-0": "hotspot_analysis",
    "6-1": "array",
    "6-2": "Settings for running [hotspot analysis](api-policies.html#hotspot-analysis): method for calculating the impact (`flat` or `percent`), integer value related to that method, and features on which to run hotspot analysis.",
    "7-0": "metric",
    "7-1": "string",
    "7-2": "Performance metric (values) to use in comparison. [Supported performance metrics](https://docs.vianops.ai/2.2/metrics.html) are based on model experiment type, i.e., regression or classification. (When creating/updating a performance drift policy, make sure to specify the metric value as shown in the **API Value **column for the related metric.) ",
    "8-0": "ground_truth_threshold",
    "8-1": "number",
    "8-2": "Threshold value for ground truth, for flagging events when the ground threshold is surpassed. For example, if set to .25 then an alert is signaled when the ground truth measure exceeds .25."
  },
  "cols": 3,
  "rows": 9,
  "align": [
    "left",
    "left",
    "left"
  ]
}

window_parameters object

Configures settings for the target and baseline windows that will be used for comparing the metrics. Additional (optional) parameters are available for configuration depending on policy settings; see table (below) for additional parameters.

"window_parameters": {
  "target": {
    "window_type": "week",
    "process_date": null,
    "offset_type": null,
    "offset": null,
    "start_of_week": null,
    "quarter_start": null,
    "year_start": null
  },
  "baseline": {
    "window_method": "last",
    "window_type": "week",
    "last_amount": 2,
    "process_date": null,
    "offset_type": null,
    "offset": null,
    "start_of_week": null,
    "quarter_start": null,
    "year_start": null
  }
},
{
  "data": {
    "h-0": "Property",
    "h-1": "Type",
    "h-2": "Description",
    "0-0": "**target** ",
    "0-1": "array",
    "0-2": "Window of performance metrics that the policy analyzes and compares to baseline metrics to detect performance issues.",
    "1-0": "window_type",
    "1-1": "string",
    "1-2": "Size of the target window. Supported values: `day`, `week`, `month`, `quarter`, `year`.",
    "2-0": "start_of_week",
    "2-1": "string",
    "2-2": "Optional. Applies if `window_type` is `week`.  \n  \nSpecifies the start day for the target window other than default (Monday). Supported values: days of the week, `Monday` through `Sunday`.",
    "3-0": "quarter_start",
    "3-1": "string",
    "3-2": "Optional. Applies if `window_type` is `quarter`.  \n  \nSpecifies the start day for the target window other than default first day of current quarter (i.e., January 1st, April 1st, July 1st, or October 1st). Format as yyyy-mm-dd.",
    "4-0": "year_start",
    "4-1": "string",
    "4-2": "Optional. Applies if `window_type` is `year`.  \n  \nSpecifies the start day for the target window other than default (January 1st of the current year). Format as yyyy-mm-dd.",
    "5-0": "process_date",
    "5-1": "string",
    "5-2": "Optional. Specifies an historical end date for the target window, in conjunction with `window_type`. Format as yyyy-mm-dd.  \n  \nFor example, if set to `2022-03-10` and `window_type` is set to `week`, the policy analyzes inferences received for the week leading up to 2022-03-10. If set, the Baseline window is also reset accordingly. If not set, the default value is the date of the day the job is being run.  \n  \n**Note: **The policy uses the `process_date` instead of any configured offset offset. If you need a precise historical end date, you may want to use `process_date` rather than `offset`.",
    "6-0": "offset",
    "6-1": "string",
    "6-2": "Optional. Number for `offset_type`. For example, `2` (days, weeks, months, etc. in the past), depending on value of `offset_type`. Set `offset` to   `1` to specify today, this week, this month, etc.  \n  \n**Note: **If `process_date` is defined, the policy ignores any offset configuration.",
    "7-0": " offset_type",
    "7-1": "string",
    "7-2": "Optional. Specifies an historical timeframe for the target window data (in conjunction with the value of `offset`). Supported values: `day`, `week`, `month`, `quarter`.  \n  \nFor example, if set to `week` and `offset` is set to 3, the target window contains data up to 3 weeks ago (where amount of data is defined by `window_type`). If set, the baseline window is also reset accordingly.  \n  \n**Note: **If `process_date` is defined, the policy ignores any offset configuration.",
    "8-0": "**baseline**",
    "8-1": "array",
    "8-2": "Window of performance metrics that the policy uses to compare to metrics in the target window.",
    "9-0": "window_type",
    "9-1": "string",
    "9-2": "Optional. Size of the baseline window, or specifies to use training data as baseline. Supported values: `day`, `week`, `month`, `quarter`, `year`, `training`.  If not set, inherits the value of `window_type` set for the target window.  \n  \nRecommended to use the same value set for target window.",
    "10-0": "window_method",
    "10-1": "string",
    "10-2": "Defines the baseline window of data to compare to the target window.  \n  \n**IMPORTANT**: Make sure to specify a baseline window that makes sense for the specified target window and that is EARLIER than the target window. Supported value depends on `window_type` setting.  \n  \nSupported values: `prior` (i.e., prior day, week, or month), `last` (i.e., last same weekdays, last number of weeks, last of months), `same_prior_year` (i.e., same quarter prior year),  `training` (to use training data for baseline).",
    "11-0": "last_amount",
    "11-1": "integer",
    "11-2": "Optional. Specifies the number of previous time periods to use as a dataset. Used when `window_method` is set to `last` (indicating last weekday, week, or month).  \n  \nFor example, if `window_type` is set to `day` and `last_amount` is set to 4, then the baseline windows contains all data for the last 4 days."
  },
  "cols": 3,
  "rows": 12,
  "align": [
    "left",
    "left",
    "left"
  ]
}
TABLE OF CONTENTS