GetAnomalyAssessmentExplanations: Retrieve anomaly assessment explanations.

View source: R/AnomalyAssessment.R

GetAnomalyAssessmentExplanationsR Documentation

Retrieve anomaly assessment explanations.


Explanations contain predictions along with shap explanations for the most anomalous records in the specified date range/for defined number of points. Two out of three parameters: startDate, endDate or pointsCount must be specified.


  startDate = NULL,
  endDate = NULL,
  pointsCount = NULL



character. The ID of the project.


character. The ID of the anomaly assessment record.


POSIXct. Optional. The start of the date range to get explanations in.


POSIXct. Optional. The end of the date range to get explanations in.


integer. Optional. The number of the rows to return.


The anomaly assessment explanations:

  • recordId. character. The ID of the record.

  • projectId. character. The project ID of the record.

  • modelId. character. The model ID of the record.

  • backtest. character. The backtest of the record.

  • source. character. The source of the record.

  • seriesId. character. the series ID of the record.

  • startDate. POSIXct. First timestamp in the response. Will be NULL if there is no data in the specified range.

  • endDate. POSIXct. Last timestamp in the response. Will be NULL if there is no data in the specified range.

  • shapBaseValue. numeric. Shap base value.

  • count. integer. The number of points in the data.

  • data. list. A list of DataPoint objects in the specified date range containing:

    • shapExplanation. NULL or an array of up to 10 ShapleyFeatureContribution objects. Only rows with the highest anomaly scores have Shapley explanations calculated.

    • timestamp POSIXct. Timestamp for the row.

    • prediction numeric. The output of the model for this row.

    Each ShapleyFeatureContribution contains:
    • featureValue. character. The feature value for this row. First 50 characters are returned.

    • strength numeric. The shap value for this feature and row.

    • feature character. The feature name.

See Also

Other Anomaly Assessment functions: DeleteAnomalyAssessmentRecord(), GetAnomalyAssessmentPredictionsPreview(), InitializeAnomalyAssessment(), ListAnomalyAssessmentRecords()


## Not run: 
projectId <- "59a5af20c80891534e3c2bde"
recordId <- "59a5af20c80891534e3c2bdb"
explanations <- GetAnomalyAssessmentExplanations(projectId, recordId, pointsCount=100,

## End(Not run)

datarobot documentation built on May 6, 2022, 5:06 p.m.