# Insights

> Insights - Class for ROC Curve calculations. Use the standard methods of BaseInsight to compute and
> retrieve: compute, create, list, get.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-07-27T18:44:30.549130+00:00` (UTC).

## Primary page

- [Insights](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [Model Performance Insights](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#model-performance-insights): In-page section heading.
- [RocCurve](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve): In-page section heading.
- [kolmogorov_smirnov_metric](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.kolmogorov_smirnov_metric): In-page section heading.
- [auc](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.auc): In-page section heading.
- [positive_class_predictions](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.positive_class_predictions): In-page section heading.
- [negative_class_predictions](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.negative_class_predictions): In-page section heading.
- [roc_points](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.roc_points): In-page section heading.
- [compute()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.compute): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.create): In-page section heading.
- [from_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.from_data): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.from_server_data): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.get): In-page section heading.
- [get_uri()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.get_uri): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.list): In-page section heading.
- [open_in_browser()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.open_in_browser): In-page section heading.
- [sort()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve.sort): In-page section heading.
- [LiftChart](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart): In-page section heading.
- [bins](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.bins): In-page section heading.
- [compute()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.compute): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.create): In-page section heading.
- [from_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.from_data): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.from_server_data): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.get): In-page section heading.
- [get_uri()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.get_uri): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.list): In-page section heading.
- [open_in_browser()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.open_in_browser): In-page section heading.
- [sort()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart.sort): In-page section heading.
- [Residuals](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals): In-page section heading.
- [histogram](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.histogram): In-page section heading.
- [coefficient_of_determination](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.coefficient_of_determination): In-page section heading.
- [residual_mean](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.residual_mean): In-page section heading.
- [standard_deviation](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.standard_deviation): In-page section heading.
- [chart_data](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.chart_data): In-page section heading.
- [compute()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.compute): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.create): In-page section heading.
- [from_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.from_data): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.from_server_data): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.get): In-page section heading.
- [get_uri()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.get_uri): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.list): In-page section heading.
- [open_in_browser()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.open_in_browser): In-page section heading.
- [sort()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.Residuals.sort): In-page section heading.
- [SHAP Insights](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#shap-insights): In-page section heading.
- [ShapMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix): In-page section heading.
- [matrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.matrix): In-page section heading.
- [base_value](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.base_value): In-page section heading.
- [columns](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.columns): In-page section heading.
- [link_function](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.link_function): In-page section heading.
- [compute()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.compute): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.create): In-page section heading.
- [from_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.from_data): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.from_server_data): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.get): In-page section heading.
- [get_as_csv()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.get_as_csv): In-page section heading.
- [get_as_dataframe()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.get_as_dataframe): In-page section heading.
- [get_uri()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.get_uri): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.list): In-page section heading.
- [open_in_browser()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.open_in_browser): In-page section heading.
- [sort()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapMatrix.sort): In-page section heading.
- [ShapPreview](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview): In-page section heading.
- [previews](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.previews): In-page section heading.
- [previews_count](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.previews_count): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.get): In-page section heading.
- [compute()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.compute): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.create): In-page section heading.
- [from_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.from_data): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.from_server_data): In-page section heading.
- [get_uri()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.get_uri): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.list): In-page section heading.
- [open_in_browser()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.open_in_browser): In-page section heading.
- [sort()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapPreview.sort): In-page section heading.
- [ShapImpact](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact): In-page section heading.
- [compute()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.compute): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.create): In-page section heading.
- [sort()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.sort): In-page section heading.
- [shap_impacts](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.shap_impacts): In-page section heading.
- [base_value](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.base_value): In-page section heading.
- [capping](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.capping): In-page section heading.
- [link](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.link): In-page section heading.
- [row_count](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.row_count): In-page section heading.
- [from_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.from_data): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.from_server_data): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.get): In-page section heading.
- [get_uri()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.get_uri): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.list): In-page section heading.
- [open_in_browser()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapImpact.open_in_browser): In-page section heading.
- [ShapDistributions](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions): In-page section heading.
- [features](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.features): In-page section heading.
- [total_features_count](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.total_features_count): In-page section heading.
- [compute()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.compute): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.create): In-page section heading.
- [from_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.from_data): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.from_server_data): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.get): In-page section heading.
- [get_uri()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.get_uri): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.list): In-page section heading.
- [open_in_browser()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.open_in_browser): In-page section heading.
- [sort()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.ShapDistributions.sort): In-page section heading.
- [Types](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#types): In-page section heading.
- [RocCurveEstimatedMetric](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RocCurveEstimatedMetric): In-page section heading.
- [AnomalyAssessmentRecordMetadata](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.AnomalyAssessmentRecordMetadata): In-page section heading.
- [AnomalyAssessmentPreviewBin](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.AnomalyAssessmentPreviewBin): In-page section heading.
- [ShapleyFeatureContribution](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ShapleyFeatureContribution): In-page section heading.
- [AnomalyAssessmentDataPoint](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.AnomalyAssessmentDataPoint): In-page section heading.
- [RegionExplanationsData](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RegionExplanationsData): In-page section heading.
- [Anomaly assessment](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#anomaly-assessment): In-page section heading.
- [AnomalyAssessmentRecord](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord.list): In-page section heading.
- [compute()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord.compute): In-page section heading.
- [delete()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord.delete): In-page section heading.
- [get_predictions_preview()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord.get_predictions_preview): In-page section heading.
- [get_latest_explanations()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord.get_latest_explanations): In-page section heading.
- [get_explanations()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord.get_explanations): In-page section heading.
- [get_explanations_data_in_regions()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord.get_explanations_data_in_regions): In-page section heading.
- [AnomalyAssessmentExplanations](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentExplanations): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentExplanations.get): In-page section heading.
- [AnomalyAssessmentPredictionsPreview](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentPredictionsPreview): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentPredictionsPreview.get): In-page section heading.
- [find_anomalous_regions()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentPredictionsPreview.find_anomalous_regions): In-page section heading.
- [Confusion chart](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#confusion-chart): In-page section heading.
- [ConfusionChart](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.confusion_chart.ConfusionChart): In-page section heading.
- [Lift chart (legacy)](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#lift-chart-legacy): In-page section heading.
- [NOTE](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#note): In-page section heading.
- [LiftChart](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.lift_chart.LiftChart): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.lift_chart.LiftChart.from_server_data): In-page section heading.
- [Data slices](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#data-slices): In-page section heading.
- [DataSlice](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSlice): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSlice.list): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSlice.create): In-page section heading.
- [delete()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSlice.delete): In-page section heading.
- [request_size()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSlice.request_size): In-page section heading.
- [get_size_info()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSlice.get_size_info): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSlice.get): In-page section heading.
- [DataSliceSizeInfo](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSliceSizeInfo): In-page section heading.
- [Datetime trend plots](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datetime-trend-plots): In-page section heading.
- [AccuracyOverTimePlotsMetadata](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.datetime_trend_plots.AccuracyOverTimePlotsMetadata): In-page section heading.
- [AccuracyOverTimePlot](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.datetime_trend_plots.AccuracyOverTimePlot): In-page section heading.
- [AccuracyOverTimePlotPreview](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.datetime_trend_plots.AccuracyOverTimePlotPreview): In-page section heading.
- [ForecastVsActualPlotsMetadata](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.datetime_trend_plots.ForecastVsActualPlotsMetadata): In-page section heading.
- [ForecastVsActualPlot](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.datetime_trend_plots.ForecastVsActualPlot): In-page section heading.
- [ForecastVsActualPlotPreview](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.datetime_trend_plots.ForecastVsActualPlotPreview): In-page section heading.
- [AnomalyOverTimePlotsMetadata](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.datetime_trend_plots.AnomalyOverTimePlotsMetadata): In-page section heading.
- [AnomalyOverTimePlot](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.datetime_trend_plots.AnomalyOverTimePlot): In-page section heading.
- [AnomalyOverTimePlotPreview](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.datetime_trend_plots.AnomalyOverTimePlotPreview): In-page section heading.
- [External scores and insights](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#external-scores-and-insights): In-page section heading.
- [ExternalScores](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalScores): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalScores.create): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalScores.list): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalScores.get): In-page section heading.
- [ExternalLiftChart](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalLiftChart): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalLiftChart.list): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalLiftChart.get): In-page section heading.
- [ExternalRocCurve](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalRocCurve): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalRocCurve.list): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalRocCurve.get): In-page section heading.
- [Feature association](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#feature-association): In-page section heading.
- [FeatureAssociationMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationMatrix): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationMatrix.get): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationMatrix.create): In-page section heading.
- [Feature association matrix details](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#feature-association-matrix-details): In-page section heading.
- [FeatureAssociationMatrixDetails](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationMatrixDetails): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationMatrixDetails.get): In-page section heading.
- [Feature association featurelists](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#feature-association-featurelists): In-page section heading.
- [FeatureAssociationFeaturelists](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationFeaturelists): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationFeaturelists.get): In-page section heading.
- [Feature effects](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#feature-effects): In-page section heading.
- [FeatureEffects](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureEffects): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureEffects.from_server_data): In-page section heading.
- [FeatureEffectMetadata](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureEffectMetadata): In-page section heading.
- [FeatureEffectMetadataDatetime](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureEffectMetadataDatetime): In-page section heading.
- [FeatureEffectMetadataDatetimePerBacktest](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureEffectMetadataDatetimePerBacktest): In-page section heading.
- [Payoff matrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#payoff-matrix): In-page section heading.
- [PayoffMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix.create): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix.list): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix.get): In-page section heading.
- [update()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix.update): In-page section heading.
- [delete()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix.delete): In-page section heading.
- [from_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix.from_data): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix.from_server_data): In-page section heading.
- [Prediction explanations](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#prediction-explanations): In-page section heading.
- [PredictionExplanationsInitialization](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanationsInitialization): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanationsInitialization.get): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanationsInitialization.create): In-page section heading.
- [delete()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanationsInitialization.delete): In-page section heading.
- [PredictionExplanations](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.get): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.create): In-page section heading.
- [create_on_training_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.create_on_training_data): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.list): In-page section heading.
- [get_rows()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.get_rows): In-page section heading.
- [is_multiclass()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.is_multiclass): In-page section heading.
- [is_unsupervised_clustering_or_multiclass()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.is_unsupervised_clustering_or_multiclass): In-page section heading.
- [get_number_of_explained_classes()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.get_number_of_explained_classes): In-page section heading.
- [get_all_as_dataframe()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.get_all_as_dataframe): In-page section heading.
- [download_to_csv()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.download_to_csv): In-page section heading.
- [get_prediction_explanations_page()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.get_prediction_explanations_page): In-page section heading.
- [delete()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations.delete): In-page section heading.
- [PredictionExplanationsRow](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.prediction_explanations.PredictionExplanationsRow): In-page section heading.
- [PredictionExplanationsPage](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.prediction_explanations.PredictionExplanationsPage): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.prediction_explanations.PredictionExplanationsPage.get): In-page section heading.
- [ShapMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ShapMatrix): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ShapMatrix.create): In-page section heading.
- [list()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ShapMatrix.list): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ShapMatrix.get): In-page section heading.
- [get_as_dataframe()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ShapMatrix.get_as_dataframe): In-page section heading.
- [ClassListMode](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ClassListMode): In-page section heading.
- [get_api_parameters()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ClassListMode.get_api_parameters): In-page section heading.
- [TopPredictionsMode](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.TopPredictionsMode): In-page section heading.
- [get_api_parameters()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.TopPredictionsMode.get_api_parameters): In-page section heading.
- [Rating table](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#rating-table): In-page section heading.
- [RatingTable](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RatingTable): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RatingTable.from_server_data): In-page section heading.
- [get()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RatingTable.get): In-page section heading.
- [create()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RatingTable.create): In-page section heading.
- [download()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RatingTable.download): In-page section heading.
- [rename()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RatingTable.rename): In-page section heading.
- [create_model()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RatingTable.create_model): In-page section heading.
- [ROC curve (legacy)](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#roc-curve-legacy): In-page section heading.
- [NOTE](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#note_1): In-page section heading.
- [RocCurve](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.roc_curve.RocCurve): In-page section heading.
- [from_server_data()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.roc_curve.RocCurve.from_server_data): In-page section heading.
- [LabelwiseRocCurve](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.roc_curve.LabelwiseRocCurve): In-page section heading.
- [Word Cloud](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#word-cloud): In-page section heading.
- [WordCloud](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.word_cloud.WordCloud): In-page section heading.
- [most_frequent()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.word_cloud.WordCloud.most_frequent): In-page section heading.
- [most_important()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.word_cloud.WordCloud.most_important): In-page section heading.
- [ngrams_per_class()](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.word_cloud.WordCloud.ngrams_per_class): In-page section heading.
- [WordCloudNgram](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.word_cloud.WordCloudNgram): In-page section heading.

## Documentation content

## Model Performance Insights

### RocCurve

Class for ROC Curve calculations. Use the standard methods of BaseInsight to compute
and retrieve: compute, create, list, get.

Usage example:

> ``pythonfrom datarobot.insights import RocCurve
> RocCurve.compute("67643b2d87bb4954d7917323", data_slice_id="6764389b4bdd48581485a58b")RocCurve.get("67643b2d87bb4954d7917323", data_slice_id="6764389b4bdd48581485a58b")RocCurve.list("67643b2d87bb4954d7917323")
> [, ...]
> RocCurve.list("67643b2d87bb4954d7917323")[0].roc_points
> [{'accuracy': 0.539375, 'f1_score': 0.0, 'false_negative_score': 737, 'true_negative_score': 863, ...}]
> ``

#### kolmogorov_smirnov_metric

Kolmogorov-Smirnov metric for the ROC curve values

#### auc

AUC metric for the ROC curve values

#### positive_class_predictions

List of positive class prediction values for the ROC curve

#### negative_class_predictions

List of negative class prediction values for the ROC curve

#### roc_points

List of ROC values for the ROC curve

#### compute()

Submit an insight compute request. You can use create if you want to
wait synchronously for the completion of the job. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |

Returns

| Returns | Description |
| --- | --- |
| Status check job entity for the asynchronous insight calculation. |  |

Return type: `StatusCheckJob`

#### create()

Create an insight and wait for completion. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |
| max_wait | int | The number of seconds to wait for the result. |

Returns

| Returns | Description |
| --- | --- |
| Entity of the newly or already computed insights. |  |

Return type: `Self`

#### from_data()

Instantiate an object of this class using a dict.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | Correctly snake_cased keys and their values. |

Return type: `TypeVar` ( `T`, bound= APIObject)

#### from_server_data()

Override from_server_data to handle paginated responses

Return type: `Self`

#### get()

Return the first matching insight based on the entity id and kwargs.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to retrieve generated insights. |
| source | str | The source type to use when retrieving the insight. |
| quick_compute | Optional[bool] | Sets whether to retrieve the insight that was computed using quick-compute. If not specified, quick_compute is not used for matching. |

Returns

| Returns | Description |
| --- | --- |
| Previously computed insight. |  |

Return type: `Self`

#### get_uri()

This should define the URI to their browser based interactions

Return type: `str`

#### list()

List all generated insights.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity queried for listing all generated insights. |

Returns

| Returns | Description |
| --- | --- |
| List of newly or previously computed insights. |  |

Return type: `List[Self]`

#### open_in_browser()

Opens class’ relevant web browser location.
If default browser is not available the URL is logged.

Note:
If text-mode browsers are used, the calling process will block
until the user exits the browser.

Return type: `None`

#### sort()

Sorts insights data

Return type: `None`

### LiftChart

Class for Lift Chart calculations. Use the standard methods of BaseInsight to compute
and retrieve: compute, create, list, get.

Usage example:

> ``pythonfrom datarobot.insights import LiftChart
> LiftChart.compute("67643b2d87bb4954d7917323", data_slice_id="6764389b4bdd48581485a58b")LiftChart.list("67643b2d87bb4954d7917323")
> [, ... ]
> LiftChart.get("67643b2d87bb4954d7917323", data_slice_id="6764389b4bdd48581485a58b").bins
> [{'actual': 0.4, 'predicted': 0.22727272727272724, 'bin_weight': 5.0}, ... ]
> ``

#### bins

Lift chart bins.

#### compute()

Submit an insight compute request. You can use create if you want to
wait synchronously for the completion of the job. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |

Returns

| Returns | Description |
| --- | --- |
| Status check job entity for the asynchronous insight calculation. |  |

Return type: `StatusCheckJob`

#### create()

Create an insight and wait for completion. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |
| max_wait | int | The number of seconds to wait for the result. |

Returns

| Returns | Description |
| --- | --- |
| Entity of the newly or already computed insights. |  |

Return type: `Self`

#### from_data()

Instantiate an object of this class using a dict.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | Correctly snake_cased keys and their values. |

Return type: `TypeVar` ( `T`, bound= APIObject)

#### from_server_data()

Override from_server_data to handle paginated responses

Return type: `Self`

#### get()

Return the first matching insight based on the entity id and kwargs.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to retrieve generated insights. |
| source | str | The source type to use when retrieving the insight. |
| quick_compute | Optional[bool] | Sets whether to retrieve the insight that was computed using quick-compute. If not specified, quick_compute is not used for matching. |

Returns

| Returns | Description |
| --- | --- |
| Previously computed insight. |  |

Return type: `Self`

#### get_uri()

This should define the URI to their browser based interactions

Return type: `str`

#### list()

List all generated insights.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity queried for listing all generated insights. |

Returns

| Returns | Description |
| --- | --- |
| List of newly or previously computed insights. |  |

Return type: `List[Self]`

#### open_in_browser()

Opens class’ relevant web browser location.
If default browser is not available the URL is logged.

Note:
If text-mode browsers are used, the calling process will block
until the user exits the browser.

Return type: `None`

#### sort()

Sorts insights data

Return type: `None`

### Residuals

Class for Residuals calculations. Use the standard methods of BaseInsight to compute
and retrieve: compute, create, list, get.

Usage example:

> ``pythonfrom datarobot.insights import Residuals
> Residuals.list("672e32de69b0b676ced54d9c")
> []
> Residuals.compute("672e32de69b0b676ced54d9c", data_slice_id="677ae1249695103ba9feff97")Residuals.list("672e32de69b0b676ced54d9c")
> [,]
> Residuals.get("672e32de69b0b676ced54d9c", data_slice_id="677ae1249695103ba9feff97")Residuals.get("672e32de69b0b676ced54d9c", data_slice_id="677ae1249695103ba9feff97").histogram
> [{'interval_start': -33.37288135593221, 'interval_end': -32.525000000000006, 'occurrences': 1}, ...]
> ``

#### histogram

Residuals histogram.

#### coefficient_of_determination

Coefficient of determination.

#### residual_mean

Residual mean.

#### standard_deviation

Standard deviation.

#### chart_data

The rows of Residuals chart data in [actual, predicted, residual, row number] form.

#### compute()

Submit an insight compute request. You can use create if you want to
wait synchronously for the completion of the job. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |

Returns

| Returns | Description |
| --- | --- |
| Status check job entity for the asynchronous insight calculation. |  |

Return type: `StatusCheckJob`

#### create()

Create an insight and wait for completion. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |
| max_wait | int | The number of seconds to wait for the result. |

Returns

| Returns | Description |
| --- | --- |
| Entity of the newly or already computed insights. |  |

Return type: `Self`

#### from_data()

Instantiate an object of this class using a dict.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | Correctly snake_cased keys and their values. |

Return type: `TypeVar` ( `T`, bound= APIObject)

#### from_server_data()

Override from_server_data to handle paginated responses

Return type: `Self`

#### get()

Return the first matching insight based on the entity id and kwargs.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to retrieve generated insights. |
| source | str | The source type to use when retrieving the insight. |
| quick_compute | Optional[bool] | Sets whether to retrieve the insight that was computed using quick-compute. If not specified, quick_compute is not used for matching. |

Returns

| Returns | Description |
| --- | --- |
| Previously computed insight. |  |

Return type: `Self`

#### get_uri()

This should define the URI to their browser based interactions

Return type: `str`

#### list()

List all generated insights.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity queried for listing all generated insights. |

Returns

| Returns | Description |
| --- | --- |
| List of newly or previously computed insights. |  |

Return type: `List[Self]`

#### open_in_browser()

Opens class’ relevant web browser location.
If default browser is not available the URL is logged.

Note:
If text-mode browsers are used, the calling process will block
until the user exits the browser.

Return type: `None`

#### sort()

Sorts insights data

Return type: `None`

## SHAP Insights

### ShapMatrix

Class for SHAP Matrix calculations. Use the standard methods of BaseInsight to compute
and retrieve: compute, create, list, get.

#### matrix

SHAP matrix values.

#### base_value

SHAP base value for the matrix values

#### columns

List of columns associated with the SHAP matrix

#### link_function

Link function used to generate the SHAP matrix

#### compute()

Submit an insight compute request. You can use create if you want to
wait synchronously for the completion of the job. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |

Returns

| Returns | Description |
| --- | --- |
| Status check job entity for the asynchronous insight calculation. |  |

Return type: `StatusCheckJob`

#### create()

Create an insight and wait for completion. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |
| max_wait | int | The number of seconds to wait for the result. |

Returns

| Returns | Description |
| --- | --- |
| Entity of the newly or already computed insights. |  |

Return type: `Self`

#### from_data()

Instantiate an object of this class using a dict.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | Correctly snake_cased keys and their values. |

Return type: `TypeVar` ( `T`, bound= APIObject)

#### from_server_data()

Override from_server_data to handle paginated responses

Return type: `Self`

#### get()

Return the first matching insight based on the entity id and kwargs.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to retrieve generated insights. |
| source | str | The source type to use when retrieving the insight. |
| quick_compute | Optional[bool] | Sets whether to retrieve the insight that was computed using quick-compute. If not specified, quick_compute is not used for matching. |

Returns

| Returns | Description |
| --- | --- |
| Previously computed insight. |  |

Return type: `Self`

#### get_as_csv()

Retrieve a specific insight represented in CSV format.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | ID of the entity to retrieve the insight. * **kwargs (Any) – Additional keyword arguments to pass to the retrieve function. |

Returns

| Returns | Description |
| --- | --- |
| The retrieved insight. |  |

Return type: `str`

#### get_as_dataframe()

Retrieve a specific insight represented as a pandas DataFrame.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | ID of the entity to retrieve the insight. * **kwargs (Any) – Additional keyword arguments to pass to the retrieve function. |

Returns

| Returns | Description |
| --- | --- |
| The retrieved insight. |  |

Return type: `DataFrame`

#### get_uri()

This should define the URI to their browser based interactions

Return type: `str`

#### list()

List all generated insights.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity queried for listing all generated insights. |

Returns

| Returns | Description |
| --- | --- |
| List of newly or previously computed insights. |  |

Return type: `List[Self]`

#### open_in_browser()

Opens class’ relevant web browser location.
If default browser is not available the URL is logged.

Note:
If text-mode browsers are used, the calling process will block
until the user exits the browser.

Return type: `None`

#### sort()

Sorts insights data

Return type: `None`

### ShapPreview

Class for SHAP Preview calculations. Use the standard methods of BaseInsight to compute
and retrieve: compute, create, list, get.

#### previews

SHAP preview values.

Returns

| Returns | Description |
| --- | --- |
| preview | A list of the ShapPreview values for each row. |

Return type: `List[Dict[str`, `Any]]`

#### previews_count

The number of shap preview rows.

Return type: `int`

#### get()

Return the first matching ShapPreview insight based on the entity id and kwargs.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to retrieve generated insights. |
| source | str | The source type to use when retrieving the insight. |
| quick_compute | Optional[bool] | Sets whether to retrieve the insight that was computed using quick-compute. If not specified, quick_compute is not used for matching. |
| prediction_filter_row_count | Optional[int] | The maximum number of preview rows to return. |
| prediction_filter_percentiles | Optional[int] | The number of percentile intervals to select from the total number of rows. This field will supersede predictionFilterRowCount if both are present. |
| prediction_filter_operand_first | Optional[float] | The first operand to apply to filtered predictions. |
| prediction_filter_operand_second | Optional[float] | The second operand to apply to filtered predictions. |
| prediction_filter_operator | Optional[str] | The operator to apply to filtered predictions. |
| feature_filter_count | Optional[int] | The maximum number of features to return for each preview. |
| feature_filter_name | Optional[str] | The names of specific features to return for each preview. |

Returns

| Returns | Description |
| --- | --- |
| Entity of the newly or already computed insights. |  |

Return type: `Self`

#### compute()

Submit an insight compute request. You can use create if you want to
wait synchronously for the completion of the job. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |

Returns

| Returns | Description |
| --- | --- |
| Status check job entity for the asynchronous insight calculation. |  |

Return type: `StatusCheckJob`

#### create()

Create an insight and wait for completion. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |
| max_wait | int | The number of seconds to wait for the result. |

Returns

| Returns | Description |
| --- | --- |
| Entity of the newly or already computed insights. |  |

Return type: `Self`

#### from_data()

Instantiate an object of this class using a dict.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | Correctly snake_cased keys and their values. |

Return type: `TypeVar` ( `T`, bound= APIObject)

#### from_server_data()

Override from_server_data to handle paginated responses

Return type: `Self`

#### get_uri()

This should define the URI to their browser based interactions

Return type: `str`

#### list()

List all generated insights.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity queried for listing all generated insights. |

Returns

| Returns | Description |
| --- | --- |
| List of newly or previously computed insights. |  |

Return type: `List[Self]`

#### open_in_browser()

Opens class’ relevant web browser location.
If default browser is not available the URL is logged.

Note:
If text-mode browsers are used, the calling process will block
until the user exits the browser.

Return type: `None`

#### sort()

Sorts insights data

Return type: `None`

### ShapImpact

Class for SHAP Impact calculations. Use the standard methods of BaseInsight to compute
and retrieve: compute, create, list, get.

#### compute()

Submit an insight compute request. You can use create if you want to
wait synchronously for the completion of the job.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |

Returns

| Returns | Description |
| --- | --- |
| Status check job entity for the asynchronous insight calculation. |  |

Return type: `StatusCheckJob`

#### create()

Create an insight and wait for completion.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |
| max_wait | int | The number of seconds to wait for the result. |

Returns

| Returns | Description |
| --- | --- |
| Entity of the newly or already computed insights. |  |

Return type: `Self`

#### sort()

Sorts insights data by key name.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| key_name | str | item key name to sort data. One of ‘feature_name’, ‘impact_normalized’ or ‘impact_unnormalized’. Starting with ‘-’ reverses sort order. Default ‘-impact_normalized’ |

Return type: `None`

#### shap_impacts

SHAP impact values

Returns

| Returns | Description |
| --- | --- |
| A list of the SHAP impact values |  |

Return type: `shap impacts`

#### base_value

A list of base prediction values

#### capping

Capping for the models in the blender

#### link

Shared link function of the models in the blender

#### row_count

Number of SHAP impact rows. This is deprecated.

#### from_data()

Instantiate an object of this class using a dict.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | Correctly snake_cased keys and their values. |

Return type: `TypeVar` ( `T`, bound= APIObject)

#### from_server_data()

Override from_server_data to handle paginated responses

Return type: `Self`

#### get()

Return the first matching insight based on the entity id and kwargs.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to retrieve generated insights. |
| source | str | The source type to use when retrieving the insight. |
| quick_compute | Optional[bool] | Sets whether to retrieve the insight that was computed using quick-compute. If not specified, quick_compute is not used for matching. |

Returns

| Returns | Description |
| --- | --- |
| Previously computed insight. |  |

Return type: `Self`

#### get_uri()

This should define the URI to their browser based interactions

Return type: `str`

#### list()

List all generated insights.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity queried for listing all generated insights. |

Returns

| Returns | Description |
| --- | --- |
| List of newly or previously computed insights. |  |

Return type: `List[Self]`

#### open_in_browser()

Opens class’ relevant web browser location.
If default browser is not available the URL is logged.

Note:
If text-mode browsers are used, the calling process will block
until the user exits the browser.

Return type: `None`

### ShapDistributions

Class for SHAP Distributions calculations. Use the standard methods of BaseInsight to compute
and retrieve: compute, create, list, get.

#### features

SHAP feature values

Returns

| Returns | Description |
| --- | --- |
| features | A list of the ShapDistributions values for each row |

Return type: `List[Dict[str`, `Any]]`

#### total_features_count

Number of shap distributions features

Return type: `int`

#### compute()

Submit an insight compute request. You can use create if you want to
wait synchronously for the completion of the job. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |

Returns

| Returns | Description |
| --- | --- |
| Status check job entity for the asynchronous insight calculation. |  |

Return type: `StatusCheckJob`

#### create()

Create an insight and wait for completion. May be overridden by insight subclasses to
accept additional parameters.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to compute the insight. |
| source | str | The source type to use when computing the insight. |
| data_slice_id | Optional[str] | Data slice ID to use when computing the insight. |
| external_dataset_id | Optional[str] | External dataset ID to use when computing the insight. |
| entity_type | Optional[ENTITY_TYPES] | The type of the entity associated with the insight. Select one of the ENTITY_TYPE enum values, or accept the default, “datarobotModel”. |
| quick_compute | Optional[bool] | Sets whether to use quick-compute for the insight. If True or unspecified, the insight is computed using a 2500-row data sample. If False, the insight is computed using all rows in the chosen source. |
| max_wait | int | The number of seconds to wait for the result. |

Returns

| Returns | Description |
| --- | --- |
| Entity of the newly or already computed insights. |  |

Return type: `Self`

#### from_data()

Instantiate an object of this class using a dict.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | Correctly snake_cased keys and their values. |

Return type: `TypeVar` ( `T`, bound= APIObject)

#### from_server_data()

Override from_server_data to handle paginated responses

Return type: `Self`

#### get()

Return the first matching insight based on the entity id and kwargs.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity to retrieve generated insights. |
| source | str | The source type to use when retrieving the insight. |
| quick_compute | Optional[bool] | Sets whether to retrieve the insight that was computed using quick-compute. If not specified, quick_compute is not used for matching. |

Returns

| Returns | Description |
| --- | --- |
| Previously computed insight. |  |

Return type: `Self`

#### get_uri()

This should define the URI to their browser based interactions

Return type: `str`

#### list()

List all generated insights.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| entity_id | str | The ID of the entity queried for listing all generated insights. |

Returns

| Returns | Description |
| --- | --- |
| List of newly or previously computed insights. |  |

Return type: `List[Self]`

#### open_in_browser()

Opens class’ relevant web browser location.
If default browser is not available the URL is logged.

Note:
If text-mode browsers are used, the calling process will block
until the user exits the browser.

Return type: `None`

#### sort()

Sorts insights data

Return type: `None`

## Types

### RocCurveEstimatedMetric

Typed dict for estimated metric

### AnomalyAssessmentRecordMetadata

Typed dict for record metadata

### AnomalyAssessmentPreviewBin

Typed dict for preview bin

### ShapleyFeatureContribution

Typed dict for shapley feature contribution

### AnomalyAssessmentDataPoint

Typed dict for data points

### RegionExplanationsData

Typed dict for region explanations

## Anomaly assessment

### AnomalyAssessmentRecord

Object which keeps metadata about anomaly assessment insight for the particular
subset, backtest and series and the links to proceed to get the anomaly assessment data.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| record_id | str | The ID of the record. |
| project_id | str | The ID of the project record belongs to. |
| model_id | str | The ID of the model record belongs to. |
| backtest | int or "holdout" | The backtest of the record. |
| source | "training" or "validation" | The source of the record |
| series_id | str or None | The series id of the record for the multiseries projects. Defined only for the multiseries projects. |
| status | str | The status of the insight. One of datarobot.enums.AnomalyAssessmentStatus |
| status_details | str | The explanation of the status. |
| start_date | str or None | The ISO-formatted timestamp of the first prediction in the subset. Will be None if status is not AnomalyAssessmentStatus.COMPLETED. |
| end_date | str or None | The ISO-formatted timestamp of the last prediction in the subset. Will be None if status is not AnomalyAssessmentStatus.COMPLETED. |
| prediction_threshold | float or None | The threshold, all rows with anomaly scores greater or equal to it have shap explanations computed. |
| preview_location | str or None | The URL to retrieve predictions preview for the subset. Will be None if status is not AnomalyAssessmentStatus.COMPLETED. |
| latest_explanations_location | str or None | The URL to retrieve the latest predictions with the shap explanations. Will be None if status is not AnomalyAssessmentStatus.COMPLETED. |
| delete_location | str | The URL to delete anomaly assessment record and relevant insight data. |

#### list()

Retrieve the list of the anomaly assessment records for the project and model.
Output can be filtered and limited.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | The ID of the project record belongs to. |
| model_id | str | The ID of the model record belongs to. |
| backtest | int or "holdout" | The backtest to filter records by. |
| source | "training" or "validation" | The source to filter records by. |
| series_id | Optional[str] | The series id to filter records by. Can be specified for multiseries projects. |
| limit | Optional[int] | 100 by default. At most this many results are returned. |
| offset | Optional[int] | This many results will be skipped. |
| with_data_only | bool, False by default | Filter by status == AnomalyAssessmentStatus.COMPLETED. If True, records with no data or not supported will be omitted. |

Returns

| Returns | Description |
| --- | --- |
| The anomaly assessment record. |  |

Return type: [AnomalyAssessmentRecord](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord)

#### compute()

Request anomaly assessment insight computation on the specified subset.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | The ID of the project to compute insight for. |
| model_id | str | The ID of the model to compute insight for. |
| backtest | int or "holdout" | The backtest to compute insight for. |
| source | "training" or "validation" | The source to compute insight for. |
| series_id | Optional[str] | The series id to compute insight for. Required for multiseries projects. |

Returns

| Returns | Description |
| --- | --- |
| The anomaly assessment record. |  |

Return type: [AnomalyAssessmentRecord](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentRecord)

#### delete()

Delete anomaly assessment record with preview and explanations.

Return type: `None`

#### get_predictions_preview()

Retrieve aggregated predictions statistics for the anomaly assessment record.

Return type: [AnomalyAssessmentPredictionsPreview](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentPredictionsPreview)

#### get_latest_explanations()

Retrieve latest predictions along with shap explanations for the most anomalous records.

Return type: [AnomalyAssessmentExplanations](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentExplanations)

#### get_explanations()

Retrieve 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: start_date, end_date or points_count must be specified.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| start_date | Optional[str] | The start of the date range to get explanations in. Example: 2020-01-01T00:00:00.000000Z |
| end_date | Optional[str] | The end of the date range to get explanations in. Example: 2020-10-01T00:00:00.000000Z |
| points_count | Optional[int] | The number of the rows to return. |

Return type: [AnomalyAssessmentExplanations](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentExplanations)

#### get_explanations_data_in_regions()

Get predictions along with explanations for the specified regions, sorted by
predictions in descending order.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| regions | list of AnomalyAssessmentPreviewBin | For each region explanations will be retrieved and merged. |
| prediction_threshold | Optional[float] | If specified, only points with score greater or equal to the threshold will be returned. |

Returns

| Returns | Description |
| --- | --- |
| dict in a form of |  |

Return type: `RegionExplanationsData`

### AnomalyAssessmentExplanations

Object which keeps predictions along with shap explanations for the most anomalous records
in the specified date range/for defined number of points.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| record_id | str | The ID of the record. |
| project_id | str | The ID of the project record belongs to. |
| model_id | str | The ID of the model record belongs to. |
| backtest | int or "holdout" | The backtest of the record. |
| source | "training" or "validation" | The source of the record. |
| series_id | str or None | The series id of the record for the multiseries projects. Defined only for the multiseries projects. |
| start_date | str or None | The ISO-formatted datetime of the first row in the data. Will be None of there is no data in the specified range. |
| end_date | str or None | The ISO-formatted datetime of the last row in the data. Will be None of there is no data in the specified range. |
| shap_base_value | float | Shap base value. |
| count | int | The number of points in data. |
| data | array of DataPoint objects or None | The list of DataPoint objects in the specified date range. |

> [!NOTE] Notes
> `DataPoint` contains:
> 
> shap_explanation
> : None or an array of up to 10 ShapleyFeatureContribution objects.
>   Only rows with the highest anomaly scores have Shapley explanations calculated.
>   Value is None if prediction is lower than prediction_threshold.
> timestamp
> (str) : ISO-formatted timestamp for the row.
> prediction
> (float) : The output of the model for this row.
> 
> `ShapleyFeatureContribution` contains:
> 
> feature_value
> (str) : the feature value for this row. First 50 characters are returned.
> strength
> (float) : the shap value for this feature and row.
> feature
> (str) : the feature name.

#### get()

Retrieve 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: start_date, end_date or points_count must be specified.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | The ID of the project. |
| record_id | str | The ID of the anomaly assessment record. |
| start_date | Optional[str] | The start of the date range to get explanations in. Example: 2020-01-01T00:00:00.000000Z |
| end_date | Optional[str] | The end of the date range to get explanations in. Example: 2020-10-01T00:00:00.000000Z |
| points_count | Optional[int] | The number of the rows to return. |

Return type: [AnomalyAssessmentExplanations](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentExplanations)

### AnomalyAssessmentPredictionsPreview

Aggregated predictions over time for the corresponding anomaly assessment record.
Intended to find the bins with highest anomaly scores.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| record_id | str | The ID of the record. |
| project_id | str | The ID of the project record belongs to. |
| model_id | str | The ID of the model record belongs to. |
| backtest | int or "holdout" | The backtest of the record. |
| source | "training" or "validation" | The source of the record |
| series_id | str or None | The series id of the record for the multiseries projects. Defined only for the multiseries projects. |
| start_date | str | the ISO-formatted timestamp of the first prediction in the subset. |
| end_date | str | the ISO-formatted timestamp of the last prediction in the subset. |
| preview_bins | list of preview_bin objects. | The aggregated predictions for the subset. Bins boundaries may differ from actual start/end dates because this is an aggregation. |

> [!NOTE] Notes
> `PreviewBin` contains:
> 
> start_date
> (str) : the ISO-formatted datetime of the start of the bin.
> end_date
> (str) : the ISO-formatted datetime of the end of the bin.
> avg_predicted
> (float or None) : the average prediction of the model in the bin. None if
>   there are no entries in the bin.
> max_predicted
> (float or None) : the maximum prediction of the model in the bin. None if
>   there are no entries in the bin.
> frequency
> (int) : the number of the rows in the bin.

#### get()

Retrieve aggregated predictions over time.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | The ID of the project. |
| record_id | str | The ID of the anomaly assessment record. |

Return type: [AnomalyAssessmentPredictionsPreview](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.anomaly_assessment.AnomalyAssessmentPredictionsPreview)

#### find_anomalous_regions()

Sort preview bins by max_predicted value and select those with max predicted value
: greater or equal to max prediction threshold.
  Sort the result by max predicted value in descending order.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| max_prediction_threshold | Optional[float] | Return bins with maximum anomaly score greater or equal to max_prediction_threshold. |

Returns

| Returns | Description |
| --- | --- |
| preview_bins | Filtered and sorted preview bins |

Return type: `list` of `preview_bin`

## Confusion chart

### ConfusionChart

Confusion Chart data for model.

> [!NOTE] Notes
> `ClassMetrics` is a dict containing the following:
> 
> class_name
> (string) name of the class
> actual_count
> (int) number of times this class is seen in the validation data
> predicted_count
> (int) number of times this class has been predicted for the           validation data
> f1
> (float) F1 score
> recall
> (float) recall score
> precision
> (float) precision score
> was_actual_percentages
> (list of dict) one vs all actual percentages in format           specified below.
>   : *
> other_class_name
> (string) the name of the other class
>     *
> percentage
> (float) the percentage of the times this class was predicted when is               was actually class (from 0 to 1)
> was_predicted_percentages
> (list of dict) one vs all predicted percentages in format           specified below.
>   : *
> other_class_name
> (string) the name of the other class
>     *
> percentage
> (float) the percentage of the times this class was actual predicted               (from 0 to 1)
> confusion_matrix_one_vs_all
> (list of list) 2d list representing 2x2 one vs all matrix.
>   : * This represents the True/False Negative/Positive rates as integer for each class.               The data structure looks like:
>     *
> [ [ True Negative, False Positive ], [ False Negative, True Positive ] ]

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| source | str | Confusion Chart data source. Can be ‘validation’, ‘crossValidation’ or ‘holdout’. |
| raw_data | dict | All of the raw data for the Confusion Chart |
| confusion_matrix | list of list | The N x N confusion matrix |
| classes | list | The names of each of the classes |
| class_metrics | list of dicts | List of dicts with schema described as ClassMetrics above. |
| source_model_id | str | ID of the model this Confusion chart represents; in some cases, insights from the parent of a frozen model may be used |

## Lift chart (legacy)

#### NOTE

The Lift chart class below is from the legacy API. For new code, use [LiftChart](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.LiftChart) documented above, which provides `compute()`, `get()`, `list()`, and `create()` methods.

### LiftChart

Lift chart data for model.

> [!NOTE] Notes
> `LiftChartBin` is a dict containing the following:
> 
> actual
> (float) Sum of actual target values in bin
> predicted
> (float) Sum of predicted target values in bin
> bin_weight
> (float) The weight of the bin. For weighted projects, it is the sum of           the weights of the rows in the bin. For unweighted projects, it is the number of rows in           the bin.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| source | str | Lift chart data source. Can be ‘validation’, ‘crossValidation’ or ‘holdout’. |
| bins | list of dict | List of dicts with schema described as LiftChartBin above. |
| source_model_id | str | ID of the model this lift chart represents; in some cases, insights from the parent of a frozen model may be used |
| target_class | Optional[str] | For multiclass lift - target class for this lift chart data. |
| data_slice_id | string or None | The slice to retrieve Lift Chart for; if None, retrieve unsliced data. |

#### from_server_data()

Overwrite APIObject.from_server_data to handle lift chart data retrieved
from either legacy URL or /insights/ new URL.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | The directly translated dict of JSON from the server. No casing fixes have taken place |
| use_insights_format | Optional[bool] | Whether to repack the data from the format used in the GET /insights/liftChart/ URL to the format used in the legacy URL. |

Return type: [LiftChart](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.lift_chart.LiftChart)

## Data slices

### DataSlice

Definition of a data slice

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| id | str | ID of the data slice. |
| name | str | Name of the data slice definition. |
| filters | list[DataSliceFiltersType] | List of DataSliceFiltersType with params : - operand (str) Name of the feature to use in the filter. - operator (str) Operator to use in the filter - eq, in, <, or >. - values (Union[str, int, float]) Values to use from the feature. |
| project_id | str | ID of the project that the model is part of. |

#### list()

List the data slices in the same project

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project | Union[str, Project] | ID of the project or Project object from which to list data slices. |
| offset | Optional[int] | Number of items to skip. |
| limit | Optional[int] | Number of items to return. |

Returns

| Returns | Description |
| --- | --- |
| data_slices |  |

Return type: `list[DataSlice]`

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> ...  # set up your Client
> >>> data_slices = dr.DataSlice.list("646d0ea0cd8eb2355a68b0e5")
> >>> data_slices
> [DataSlice(...), DataSlice(...), ...]
> ```

#### create()

Creates a data slice in the project with the given name and filters

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| name | str | Name of the data slice definition. |
| filters | list[DataSliceFiltersType] | List of filters (dict) with params:: - operand (str) : Name of the feature to use in filter. - operator (str) : Operator to use: ‘eq’, ‘in’, ‘<’, or ‘>’. - values (Union[str, int, float]) : Values to use from the feature. |
| project | Union[str, Project] | Project ID or Project object from which to list data slices. |

Returns

| Returns | Description |
| --- | --- |
| data_slice | The data slice object created |

Return type: [DataSlice](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSlice)

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> ...  # set up your Client and retrieve a project
> >>> data_slice = dr.DataSlice.create(
> >>> ...    name='yes',
> >>> ...    filters=[{'operand': 'binary_target', 'operator': 'eq', 'values': ['Yes']}],
> >>> ...    project=project,
> >>> ...  )
> >>> data_slice
> DataSlice(
>     filters=[{'operand': 'binary_target', 'operator': 'eq', 'values': ['Yes']}],
>     id=646d1296bd0c543d88923c9d,
>     name=yes,
>     project_id=646d0ea0cd8eb2355a68b0e5
> )
> ```

#### delete()

Deletes the data slice from storage

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> data_slice = dr.DataSlice.get('5a8ac9ab07a57a0001be501f')
> >>> data_slice.delete()
> ```
> 
> ```
> >>> import datarobot as dr
> >>> ... # get project or project_id
> >>> data_slices = dr.DataSlice.list(project)  # project object or project_id
> >>> data_slice = data_slices[0]  # choose a data slice from the list
> >>> data_slice.delete()
> ```

Return type: `None`

#### request_size()

Submits a request to validate the data slice’s filters and
calculate the data slice’s number of rows on a given source

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| source | INSIGHTS_SOURCES | Subset of data (partition or “source”) on which to apply the data slice for estimating available rows. |
| model | Optional[Union[str, Model]] | Model object or ID of the model. It is only required when source is “training”. |

Returns

| Returns | Description |
| --- | --- |
| status_check_job | Object contains all needed logic for a periodical status check of an async job. |

Return type: `StatusCheckJob`

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> ... # get project or project_id
> >>> data_slices = dr.DataSlice.list(project)  # project object or project_id
> >>> data_slice = data_slices[0]  # choose a data slice from the list
> >>> status_check_job = data_slice.request_size("validation")
> ```
> 
> Model is required when source is ‘training’
> 
> ```
> >>> import datarobot as dr
> >>> ... # get project or project_id
> >>> data_slices = dr.DataSlice.list(project)  # project object or project_id
> >>> data_slice = data_slices[0]  # choose a data slice from the list
> >>> status_check_job = data_slice.request_size("training", model)
> ```

#### get_size_info()

Get information about the data slice applied to a source

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| source | INSIGHTS_SOURCES | Source (partition or subset) to which the data slice was applied |
| model | Optional[Union[str, Model]] | ID for the model whose training data was sliced with this data slice. Required when the source is “training”, and not used for other sources. |

Returns

| Returns | Description |
| --- | --- |
| slice_size_info | Information of the data slice applied to a source |

Return type: [DataSliceSizeInfo](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSliceSizeInfo)

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> ...  # set up your Client
> >>> data_slices = dr.DataSlice.list("646d0ea0cd8eb2355a68b0e5")
> >>> data_slice = slices[0]  # can be any slice in the list
> >>> data_slice_size_info = data_slice.get_size_info("validation")
> >>> data_slice_size_info
> DataSliceSizeInfo(
>     data_slice_id=6493a1776ea78e6644382535,
>     messages=[
>         {
>             'level': 'WARNING',
>             'description': 'Low Observation Count',
>             'additional_info': 'Insufficient number of observations to compute some insights.'
>         }
>     ],
>     model_id=None,
>     project_id=646d0ea0cd8eb2355a68b0e5,
>     slice_size=1,
>     source=validation,
> )
> >>> data_slice_size_info.to_dict()
> {
>     'data_slice_id': '6493a1776ea78e6644382535',
>     'messages': [
>         {
>             'level': 'WARNING',
>             'description': 'Low Observation Count',
>             'additional_info': 'Insufficient number of observations to compute some insights.'
>         }
>     ],
>     'model_id': None,
>     'project_id': '646d0ea0cd8eb2355a68b0e5',
>     'slice_size': 1,
>     'source': 'validation',
> }
> ```
> 
> ```
> >>> import datarobot as dr
> >>> ...  # set up your Client
> >>> data_slice = dr.DataSlice.get("6493a1776ea78e6644382535")
> >>> data_slice_size_info = data_slice.get_size_info("validation")
> ```
> 
> When using source=’training’, the model param is required.
> 
> ```
> >>> import datarobot as dr
> >>> ...  # set up your Client
> >>> model = dr.Model.get(project_id, model_id)
> >>> data_slice = dr.DataSlice.get("6493a1776ea78e6644382535")
> >>> data_slice_size_info = data_slice.get_size_info("training", model)
> ```
> 
> ```
> >>> import datarobot as dr
> >>> ...  # set up your Client
> >>> data_slice = dr.DataSlice.get("6493a1776ea78e6644382535")
> >>> data_slice_size_info = data_slice.get_size_info("training", model_id)
> ```

#### get()

Retrieve a specific data slice.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data_slice_id | str | The identifier of the data slice to retrieve. |

Returns

| Returns | Description |
| --- | --- |
| data_slice | The required data slice. |

Return type: [DataSlice](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.data_slice.DataSlice)

> [!NOTE] Examples
> ```
> >>> import datarobot as dr
> >>> dr.DataSlice.get('648b232b9da812a6aaa0b7a9')
> DataSlice(filters=[{'operand': 'binary_target', 'operator': 'eq', 'values': ['Yes']}],
>           id=648b232b9da812a6aaa0b7a9,
>           name=test,
>           project_id=644bc575572480b565ca42cd
>           )
> ```

### DataSliceSizeInfo

Definition of a data slice applied to a source

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| data_slice_id | str | ID of the data slice |
| project_id | str | ID of the project |
| source | str | Data source used to calculate the number of rows (slice size) after applying the data slice’s filters |
| model_id | Optional[str] | ID of the model, required when source (subset) is ‘training’ |
| slice_size | int | Number of rows in the data slice for a given source |
| messages | list[DataSliceSizeMessageType] | List of user-relevant messages related to a data slice |

## Datetime trend plots

### AccuracyOverTimePlotsMetadata

Accuracy over Time metadata for datetime model.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project ID. |
| model_id | string | The model ID. |
| forecast_distance | int or None | The forecast distance for which the metadata was retrieved. None for OTV projects. |
| resolutions | list of string | A list of datarobot.enums.DATETIME_TREND_PLOTS_RESOLUTION, which represents available time resolutions for which plots can be retrieved. |
| backtest_metadata | list of dict | List of backtest metadata dicts. The list index of metadata dict is the backtest index. See backtest/holdout metadata info in Notes for more details. |
| holdout_metadata | dict | Holdout metadata dict. See backtest/holdout metadata info in Notes for more details. |
| backtest_statuses | list of dict | List of backtest statuses dict. The list index of status dict is the backtest index. See backtest/holdout status info in Notes for more details. |
| holdout_statuses | dict | Holdout status dict. See backtest/holdout status info in Notes for more details. |

> [!NOTE] Notes
> Backtest/holdout status is a dict containing the following:
> 
> training: string
>   : Status backtest/holdout training. One of
> datarobot.enums.DATETIME_TREND_PLOTS_STATUS
> validation: string
>   : Status backtest/holdout validation. One of
> datarobot.enums.DATETIME_TREND_PLOTS_STATUS
> 
> Backtest/holdout metadata is a dict containing the following:
> 
> training: dict
>   : Start and end dates for the backtest/holdout training.
> validation: dict
>   : Start and end dates for the backtest/holdout validation.
> 
> Each dict in the training and validation in backtest/holdout metadata is structured like:
> 
> start_date: datetime.datetime or None
>   : The datetime of the start of the chart data (inclusive). None if chart data is not computed.
> end_date: datetime.datetime or None
>   : The datetime of the end of the chart data (exclusive). None if chart data is not computed.

### AccuracyOverTimePlot

Accuracy over Time plot for datetime model.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project ID. |
| model_id | string | The model ID. |
| resolution | string | The resolution that is used for binning. One of datarobot.enums.DATETIME_TREND_PLOTS_RESOLUTION |
| start_date | datetime.datetime | The datetime of the start of the chart data (inclusive). |
| end_date | datetime.datetime | The datetime of the end of the chart data (exclusive). |
| bins | list of dict | List of plot bins. See bin info in Notes for more details. |
| statistics | dict | Statistics for plot. See statistics info in Notes for more details. |
| calendar_events | list of dict | List of calendar events for the plot. See calendar events info in Notes for more details. |

> [!NOTE] Notes
> Bin is a dict containing the following:
> 
> start_date: datetime.datetime
>   : The datetime of the start of the bin (inclusive).
> end_date: datetime.datetime
>   : The datetime of the end of the bin (exclusive).
> actual: float or None
>   : Average actual value of the target in the bin. None if there are no entries in the bin.
> predicted: float or None
>   : Average prediction of the model in the bin. None if there are no entries in the bin.
> frequency: int or None
>   : Indicates number of values averaged in bin.
> 
> Statistics is a dict containing the following:
> 
> durbin_watson: float or None
>   : The Durbin-Watson statistic for the chart data.
>     Value is between 0 and 4. Durbin-Watson statistic
>     is a test statistic used to detect the presence of
>     autocorrelation at lag 1 in the residuals (prediction errors)
>     from a regression analysis. More info
> https://wikipedia.org/wiki/Durbin%E2%80%93Watson_statistic
> 
> Calendar event is a dict containing the following:
> 
> name: string
>   : Name of the calendar event.
> date: datetime
>   : Date of the calendar event.
> series_id: string or None
>   : The series ID for the event. If this event does not specify a series ID,
>     then this will be None, indicating that the event applies to all series.

### AccuracyOverTimePlotPreview

Accuracy over Time plot preview for datetime model.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project ID. |
| model_id | string | The model ID. |
| start_date | datetime.datetime | The datetime of the start of the chart data (inclusive). |
| end_date | datetime.datetime | The datetime of the end of the chart data (exclusive). |
| bins | list of dict | List of plot bins. See bin info in Notes for more details. |

> [!NOTE] Notes
> Bin is a dict containing the following:
> 
> start_date: datetime.datetime
>   : The datetime of the start of the bin (inclusive).
> end_date: datetime.datetime
>   : The datetime of the end of the bin (exclusive).
> actual: float or None
>   : Average actual value of the target in the bin. None if there are no entries in the bin.
> predicted: float or None
>   : Average prediction of the model in the bin. None if there are no entries in the bin.

### ForecastVsActualPlotsMetadata

Forecast vs Actual plots metadata for datetime model.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project ID. |
| model_id | string | The model ID. |
| resolutions | list of string | A list of datarobot.enums.DATETIME_TREND_PLOTS_RESOLUTION, which represents available time resolutions for which plots can be retrieved. |
| backtest_metadata | list of dict | List of backtest metadata dicts. The list index of metadata dict is the backtest index. See backtest/holdout metadata info in Notes for more details. |
| holdout_metadata | dict | Holdout metadata dict. See backtest/holdout metadata info in Notes for more details. |
| backtest_statuses | list of dict | List of backtest statuses dict. The list index of status dict is the backtest index. See backtest/holdout status info in Notes for more details. |
| holdout_statuses | dict | Holdout status dict. See backtest/holdout status info in Notes for more details. |

> [!NOTE] Notes
> Backtest/holdout status is a dict containing the following:
> 
> training: dict
>   : Dict containing each of
> datarobot.enums.DATETIME_TREND_PLOTS_STATUS
> as dict key,
>     and list of forecast distances for particular status as dict value.
> validation: dict
>   : Dict containing each of
> datarobot.enums.DATETIME_TREND_PLOTS_STATUS
> as dict key,
>     and list of forecast distances for particular status as dict value.
> 
> Backtest/holdout metadata is a dict containing the following:
> 
> training: dict
>   : Start and end dates for the backtest/holdout training.
> validation: dict
>   : Start and end dates for the backtest/holdout validation.
> 
> Each dict in the training and validation in backtest/holdout metadata is structured like:
> 
> start_date: datetime.datetime or None
>   : The datetime of the start of the chart data (inclusive). None if chart data is not computed.
> end_date: datetime.datetime or None
>   : The datetime of the end of the chart data (exclusive). None if chart data is not computed.

### ForecastVsActualPlot

Forecast vs Actual plot for datetime model.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project ID. |
| model_id | string | The model ID. |
| forecast_distances | list of int | A list of forecast distances that were retrieved. |
| resolution | string | The resolution that is used for binning. One of datarobot.enums.DATETIME_TREND_PLOTS_RESOLUTION |
| start_date | datetime.datetime | The datetime of the start of the chart data (inclusive). |
| end_date | datetime.datetime | The datetime of the end of the chart data (exclusive). |
| bins | list of dict | List of plot bins. See bin info in Notes for more details. |
| calendar_events | list of dict | List of calendar events for the plot. See calendar events info in Notes for more details. |

> [!NOTE] Notes
> Bin is a dict containing the following:
> 
> start_date: datetime.datetime
>   : The datetime of the start of the bin (inclusive).
> end_date: datetime.datetime
>   : The datetime of the end of the bin (exclusive).
> actual: float or None
>   : Average actual value of the target in the bin. None if there are no entries in the bin.
> forecasts: list of float
>   : A list of average forecasts for the model for each forecast distance.
>     Empty if there are no forecasts in the bin.
>     Each index in the forecasts list maps to forecastDistances list index.
> error: float or None
>   : Average absolute residual value of the bin.
>     None if there are no entries in the bin.
> normalized_error: float or None
>   : Normalized average absolute residual value of the bin.
>     None if there are no entries in the bin.
> frequency: int or None
>   : Indicates number of values averaged in bin.
> 
> Calendar event is a dict containing the following:
> 
> name: string
>   : Name of the calendar event.
> date: datetime
>   : Date of the calendar event.
> series_id: string or None
>   : The series ID for the event. If this event does not specify a series ID,
>     then this will be None, indicating that the event applies to all series.

### ForecastVsActualPlotPreview

Forecast vs Actual plot preview for datetime model.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project ID. |
| model_id | string | The model ID. |
| start_date | datetime.datetime | The datetime of the start of the chart data (inclusive). |
| end_date | datetime.datetime | The datetime of the end of the chart data (exclusive). |
| bins | list of dict | List of plot bins. See bin info in Notes for more details. |

> [!NOTE] Notes
> Bin is a dict containing the following:
> 
> start_date: datetime.datetime
>   : The datetime of the start of the bin (inclusive).
> end_date: datetime.datetime
>   : The datetime of the end of the bin (exclusive).
> actual: float or None
>   : Average actual value of the target in the bin. None if there are no entries in the bin.
> predicted: float or None
>   : Average prediction of the model in the bin. None if there are no entries in the bin.

### AnomalyOverTimePlotsMetadata

Anomaly over Time metadata for datetime model.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project ID. |
| model_id | string | The model ID. |
| resolutions | list of string | A list of datarobot.enums.DATETIME_TREND_PLOTS_RESOLUTION, which represents available time resolutions for which plots can be retrieved. |
| backtest_metadata | list of dict | List of backtest metadata dicts. The list index of metadata dict is the backtest index. See backtest/holdout metadata info in Notes for more details. |
| holdout_metadata | dict | Holdout metadata dict. See backtest/holdout metadata info in Notes for more details. |
| backtest_statuses | list of dict | List of backtest statuses dict. The list index of status dict is the backtest index. See backtest/holdout status info in Notes for more details. |
| holdout_statuses | dict | Holdout status dict. See backtest/holdout status info in Notes for more details. |

> [!NOTE] Notes
> Backtest/holdout status is a dict containing the following:
> 
> training: string
>   : Status backtest/holdout training. One of
> datarobot.enums.DATETIME_TREND_PLOTS_STATUS
> validation: string
>   : Status backtest/holdout validation. One of
> datarobot.enums.DATETIME_TREND_PLOTS_STATUS
> 
> Backtest/holdout metadata is a dict containing the following:
> 
> training: dict
>   : Start and end dates for the backtest/holdout training.
> validation: dict
>   : Start and end dates for the backtest/holdout validation.
> 
> Each dict in the training and validation in backtest/holdout metadata is structured like:
> 
> start_date: datetime.datetime or None
>   : The datetime of the start of the chart data (inclusive). None if chart data is not computed.
> end_date: datetime.datetime or None
>   : The datetime of the end of the chart data (exclusive). None if chart data is not computed.

### AnomalyOverTimePlot

Anomaly over Time plot for datetime model.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project ID. |
| model_id | string | The model ID. |
| resolution | string | The resolution that is used for binning. One of datarobot.enums.DATETIME_TREND_PLOTS_RESOLUTION |
| start_date | datetime.datetime | The datetime of the start of the chart data (inclusive). |
| end_date | datetime.datetime | The datetime of the end of the chart data (exclusive). |
| bins | list of dict | List of plot bins. See bin info in Notes for more details. |
| calendar_events | list of dict | List of calendar events for the plot. See calendar events info in Notes for more details. |

> [!NOTE] Notes
> Bin is a dict containing the following:
> 
> start_date: datetime.datetime
>   : The datetime of the start of the bin (inclusive).
> end_date: datetime.datetime
>   : The datetime of the end of the bin (exclusive).
> predicted: float or None
>   : Average prediction of the model in the bin. None if there are no entries in the bin.
> frequency: int or None
>   : Indicates number of values averaged in bin.
> 
> Calendar event is a dict containing the following:
> 
> name: string
>   : Name of the calendar event.
> date: datetime
>   : Date of the calendar event.
> series_id: string or None
>   : The series ID for the event. If this event does not specify a series ID,
>     then this will be None, indicating that the event applies to all series.

### AnomalyOverTimePlotPreview

Anomaly over Time plot preview for datetime model.

Added in version v2.25.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project ID. |
| model_id | string | The model ID. |
| prediction_threshold | float | Only bins with predictions exceeding this threshold are returned in the response. |
| start_date | datetime.datetime | The datetime of the start of the chart data (inclusive). |
| end_date | datetime.datetime | The datetime of the end of the chart data (exclusive). |
| bins | list of dict | List of plot bins. See bin info in Notes for more details. |

> [!NOTE] Notes
> Bin is a dict containing the following:
> 
> start_date: datetime.datetime
>   : The datetime of the start of the bin (inclusive).
> end_date: datetime.datetime
>   : The datetime of the end of the bin (exclusive).

## External scores and insights

### ExternalScores

Metric scores on prediction dataset with target or actual value column in unsupervised
case. Contains project metrics for supervised and special classification metrics set for
unsupervised projects.

Added in version v2.21.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| model_id | str | id of the model |
| dataset_id | str | id of the prediction dataset with target or actual value column for unsupervised case |
| actual_value_column | Optional[str] | For unsupervised projects only. Actual value column which was used to calculate the classification metrics and insights on the prediction dataset. |
| scores | list of dicts in a form of {'label': metric_name, 'value': score} | Scores on the dataset. |

> [!NOTE] Examples
> List all scores for a dataset
> 
> ```
> from datarobot.models.external_dataset_scores_insights.external_scores import ExternalScores
> scores = ExternalScores.list(project_id, dataset_id=dataset_id)
> ```

#### create()

Compute an external dataset insights for the specified model.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| model_id | str | id of the model for which insights is requested |
| dataset_id | str | id of the dataset for which insights is requested |
| actual_value_column | Optional[str] | actual values column label, for unsupervised projects only |

Returns

| Returns | Description |
| --- | --- |
| job | an instance of created async job |

Return type: `Job`

#### list()

Fetch external scores list for the project and optionally for model and dataset.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project |
| model_id | Optional[str] | if specified, only scores for this model will be retrieved |
| dataset_id | Optional[str] | if specified, only scores for this dataset will be retrieved |
| offset | Optional[int] | this many results will be skipped, default: 0 |
| limit | Optional[int] | at most this many results are returned, default: 100, max 1000. To return all results, specify 0 |

Return type: `List` [ [ExternalScores](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalScores)]

Returns

| Returns | Description |
| --- | --- |
| A list of External Scores objects |  |

#### get()

Retrieve external scores for the project, model and dataset.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project |
| model_id | str | if specified, only scores for this model will be retrieved |
| dataset_id | str | if specified, only scores for this dataset will be retrieved |

Return type: [ExternalScores](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalScores)

Returns

| Returns | Description |
| --- | --- |
| External Scores object |  |

### ExternalLiftChart

Lift chart for the model and prediction dataset with target or actual value column in
unsupervised case.

Added in version v2.21.

`LiftChartBin` is a dict containing the following:

> actual(float) Sum of actual target values in binpredicted(float) Sum of predicted target values in binbin_weight(float) The weight of the bin. For weighted projects, it is the sum of           the weights of the rows in the bin. For unweighted projects, it is the number of rows in           the bin.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| dataset_id | str | id of the prediction dataset with target or actual value column for unsupervised case |
| bins | list of dict | List of dicts with schema described as LiftChartBin above. |

#### list()

Retrieve list of the lift charts for the model.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project |
| model_id | str | if specified, only lift chart for this model will be retrieved |
| dataset_id | Optional[str] | if specified, only lift chart for this dataset will be retrieved |
| offset | Optional[int] | this many results will be skipped, default: 0 |
| limit | Optional[int] | at most this many results are returned, default: 100, max 1000. To return all results, specify 0 |

Return type: `List` [ [ExternalLiftChart](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalLiftChart)]

Returns

| Returns | Description |
| --- | --- |
| A list of ExternalLiftChart objects |  |

#### get()

Retrieve lift chart for the model and prediction dataset.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | project id |
| model_id | str | model id |
| dataset_id | str | prediction dataset id with target or actual value column for unsupervised case |

Return type: [ExternalLiftChart](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalLiftChart)

Returns

| Returns | Description |
| --- | --- |
| ExternalLiftChart object |  |

### ExternalRocCurve

ROC curve data for the model and prediction dataset with target or actual value column in
unsupervised case.

Added in version v2.21.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| dataset_id | str | id of the prediction dataset with target or actual value column for unsupervised case |
| roc_points | list of dict | List of precalculated metrics associated with thresholds for ROC curve. |
| negative_class_predictions | list of float | List of predictions from example for negative class |
| positive_class_predictions | list of float | List of predictions from example for positive class |

#### list()

Retrieve list of the roc curves for the model.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project |
| model_id | str | if specified, only lift chart for this model will be retrieved |
| dataset_id | Optional[str] | if specified, only lift chart for this dataset will be retrieved |
| offset | Optional[int] | this many results will be skipped, default: 0 |
| limit | Optional[int] | at most this many results are returned, default: 100, max 1000. To return all results, specify 0 |

Return type: `List` [ [ExternalRocCurve](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalRocCurve)]

Returns

| Returns | Description |
| --- | --- |
| A list of ExternalRocCurve objects |  |

#### get()

Retrieve ROC curve chart for the model and prediction dataset.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | project id |
| model_id | str | model id |
| dataset_id | str | prediction dataset id with target or actual value column for unsupervised case |

Return type: [ExternalRocCurve](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.ExternalRocCurve)

Returns

| Returns | Description |
| --- | --- |
| ExternalRocCurve object |  |

## Feature association

### FeatureAssociationMatrix

Feature association statistics for a project.

> [!NOTE] Notes
> Projects created prior to v2.17 are not supported by this feature.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | str | Id of the associated project. |
| strengths | list of dict | Pairwise statistics for the available features as structured below. |
| features | list of dict | Metadata for each feature and where it goes in the matrix. |

> [!NOTE] Examples
> ```
> import datarobot as dr
> 
> # retrieve feature association matrix
> feature_association_matrix = dr.FeatureAssociationMatrix.get(project_id)
> feature_association_matrix.strengths
> feature_association_matrix.features
> 
> # retrieve feature association matrix for a metric, association type or a feature list
> feature_association_matrix = dr.FeatureAssociationMatrix.get(
>     project_id,
>     metric=enums.FEATURE_ASSOCIATION_METRIC.SPEARMAN,
>     association_type=enums.FEATURE_ASSOCIATION_TYPE.CORRELATION,
>     featurelist_id=featurelist_id,
> )
> ```

#### get()

Get feature association statistics.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | Id of the project that contains the requested associations. |
| metric | enums.FEATURE_ASSOCIATION_METRIC | The name of a metric to get pairwise data for. Since ‘v2.19’ this is optional and defaults to enums.FEATURE_ASSOCIATION_METRIC.MUTUAL_INFO. |
| association_type | enums.FEATURE_ASSOCIATION_TYPE | The type of dependence for the data. Since ‘v2.19’ this is optional and defaults to enums.FEATURE_ASSOCIATION_TYPE.ASSOCIATION. |
| featurelist_id | str or None | Optional, the feature list to lookup FAM data for. By default, depending on the type of the project “Informative Features” or “Timeseries Informative Features” list will be used. (New in version v2.19) |

Returns

| Returns | Description |
| --- | --- |
| Feature association pairwise metric strength data, feature clustering data, and |  |
| ordering data for Feature Association Matrix visualization. |  |

Return type: [FeatureAssociationMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationMatrix)

#### create()

Compute the Feature Association Matrix for a Feature List

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | The ID of the project that the feature list belongs to. |
| featurelist_id | str | The ID of the feature list for which insights are requested. |

Returns

| Returns | Description |
| --- | --- |
| status_check_job | Object contains all needed logic for a periodical status check of an async job. |

Return type: [StatusCheckJob](https://docs.datarobot.com/ja/docs/api/reference/sdk/projects.html.md#datarobot.models.StatusCheckJob)

## Feature association matrix details

### FeatureAssociationMatrixDetails

Plotting details for a pair of passed features present in the feature association matrix.

> [!NOTE] Notes
> Projects created prior to v2.17 are not supported by this feature.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | str | Id of the project that contains the requested associations. |
| chart_type | str | Which type of plotting the pair of features gets in the UI. e.g., ‘HORIZONTAL_BOX’, ‘VERTICAL_BOX’, ‘SCATTER’ or ‘CONTINGENCY’ |
| values | list | The data triplets for pairwise plotting e.g. {“values”: [[460.0, 428.5, 0.001], [1679.3, 259.0, 0.001], …] The first entry of each list is a value of feature1, the second entry of each list is a value of feature2, and the third is the relative frequency of the pair of datapoints in the sample. |
| features | list | A list of the requested features, [feature1, feature2] |
| types | list | The type of feature1 and feature2. Possible values: “CATEGORICAL”, “NUMERIC” |
| featurelist_id | str | Id of the feature list to lookup FAM details for. |

#### get()

Get a sample of the actual values used to measure the association between a pair of features

Added in version v2.17.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | Id of the project of interest. |
| feature1 | str | Feature name for the first feature of interest. |
| feature2 | str | Feature name for the second feature of interest. |
| featurelist_id | str | Optional, the feature list to lookup FAM data for. By default, depending on the type of the project “Informative Features” or “Timeseries Informative Features” list will be used. |

Returns

| Returns | Description |
| --- | --- |
| The feature association plotting for provided pair of features. |  |

Return type: [FeatureAssociationMatrixDetails](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationMatrixDetails)

## Feature association featurelists

### FeatureAssociationFeaturelists

Featurelists with feature association matrix availability flags for a project.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | str | Id of the project that contains the requested associations. |
| featurelists | list fo dict | The featurelists with the featurelist_id, title and the has_fam flag. |

#### get()

Get featurelists with feature association status for each.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | Id of the project of interest. |

Returns

| Returns | Description |
| --- | --- |
| Featurelist with feature association status for each. |  |

Return type: [FeatureAssociationFeaturelists](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureAssociationFeaturelists)

## Feature effects

### FeatureEffects

Feature Effects provides partial dependence and predicted vs actual values for top-500
features ordered by feature impact score.

The partial dependence shows marginal effect of a feature on the target variable after
accounting for the average effects of all other predictive features. It indicates how, holding
all other variables except the feature of interest as they were, the value of this feature
affects your prediction.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | string | The project that contains requested model |
| model_id | string | The model to retrieve Feature Effects for |
| source | string | The source to retrieve Feature Effects for |
| data_slice_id | string or None | The slice to retrieve Feature Effects for; if None, retrieve unsliced data |
| feature_effects | list | Feature Effects for every feature |
| backtest_index | string, required only for DatetimeModels, | The backtest index to retrieve Feature Effects for. |

> [!NOTE] Notes
> `featureEffects` is a dict containing the following:
> 
> feature_name
> (string) Name of the feature
> feature_type
> (string) dr.enums.FEATURE_TYPE,           Feature type either numeric, categorical or datetime
> feature_impact_score
> (float) Feature impact score
> weight_label
> (string) optional, Weight label if configured for the project else null
> partial_dependence
> (List) Partial dependence results
> predicted_vs_actual
> (List) optional, Predicted versus actual results,           may be omitted if there are insufficient qualified samples
> 
> `partial_dependence` is a dict containing the following:
> 
> is_capped
> (bool) Indicates whether the data for computation is capped
> data
> (List) partial dependence results in the following format
> 
> `data` is a list of dict containing the following:
> 
> label
> (string) Contains label for categorical and numeric features as string
> dependence
> (float) Value of partial dependence
> 
> `predicted_vs_actual` is a dict containing the following:
> 
> is_capped
> (bool) Indicates whether the data for computation is capped
> data
> (List) pred vs actual results in the following format
> 
> `data` is a list of dict containing the following:
> 
> label
> (string) Contains label for categorical features           for numeric features contains range or numeric value.
> bin
> (List) optional, For numeric features contains           labels for left and right bin limits
> predicted
> (float) Predicted value
> actual
> (float) Actual value. Actual value is null           for unsupervised timeseries models
> row_count
> (int or float) Number of rows for the label and bin.           Type is float if weight or exposure is set for the project.

#### from_server_data()

Instantiate an object of this class using the data directly from the server,
meaning that the keys may have the wrong camel casing.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | The directly translated dict of JSON from the server. No casing fixes have taken place |
| use_insights_format | Optional[bool] | Whether to repack the data from the format used in the GET /insights/featureEffects/ URL to the format used in the legacy URL. |

Return type: [FeatureEffects](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.FeatureEffects)

### FeatureEffectMetadata

Feature Effect Metadata for model, contains status and available model sources.

> [!NOTE] Notes
> `source` is expected parameter to retrieve Feature Effect. One of provided sources
> shall be used.

### FeatureEffectMetadataDatetime

Feature Effect Metadata for datetime model, contains list of
feature effect metadata per backtest.

> [!NOTE] Notes
> `feature effect metadata per backtest` contains:
> 
> status
> : str.
> backtest_index
> : str.
> sources
> : List[str].
> 
> `source` is expected parameter to retrieve Feature Effect. One of provided sources
> shall be used.
> 
> `backtest_index` is expected parameter to submit compute request and retrieve Feature Effect.
> One of provided backtest indexes shall be used.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| data | list[FeatureEffectMetadataDatetimePerBacktest] | List feature effect metadata per backtest |

### FeatureEffectMetadataDatetimePerBacktest

Convert dictionary into feature effect metadata per backtest which contains backtest_index,
status and sources.

## Payoff matrix

### PayoffMatrix

Represents a Payoff Matrix, a costs/benefit scenario used for creating a profit curve.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project with which the payoff matrix is associated. |
| id | str | id of the payoff matrix. |
| name | str | User-supplied label for the payoff matrix. |
| true_positive_value | float | Cost or benefit of a true positive classification |
| true_negative_value | float | Cost or benefit of a true negative classification |
| false_positive_value | float | Cost or benefit of a false positive classification |
| false_negative_value | float | Cost or benefit of a false negative classification |

> [!NOTE] Examples
> ```
> import datarobot as dr
> 
> # create a payoff matrix
> payoff_matrix = dr.PayoffMatrix.create(
>     project_id,
>     name,
>     true_positive_value=100,
>     true_negative_value=10,
>     false_positive_value=0,
>     false_negative_value=-10,
> )
> 
> # list available payoff matrices
> payoff_matrices = dr.PayoffMatrix.list(project_id)
> payoff_matrix = payoff_matrices[0]
> ```

#### create()

Create a payoff matrix associated with a specific project.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project with which the payoff matrix will be associated |

Returns

| Returns | Description |
| --- | --- |
| payoff_matrix | The newly created payoff matrix |

Return type: [PayoffMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix)

#### list()

Fetch all the payoff matrices for a project.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project |

Returns

| Returns | Description |
| --- | --- |
| A list of PayoffMatrix objects |  |

Return type: `List` of [PayoffMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix)

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### get()

Retrieve a specified payoff matrix.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| id | str | id of the payoff matrix |

Return type: [PayoffMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.PayoffMatrix)

Returns

| Returns | Description |
| --- | --- |
| * PayoffMatrix object representing specified |  |
| * payoff matrix |  |

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### update()

Update (replace) a payoff matrix. Note that all data fields are required.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project to which the payoff matrix belongs |
| id | str | id of the payoff matrix |
| name | str | User-supplied label for the payoff matrix |
| true_positive_value | float | True positive payoff value to use for the profit curve |
| true_negative_value | float | True negative payoff value to use for the profit curve |
| false_positive_value | float | False positive payoff value to use for the profit curve |
| false_negative_value | float | False negative payoff value to use for the profit curve |

Returns

| Returns | Description |
| --- | --- |
| PayoffMatrix with updated values |  |

Return type: `payoff_matrix`

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### delete()

Delete a specified payoff matrix.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| id | str | id of the payoff matrix |

Returns

| Returns | Description |
| --- | --- |
| response | Empty response (204) |

Return type: `requests.Response`

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### from_data()

Instantiate an object of this class using a dict.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | Correctly snake_cased keys and their values. |

Return type: `TypeVar` ( `T`, bound= APIObject)

#### from_server_data()

Instantiate an object of this class using the data directly from the server,
meaning that the keys may have the wrong camel casing

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | The directly translated dict of JSON from the server. No casing fixes have taken place |
| keep_attrs | iterable | List, set or tuple of the dotted namespace notations for attributes to keep within the object structure even if their values are None |

Return type: `TypeVar` ( `T`, bound= APIObject)

## Prediction explanations

### PredictionExplanationsInitialization

Represents a prediction explanations initialization of a model.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| model_id | str | id of the model the prediction explanations initialization is for |
| prediction_explanations_sample | list of dict | a small sample of prediction explanations that could be generated for the model |

#### get()

Retrieve the prediction explanations initialization for a model.

Prediction explanations initializations are a prerequisite for computing prediction
explanations, and include a sample what the computed prediction explanations for a
prediction dataset would look like.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| model_id | str | id of the model the prediction explanations initialization is for |

Returns

| Returns | Description |
| --- | --- |
| prediction_explanations_initialization | The queried instance. |

Return type: [PredictionExplanationsInitialization](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanationsInitialization)

Raises

| Exception | Description |
| --- | --- |
| ClientError | If the project or model does not exist or the initialization has not been computed. |

#### create()

Create a prediction explanations initialization for the specified model.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| model_id | str | id of the model for which initialization is requested |

Returns

| Returns | Description |
| --- | --- |
| job | an instance of created async job |

Return type: `Job`

#### delete()

Delete this prediction explanations initialization.

Return type: `None`

### PredictionExplanations

Represents prediction explanations metadata and provides access to computation results.

> [!NOTE] Examples
> ```
> prediction_explanations = dr.PredictionExplanations.get(project_id, explanations_id)
> for row in prediction_explanations.get_rows():
>     print(row)  # row is an instance of PredictionExplanationsRow
> ```

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| id | str | id of the record and prediction explanations computation result |
| project_id | str | id of the project the model belongs to |
| model_id | str | id of the model the prediction explanations are for |
| dataset_id | str | id of the prediction dataset prediction explanations were computed for |
| max_explanations | int | maximum number of prediction explanations to supply per row of the dataset |
| threshold_low | float | the lower threshold, below which a prediction must score in order for prediction explanations to be computed for a row in the dataset |
| threshold_high | float | the high threshold, above which a prediction must score in order for prediction explanations to be computed for a row in the dataset |
| num_columns | int | the number of columns prediction explanations were computed for |
| finish_time | float | timestamp referencing when computation for these prediction explanations finished |
| prediction_explanations_location | str | where to retrieve the prediction explanations |
| source | str | For OTV/TS in-training predictions. Holds the portion of the training dataset used to generate predictions. |

#### get()

Retrieve a specific prediction explanations metadata.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the explanations belong to |
| prediction_explanations_id | str | id of the prediction explanations |

Returns

| Returns | Description |
| --- | --- |
| prediction_explanations | The queried instance. |

Return type: [PredictionExplanations](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.PredictionExplanations)

#### create()

Create prediction explanations for the specified dataset.

In order to create PredictionExplanations for a particular model and dataset, you must
first:

> Compute feature impact for the model viadatarobot.Model.get_feature_impact()Compute a PredictionExplanationsInitialization for the model viadatarobot.PredictionExplanationsInitialization.create(project_id, model_id)Compute predictions for the model and dataset viadatarobot.Model.request_predictions(dataset_id)

`threshold_high` and `threshold_low` are optional filters applied to speed up
computation.  When at least one is specified, only the selected outlier rows will have
prediction explanations computed. Rows are considered to be outliers if their predicted
value (in case of regression projects) or probability of being the positive
class (in case of classification projects) is less than `threshold_low` or greater than `thresholdHigh`.  If neither is specified, prediction explanations will be computed for
all rows.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| model_id | str | id of the model for which prediction explanations are requested |
| dataset_id | str | id of the prediction dataset for which prediction explanations are requested |
| threshold_low | Optional[float] | the lower threshold, below which a prediction must score in order for prediction explanations to be computed for a row in the dataset. If neither threshold_high nor threshold_low is specified, prediction explanations will be computed for all rows. |
| threshold_high | Optional[float] | the high threshold, above which a prediction must score in order for prediction explanations to be computed. If neither threshold_high nor threshold_low is specified, prediction explanations will be computed for all rows. |
| max_explanations | Optional[int] | the maximum number of prediction explanations to supply per row of the dataset, default: 3. |
| mode | PredictionExplanationsMode, optional | mode of calculation for multiclass models, if not specified - server default is to explain only the predicted class, identical to passing TopPredictionsMode(1). |

Returns

| Returns | Description |
| --- | --- |
| job | an instance of created async job |

Return type: `Job`

#### create_on_training_data()

Create prediction explanations for the the dataset used to train the model.
This can be retrieved by calling `dr.Model.get().featurelist_id`.
For OTV and timeseries projects, `datetime_prediction_partition` is required and limited to the
first backtest (‘0’) or holdout (‘holdout’).

In order to create PredictionExplanations for a particular model and dataset, you must
first:

> Compute Feature Impact for the model viadatarobot.Model.get_feature_impact()/Compute a PredictionExplanationsInitialization for the model viadatarobot.PredictionExplanationsInitialization.create(project_id, model_id).Compute predictions for the model and dataset viadatarobot.Model.request_predictions(dataset_id).

`threshold_high` and `threshold_low` are optional filters applied to speed up
computation.  When at least one is specified, only the selected outlier rows will have
prediction explanations computed. Rows are considered to be outliers if their predicted
value (in case of regression projects) or probability of being the positive
class (in case of classification projects) is less than `threshold_low` or greater than `thresholdHigh`.  If neither is specified, prediction explanations will be computed for
all rows.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | The ID of the project the model belongs to. |
| model_id | str | The ID of the model for which prediction explanations are requested. |
| dataset_id | str | The ID of the prediction dataset for which prediction explanations are requested. |
| threshold_low | Optional[float] | The lower threshold, below which a prediction must score in order for prediction explanations to be computed for a row in the dataset. If neither threshold_high nor threshold_low is specified, prediction explanations will be computed for all rows. |
| threshold_high | Optional[float] | The high threshold, above which a prediction must score in order for prediction explanations to be computed. If neither threshold_high nor threshold_low is specified, prediction explanations will be computed for all rows. |
| max_explanations | Optional[int] | The maximum number of prediction explanations to supply per row of the dataset (default: 3). |
| mode | PredictionExplanationsMode, optional | The mode of calculation for multiclass models. If not specified, the server default is to explain only the predicted class, identical to passing TopPredictionsMode(1). |
| datetime_prediction_partition | str | Options: ‘0’, ‘holdout’ or None. Used only by time series and OTV projects to indicate what part of the dataset will be used to generate predictions for computing prediction explanation. Current options are ‘0’ (first backtest) and ‘holdout’. Note that only the validation partition of the first backtest will be used to generation predictions. |

Returns

| Returns | Description |
| --- | --- |
| job | An instance of created async job. |

Return type: `Job`

#### list()

List of prediction explanations metadata for a specified project.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project to list prediction explanations for |
| model_id | Optional[str] | if specified, only prediction explanations computed for this model will be returned |
| limit | int or None | at most this many results are returned, default: no limit |
| offset | int or None | this many results will be skipped, default: 0 |

Returns

| Returns | Description |
| --- | --- |
| prediction_explanations |  |

Return type: `list[PredictionExplanations]`

#### get_rows()

Retrieve prediction explanations rows.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| batch_size | int or None, optional | maximum number of prediction explanations rows to retrieve per request |
| exclude_adjusted_predictions | bool | Optional, defaults to True. Set to False to include adjusted predictions, which will differ from the predictions on some projects, e.g., those with an exposure column specified. |

Yields

| Yields | Description |
| --- | --- |
| prediction_explanations_row (PredictionExplanationsRow) | Represents prediction explanations computed for a prediction row. |

#### is_multiclass()

Whether these explanations are for a multiclass project or a non-multiclass project

Return type: `bool`

#### is_unsupervised_clustering_or_multiclass()

Clustering and multiclass XEMP always has either one of num_top_classes or class_names
parameters set

Return type: `bool`

#### get_number_of_explained_classes()

How many classes we attempt to explain for each row

Return type: `int`

#### get_all_as_dataframe()

Retrieve all prediction explanations rows and return them as a pandas.DataFrame.

Returned dataframe has the following structure:

> row_id : row id from prediction datasetprediction : the output of the model for this rowadjusted_prediction : adjusted prediction values (only appears for projects that
>   utilize prediction adjustments, e.g., projects with an exposure column)class_0_label : a class level from the target (only appears for classification
>   projects)class_0_probability : the probability that the target is this class (only appears for
>   classification projects)class_1_label : a class level from the target (only appears for classification
>   projects)class_1_probability : the probability that the target is this class (only appears for
>   classification projects)explanation_0_feature : the name of the feature contributing to the prediction for
>   this explanationexplanation_0_feature_value : the value the feature took onexplanation_0_label : the output being driven by this explanation.  For regression
>   projects, this is the name of the target feature.  For classification projects, this
>   is the class label whose probability increasing would correspond to a positive
>   strength.explanation_0_qualitative_strength : a human-readable description of how strongly the
>   feature affected the prediction (e.g., ‘+++’, ‘–’, ‘+’) for this explanationexplanation_0_per_ngram_text_explanations : Text prediction explanations data in json
>   formatted string.explanation_0_strength : the amount this feature’s value affected the prediction…explanation_N_feature : the name of the feature contributing to the prediction for
>   this explanationexplanation_N_feature_value : the value the feature took onexplanation_N_label : the output being driven by this explanation.  For regression
>   projects, this is the name of the target feature.  For classification projects, this
>   is the class label whose probability increasing would correspond to a positive
>   strength.explanation_N_qualitative_strength : a human-readable description of how strongly the
>   feature affected the prediction (e.g., ‘+++’, ‘–’, ‘+’) for this explanationexplanation_N_per_ngram_text_explanations : Text prediction explanations data in json
>   formatted string.explanation_N_strength : the amount this feature’s value affected the prediction

For classification projects, the server does not guarantee any ordering on the prediction
values, however within this function we sort the values so that class_X corresponds to
the same class from row to row.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| exclude_adjusted_predictions | bool | Optional, defaults to True. Set this to False to include adjusted prediction values in the returned dataframe. |

Returns

| Returns | Description |
| --- | --- |
| dataframe |  |

Return type: `pandas.DataFrame`

#### download_to_csv()

Save prediction explanations rows into CSV file.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| filename | str or file object | path or file object to save prediction explanations rows |
| encoding | string, optional | A string representing the encoding to use in the output file, defaults to ‘utf-8’ |
| exclude_adjusted_predictions | bool | Optional, defaults to True. Set to False to include adjusted predictions, which will differ from the predictions on some projects, e.g., those with an exposure column specified. |

Return type: `None`

#### get_prediction_explanations_page()

Get prediction explanations.

If you don’t want use a generator interface, you can access paginated prediction
explanations directly.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| limit | int or None | the number of records to return, the server will use a (possibly finite) default if not specified |
| offset | int or None | the number of records to skip, default 0 |
| exclude_adjusted_predictions | bool | Optional, defaults to True. Set to False to include adjusted predictions, which will differ from the predictions on some projects, e.g., those with an exposure column specified. |

Returns

| Returns | Description |
| --- | --- |
| prediction_explanations |  |

Return type: `PredictionExplanationsPage`

#### delete()

Delete these prediction explanations.

Return type: `None`

### PredictionExplanationsRow

Represents prediction explanations computed for a prediction row.

> [!NOTE] Notes
> `PredictionValue` contains:
> 
> label
> : describes what this model output corresponds to.  For regression projects,
>   it is the name of the target feature.  For classification projects, it is a level from
>   the target feature.
> value
> : the output of the prediction.  For regression projects, it is the predicted
>   value of the target.  For classification projects, it is the predicted probability the
>   row belongs to the class identified by the label.

`PredictionExplanation` contains:

- label : described what output was driven by this explanation.  For regression
  projects, it is the name of the target feature.  For classification projects, it is the
  class whose probability increasing would correspond to a positive strength of this
  prediction explanation.
- feature : the name of the feature contributing to the prediction
- feature_value : the value the feature took on for this row
- strength : the amount this feature’s value affected the prediction
- qualitative_strength : a human-readable description of how strongly the feature
  affected the prediction. A large positive effect is denoted ‘+++’, medium ‘++’, small ‘+’,
  very small ‘<+’. A large negative effect is denoted ‘—’, medium ‘–’, small ‘-’, very
  small ‘<-‘.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| row_id | int | which row this PredictionExplanationsRow describes |
| prediction | float | the output of the model for this row |
| adjusted_prediction | float or None | adjusted prediction value for projects that provide this information, None otherwise |
| prediction_values | list | an array of dictionaries with a schema described as PredictionValue |
| adjusted_prediction_values | list | same as prediction_values but for adjusted predictions |
| prediction_explanations | list | an array of dictionaries with a schema described as PredictionExplanation |

### PredictionExplanationsPage

Represents a batch of prediction explanations received by one request.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| id | str | id of the prediction explanations computation result |
| data | list[dict] | list of raw prediction explanations; each row corresponds to a row of the prediction dataset |
| count | int | total number of rows computed |
| previous_page | str | where to retrieve previous page of prediction explanations, None if current page is the first |
| next_page | str | where to retrieve next page of prediction explanations, None if current page is the last |
| prediction_explanations_record_location | str | where to retrieve the prediction explanations metadata |
| adjustment_method | str | Adjustment method that was applied to predictions, or ‘N/A’ if no adjustments were done. |

#### get()

Retrieve prediction explanations.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| prediction_explanations_id | str | id of the prediction explanations |
| limit | int or None | the number of records to return; the server will use a (possibly finite) default if not specified |
| offset | int or None | the number of records to skip, default 0 |
| exclude_adjusted_predictions | bool | Optional, defaults to True. Set to False to include adjusted predictions, which will differ from the predictions on some projects, e.g., those with an exposure column specified. |

Returns

| Returns | Description |
| --- | --- |
| prediction_explanations | The queried instance. |

Return type: [PredictionExplanationsPage](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.prediction_explanations.PredictionExplanationsPage)

### ShapMatrix

Represents SHAP based prediction explanations and provides access to score values.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| shap_matrix_id | str | id of the generated SHAP matrix |
| model_id | str | id of the model used to |
| dataset_id | str | id of the prediction dataset SHAP values were computed for |

> [!NOTE] Examples
> ```
> import datarobot as dr
> 
> # request SHAP matrix calculation
> shap_matrix_job = dr.ShapMatrix.create(project_id, model_id, dataset_id)
> shap_matrix = shap_matrix_job.get_result_when_complete()
> 
> # list available SHAP matrices
> shap_matrices = dr.ShapMatrix.list(project_id)
> shap_matrix = shap_matrices[0]
> 
> # get SHAP matrix as dataframe
> shap_matrix_values = shap_matrix.get_as_dataframe()
> ```

#### create()

Calculate SHAP based prediction explanations against previously uploaded dataset.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| model_id | str | id of the model for which prediction explanations are requested |
| dataset_id | str | id of the prediction dataset for which prediction explanations are requested (as uploaded from Project.upload_dataset) |

Returns

| Returns | Description |
| --- | --- |
| job | The job computing the SHAP based prediction explanations |

Return type: [ShapMatrixJob](https://docs.datarobot.com/ja/docs/api/reference/sdk/jobs.html.md#datarobot.models.ShapMatrixJob)

Raises

| Exception | Description |
| --- | --- |
| ClientError | If the server responded with 4xx status. Possible reasons are project, model or dataset don’t exist, user is not allowed or model doesn’t support SHAP based prediction explanations |
| ServerError | If the server responded with 5xx status |

#### list()

Fetch all the computed SHAP prediction explanations for a project.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project |

Returns

| Returns | Description |
| --- | --- |
| A list of ShapMatrix objects |  |

Return type: `List` of [ShapMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ShapMatrix)

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status |
| datarobot.errors.ServerError | if the server responded with 5xx status |

#### get()

Retrieve the specific SHAP matrix.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the model belongs to |
| id | str | id of the SHAP matrix |

Return type: [ShapMatrix](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.ShapMatrix) object representing specified record

#### get_as_dataframe()

Retrieve SHAP matrix values as dataframe.

Return type: `DataFrame`

Returns

| Returns | Description |
| --- | --- |
| dataframe (pandas.DataFrame) | A dataframe with SHAP scores |
| read_timeout (int (optional, default 60)) | .. versionadded:: 2.29 Wait this many seconds for the server to respond. |

Raises

| Exception | Description |
| --- | --- |
| datarobot.errors.ClientError | if the server responded with 4xx status. |
| datarobot.errors.ServerError | if the server responded with 5xx status. |

### ClassListMode

Calculate prediction explanations for the specified classes in each row.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| class_names | list | List of class names that will be explained for each dataset row. |

#### get_api_parameters()

Get parameters passed in corresponding API call

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| batch_route | bool | Batch routes describe prediction calls with all possible parameters, so to distinguish explanation parameters from others they have prefix in parameters. |

Return type: `dict`

### TopPredictionsMode

Calculate prediction explanations for the number of top predicted classes in each row.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| num_top_classes | int | Number of top predicted classes [1..10] that will be explained for each dataset row. |

#### get_api_parameters()

Get parameters passed in corresponding API call

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| batch_route | bool | Batch routes describe prediction calls with all possible parameters, so to distinguish explanation parameters from others they have prefix in parameters. |

Return type: `dict`

## Rating table

### RatingTable

Interface to modify and download rating tables.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| id | str | The id of the rating table. |
| project_id | str | The id of the project this rating table belongs to. |
| rating_table_name | str | The name of the rating table. |
| original_filename | str | The name of the file used to create the rating table. |
| parent_model_id | str | The model id of the model the rating table was validated against. |
| model_id | str | The model id of the model that was created from the rating table. Can be None if a model has not been created from the rating table. |
| model_job_id | str | The id of the job to create a model from this rating table. Can be None if a model has not been created from the rating table. |
| validation_job_id | str | The id of the created job to validate the rating table. Can be None if the rating table has not been validated. |
| validation_error | str | Contains a description of any errors caused during validation. |

#### from_server_data()

Instantiate an object of this class using the data directly from the server,
meaning that the keys may have the wrong camel casing

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | The directly translated dict of JSON from the server. No casing fixes have taken place |
| should_warn | bool | Whether or not to issue a warning if an invalid rating table is being retrieved. |

Return type: [RatingTable](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RatingTable)

#### get()

Retrieve a single rating table

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | The ID of the project the rating table is associated with. |
| rating_table_id | str | The ID of the rating table |

Returns

| Returns | Description |
| --- | --- |
| rating_table | The queried instance |

Return type: [RatingTable](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.RatingTable)

#### create()

Uploads and validates a new rating table CSV

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| project_id | str | id of the project the rating table belongs to |
| parent_model_id | str | id of the model for which this rating table should be validated against |
| filename | str | The path of the CSV file containing the modified rating table. |
| rating_table_name | Optional[str] | A human friendly name for the new rating table. The string may be truncated and a suffix may be added to maintain unique names of all rating tables. |

Returns

| Returns | Description |
| --- | --- |
| job | an instance of created async job |

Return type: [Job](https://docs.datarobot.com/ja/docs/api/reference/sdk/jobs.html.md#datarobot.models.Job)

Raises

| Exception | Description |
| --- | --- |
| InputNotUnderstoodError | Raised if filename isn’t one of supported types. |
| ClientError | Raised if parent_model_id is invalid. |

#### download()

Download a csv file containing the contents of this rating table

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| filepath | str | The path at which to save the rating table file. |

Return type: `None`

#### rename()

Renames a rating table to a different name.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| rating_table_name | str | The new name to rename the rating table to. |

Return type: `None`

#### create_model()

Creates a new model from this rating table record. This rating table
must not already be associated with a model and must be valid.

Returns

| Returns | Description |
| --- | --- |
| job | an instance of created async job |

Return type: [Job](https://docs.datarobot.com/ja/docs/api/reference/sdk/jobs.html.md#datarobot.models.Job)

Raises

| Exception | Description |
| --- | --- |
| ClientError | Raised if creating model from a RatingTable that failed validation |
| JobAlreadyRequested | Raised if creating model from a RatingTable that is already associated with a RatingTableModel |

## ROC curve (legacy)

#### NOTE

The ROC curve class below is from the legacy API. For new code, use [RocCurve](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.insights.RocCurve) documented above, which provides `compute()`, `get()`, `list()`, and `create()` methods.

### RocCurve

ROC curve data for model.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| source | str | ROC curve data source. Can be ‘validation’, ‘crossValidation’ or ‘holdout’. |
| roc_points | list of dict | List of precalculated metrics associated with thresholds for ROC curve. |
| negative_class_predictions | list of float | List of predictions from example for negative class |
| positive_class_predictions | list of float | List of predictions from example for positive class |
| source_model_id | str | ID of the model this ROC curve represents; in some cases, insights from the parent of a frozen model may be used |
| data_slice_id | str | ID of the data slice this ROC curve represents. |

#### from_server_data()

Overwrite APIObject.from_server_data to handle roc curve data retrieved
from either legacy URL or /insights/ new URL.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| data | dict | The directly translated dict of JSON from the server. No casing fixes have taken place. |
| keep_attrs | iterable | List, set or tuple of the dotted namespace notations for attributes to keep within the object structure even if their values are None |
| use_insights_format | Optional[bool] | Whether to repack the data from the format used in the GET /insights/RocCur/ URL to the format used in the legacy URL. |

Return type: [RocCurve](https://docs.datarobot.com/ja/docs/api/reference/sdk/insights.html.md#datarobot.models.roc_curve.RocCurve)

### LabelwiseRocCurve

Labelwise ROC curve data for one label and one source.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| source | str | ROC curve data source. Can be ‘validation’, ‘crossValidation’ or ‘holdout’. |
| roc_points | list of dict | List of precalculated metrics associated with thresholds for ROC curve. |
| negative_class_predictions | list of float | List of predictions from example for negative class |
| positive_class_predictions | list of float | List of predictions from example for positive class |
| source_model_id | str | ID of the model this ROC curve represents; in some cases, insights from the parent of a frozen model may be used |
| label | str | Label name for |
| kolmogorov_smirnov_metric | float | Kolmogorov-Smirnov metric value for label |
| auc | float | AUC metric value for label |

## Word Cloud

### WordCloud

Word cloud data for the model.

> [!NOTE] Notes
> `WordCloudNgram` is a dict containing the following:
> 
> ngram
> (str) Word or ngram value.
> coefficient
> (float) Value from [-1.0, 1.0] range, describes effect of this ngram on           the target. Large negative value means strong effect toward negative class in           classification and smaller target value in regression models. Large positive - toward           positive class and bigger value respectively.
> count
> (int) Number of rows in the training sample where this ngram appears.
> frequency
> (float) Value from (0.0, 1.0] range, relative frequency of given ngram to           most frequent ngram.
> is_stopword
> (bool) True for ngrams that DataRobot evaluates as stopwords.
> class
> (str or None) For classification - values of the target class for
>   corresponding word or ngram. For regression - None.

Variables

| Attribute | Type | Description |
| --- | --- | --- |
| ngrams | list of dict | List of dicts with schema described as WordCloudNgram above. |

#### most_frequent()

Return most frequent ngrams in the word cloud.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| top_n | int | Number of ngrams to return |

Returns

| Returns | Description |
| --- | --- |
| Up to top_n top most frequent ngrams in the word cloud. |  |
| If top_n bigger then total number of ngrams in word cloud - return all sorted by |  |
| frequency in descending order. |  |

Return type: `list` of `dict`

#### most_important()

Return most important ngrams in the word cloud.

Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| top_n | int | Number of ngrams to return |

Returns

| Returns | Description |
| --- | --- |
| Up to top_n top most important ngrams in the word cloud. |  |
| If top_n bigger then total number of ngrams in word cloud - return all sorted by |  |
| absolute coefficient value in descending order. |  |

Return type: `list` of `dict`

#### ngrams_per_class()

Split ngrams per target class values. Useful for multiclass models.

Returns

| Returns | Description |
| --- | --- |
| Dictionary in the format of (class label) -> (list of ngrams for that class) |  |

Return type: `dict`

### WordCloudNgram
