Skip to content

The Functions of the TIM SSE

The TIM SSE supports various functions, which can be called from within native Qlik charts. Below, you can find an overview of the functions that are currently supported.

Forecasting

Making a forecast

The forecasting function follows the pattern below:

F_Forecast(<timestamp> & '|' & <target> & '|' & <any predictors to be included>, <start date of forecast>, <forecast length>, <model activation>, <list of included variables and (optionally) their availability>).

  • <timestamp> refers to the variable containing the timestamps of the observations. They should follow the YYYY-MM-DD hh:mm:ss pattern.
  • <target> refers to the target variable.
  • <any predictors to be included> refers to any other variables that you want to include for forecasting. If you want to include more than one, they should be separated with & '|' &; if you want to include none, this parameter and the preceding & '|' & can be left out.
  • <start date of forecast> refers to the timestamp of the first observation to be forecasted.
  • <forecast length> refers to the length of the forecast (i.e. the amount of samples to forecast).
  • <model activation> passes along whether or not a new forecasting model should be built upon changing any of the function's parameters.
  • <list of included variables and (optionally) their availability> refers to the names and optionally the availabilities of all included variables, including the timestamp and the target variable. The availabilities should be relative to the last timestamp before the forecasting horizon. The availabilities are optional; by default all variables are available until the end of the target variable, i.e. the last timestamp before the start of the forecasting horizon. The variables should be separated by commas, the variables names should be separated from the corresponding availability by a space.

Retrieving predictor importances

The function to retrieve the predictor importances follows the pattern below:

F_PredictorImportances(<timestamp> & '|' & <target> & '|' & <any predictors to be included>, <start date of forecast>, <forecast length>, <model activation>, <list of included variables and (optionally) their availability>, <desired return value>)

  • <timestamp> refers to the variable containing the timestamps of the observations. They should follow the YYYY-MM-DD hh:mm:ss pattern.
  • <target> refers to the target variable.
  • <any predictors to be included> refers to any other variables that you want to include for forecasting. If you want to include more than one, they should be separated with & '|' &; if you want to include none, this parameter and the preceding & '|' & can be left out.
  • <start date of forecast> refers to the timestamp of the first observation to be forecasted.
  • <forecast length> refers to the length of the forecast (i.e. the amount of samples to forecast).
  • <model activation> passes along whether or not a new forecasting model should be built upon changing any of the function's parameters.
  • <list of included variables and (optionally) their availability> refers to the names and optionally the availabilities of all included variables, including the timestamp and the target variable. The availabilities should be relative to the last timestamp before the forecasting horizon. The availabilities are optional; by default all variables are available until the end of the target variable, i.e. the last timestamp before the start of the forecasting horizon. The variables should be separated by commas, the variables names should be separated from the corresponding availability by a space.
    • '<desired return value>' expects a string indicating what you want returned from this function call. The options are 'predictor_name' and 'importance'.

Retrieving feature importances

The function to retrieve the feature importances follows the pattern below:

F_FeatureImportances(<timestamp> & '|' & <target> & '|' & <any predictors to be included>, <start date of forecast>, <forecast length>, <model activation>, <list of included variables and (optionally) their availability>, <desired return value>)

  • <timestamp> refers to the variable containing the timestamps of the observations. They should follow the YYYY-MM-DD hh:mm:ss pattern.
  • <target> refers to the target variable.
  • <any predictors to be included> refers to any other variables that you want to include for forecasting. If you want to include more than one, they should be separated with & '|' &; if you want to include none, this parameter and the preceding & '|' & can be left out.
  • <start date of forecast> refers to the timestamp of the first observation to be forecasted.
  • <forecast length> refers to the length of the forecast (i.e. the amount of samples to forecast).
  • <model activation> passes along whether or not a new forecasting model should be built upon changing any of the function's parameters.
  • <list of included variables and (optionally) their availability> refers to the names and optionally the availabilities of all included variables, including the timestamp and the target variable. The availabilities should be relative to the last timestamp before the forecasting horizon. The availabilities are optional; by default all variables are available until the end of the target variable, i.e. the last timestamp before the start of the forecasting horizon. The variables should be separated by commas, the variables names should be separated from the corresponding availability by a space.
  • '<desired return value>' expects a string indicating what you want returned from this function call. The options are 'time', 'term_name', 'type' and 'importance'.

Anomaly detection

Performing in-sample anomaly detection

The function to build an anomaly detection model and perform in-sample anomaly detection follows the pattern below:

AD_Detect(<timestamp> & '|' & <target> & '|' & <any predictors to be included>, <start timestamp of in-sample period>, <end timestamp of in-sample period>, <model activation>, <list of included variables and (optionally) their availability>, <desired return value>, <key>, sensitivity>, <anomaly detection features>)

  • <timestamp> refers to the variable containing the timestamps of the observations. They should follow the YYYY-MM-DD hh:mm:ss pattern.
  • <target> refers to the target variable.
  • <any predictors to be included> refers to any other variables that you want to include for anomaly detection. If you want to include more than one, they should be separated with & '|' &; if you want to include none, this parameter and the preceding & '|' & can be left out.
  • <start timestamp of in-sample period> refers to the timestamp of the first observation of the sample to train and detect on.
  • <end timestamp of in-sample period> refers to the timestamp of the last observation of the sample to train and detect on.
  • <model activation> passes along whether or not a new anomaly detection model should be built upon changing any of the function's parameters.
  • <list of included variables and (optionally) their availability> refers to the names and optionally the availabilities of all included variables, including the timestamp and the target variable. The availabilities should be relative to the last timestamp of the in-sample period. In anomaly detection, the availabilities are either negative or zero. The availabilities are optional; by default all variables are available until the end of the target variable, i.e. the last timestamp of the in-sample period. The variables should be separated by commas, the variables names should be separated from the corresponding availability by a space.
  • <desired return value> expects a string indicating what you want returned from this function call. The options are 'normal_behavior', 'anomalies', 'residuals' and 'anomaly_indicator'.
  • <key> refers to an identifying key for the model that will be built. This key serves as the link between the model that is built following this request and any out-of-sample detection that should be done with the same model. This is an optional parameter; if you do not wish to use the model for out-of-sample detection, an empty string can be passed.
  • <sensitivity> refers to the desired sensitivity of the anomaly detection model. This is an optional parameter; if it is left empty, automatic sensitivity estimation is applied.
  • <anomaly detection features> refers to the anomaly detection features to be included in the model configuration. This is an optional parameter; if an empty string is passed, the default configuration ('Residuals, Imbalance') is used. The options are 'Residual', 'ResidualChange', 'Fluctuation', 'FluctuationChange', Imbalance, 'ImbalanceChange', or an arbitrary combination of them, separated by commas.

Detection out-of-sample anomalies

The function to perform out-of-sample anomaly detection follows the pattern below:

AD_DetectOutSample(<timestamp> & '|' & <target> & '|' & <any predictors to be included>, <start timestamp of out-of-sample period>, <end timestamp of out-of-sample period>, <model activation>, <list of included variables and (optionally) their availability>, <desired return value>, <key>)

  • <timestamp> refers to the variable containing the timestamps of the observations. They should follow the YYYY-MM-DD hh:mm:ss pattern.
  • <target> refers to the target variable.
  • <any predictors to be included> refers to any other variables that you want to include for anomaly detection. If you want to include more than one, they should be separated with & '|' &; if you want to include none, this parameter and the preceding & '|' & can be left out.
  • <start timestamp of out-of-sample period> refers to the timestamp of the first observation of the sample to detect on.
  • <end timestamp of out-of-sample period> refers to the timestamp of the last observation of the sample to detect on.
  • <model activation> passes along whether or not a new anomaly detection model should be built upon changing any of the function's parameters.
  • <list of included variables and (optionally) their availability> refers to the names and optionally the availabilities of all included variables, including the timestamp and the target variable. The availabilities should be relative to the last timestamp of the in-sample period. In anomaly detection, the availabilities are either negative or zero. The availabilities are optional; by default all variables are available until the end of the target variable, i.e. the last timestamp of the in-sample period. The variables should be separated by commas, the variables names should be separated from the corresponding availability by a space.
  • <desired return value> expects a string indicating what you want returned from this function call. The options are 'normal_behavior', 'anomalies', 'residuals' and 'anomaly_indicator'.
  • <key> refers to an identifying key for the model that should be applied. This key serves as the link between the model that is built following the in-sample request and the out-of-sample detection(s) that should be done with it.

Retrieving predictor importances

The function to retrieve the predictor importances follows the pattern bellow:

AD_PredictorImportances(<timestamp> & '|' & <target> & '|' & <any predictors to be included>, <start timestamp of in-sample period>, <end timestamp of in-sample period>, <model activation>, <list of included variables and (optionally) their availability>, <desired return value>, <key>, <sensitivity>, <anomaly detection features>)

  • <timestamp> refers to the variable containing the timestamps of the observations. They should follow the YYYY-MM-DD hh:mm:ss pattern.
  • <target> refers to the target variable.
  • <any predictors to be included> refers to any other variables that you want to include for anomaly detection. If you want to include more than one, they should be separated with & '|' &; if you want to include none, this parameter and the preceding & '|' & can be left out.
  • <start timestamp of in-sample period> refers to the timestamp of the first observation of the sample to train and detect on.
  • <end timestamp of in-sample period> refers to the timestamp of the last observation of the sample to train and detect on.
  • <model activation> passes along whether or not a new anomaly detection model should be built upon changing any of the function's parameters.
  • <list of included variables and (optionally) their availability> refers to the names and optionally the availabilities of all included variables, including the timestamp and the target variable. The availabilities should be relative to the last timestamp of the in-sample period. In anomaly detection, the availabilities are either negative or zero. The availabilities are optional; by default all variables are available until the end of the target variable, i.e. the last timestamp of the in-sample period. The variables should be separated by commas, the variables names should be separated from the corresponding availability by a space.
  • '<desired return value>' expects a string indicating what you want returned from this function call. The options are 'predictor_name' and 'importance'.
  • <key> refers to an identifying key for the model that will be built. This key serves as the link between the model that is built following this request and any out-of-sample detection (such as the one linked to this request) that should be done with the same model. This is an optional parameter; if you do not wish to use the model for out-of-sample detection, an empty string can be passed.
  • <sensitivity> refers to the desired sensitivity of the anomaly detection model. This is an optional parameter; if it is left empty, automatic sensitivity estimation is applied.
  • <anomaly detection features> refers to the anomaly detection features to be included in the model configuration. This is an optional parameter; if an empty string is passed, the default configuration ('Residuals, Imbalance') is used. The options are 'Residual', 'ResidualChange', 'Fluctuation', 'FluctuationChange', Imbalance, 'ImbalanceChange', or an arbitrary combination of them, separated by commas.

Retrieving feature importances

The function to retrieve the feature importances follows the pattern below:

AD_FeatureImportances(<timestamp> & '|' & <target> & '|' & <any predictors to be included>, <start timestamp of in-sample period>, <end timestamp of in-sample period>, <model activation>, <list of included variables and (optionally) their availability>, <desired return value>, <key>, <sensitivity>, <anomaly detection features>)

  • <timestamp> refers to the variable containing the timestamps of the observations. They should follow the YYYY-MM-DD hh:mm:ss pattern.
  • <target> refers to the target variable.
  • <any predictors to be included> refers to any other variables that you want to include for anomaly detection. If you want to include more than one, they should be separated with & '|' &; if you want to include none, this parameter and the preceding & '|' & can be left out.
  • <start timestamp of in-sample period> refers to the timestamp of the first observation of the sample to train and detect on.
  • <end timestamp of in-sample period> refers to the timestamp of the last observation of the sample to train and detect on.
  • <model activation> passes along whether or not a new anomaly detection model should be built upon changing any of the function's parameters.
  • <list of included variables and (optionally) their availability> refers to the names and optionally the availabilities of all included variables, including the timestamp and the target variable. The availabilities should be relative to the last timestamp of the in-sample period. In anomaly detection, the availabilities are either negative or zero. The availabilities are optional; by default all variables are available until the end of the target variable, i.e. the last timestamp of the in-sample period. The variables should be separated by commas, the variables names should be separated from the corresponding availability by a space.
  • '<desired return value>' expects a string indicating what you want returned from this function call. The options are 'time', 'term_name', 'type' and 'importance'.
  • <key> refers to an identifying key for the model that will be built. This key serves as the link between the model that is built following this request and any out-of-sample detection that should be done with the same model. This is an optional parameter; if you do not wish to use the model for out-of-sample detection, an empty string can be passed.
  • <sensitivity> refers to the desired sensitivity of the anomaly detection model. This is an optional parameter; if it is left empty, automatic sensitivity estimation is applied.
  • <anomaly detection features> refers to the anomaly detection features to be included in the model configuration. This is an optional parameter; if an empty string is passed, the default configuration ('Residuals, Imbalance') is used. The options are 'Residual', 'ResidualChange', 'Fluctuation', 'FluctuationChange', Imbalance, 'ImbalanceChange', or an arbitrary combination of them, separated by commas.