External scores and insights
- class datarobot.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:
project_id (
str
) – id of the project the model belongs tomodel_id (
str
) – id of the modeldataset_id (
str
) – id of the prediction dataset with target or actual value column for unsupervised caseactual_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
ofdicts in a form
of{'label': metric_name, 'value': score}
) – Scores on the dataset.
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)
- classmethod create(project_id, model_id, dataset_id, actual_value_column=None)
Compute an external dataset insights for the specified model.
- Parameters:
project_id (
str
) – id of the project the model belongs tomodel_id (
str
) – id of the model for which insights is requesteddataset_id (
str
) – id of the dataset for which insights is requestedactual_value_column (
Optional[str]
) – actual values column label, for unsupervised projects only
- Returns:
job – an instance of created async job
- Return type:
Job
- classmethod list(project_id, model_id=None, dataset_id=None, offset=0, limit=100)
Fetch external scores list for the project and optionally for model and dataset.
- Parameters:
project_id (
str
) – id of the projectmodel_id (
Optional[str]
) – if specified, only scores for this model will be retrieveddataset_id (
Optional[str]
) – if specified, only scores for this dataset will be retrievedoffset (
Optional[int]
) – this many results will be skipped, default: 0limit (
Optional[int]
) – at most this many results are returned, default: 100, max 1000. To return all results, specify 0
- Return type:
List
[ExternalScores
]- Returns:
A list of
External Scores
objects
- classmethod get(project_id, model_id, dataset_id)
Retrieve external scores for the project, model and dataset.
- Parameters:
project_id (
str
) – id of the projectmodel_id (
str
) – if specified, only scores for this model will be retrieveddataset_id (
str
) – if specified, only scores for this dataset will be retrieved
- Return type:
- Returns:
External Scores
object
- class datarobot.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:
dataset_id (
str
) – id of the prediction dataset with target or actual value column for unsupervised casebins (
list
ofdict
) – List of dicts with schema described asLiftChartBin
above.
- classmethod list(project_id, model_id, dataset_id=None, offset=0, limit=100)
Retrieve list of the lift charts for the model.
- Parameters:
project_id (
str
) – id of the projectmodel_id (
str
) – if specified, only lift chart for this model will be retrieveddataset_id (
Optional[str]
) – if specified, only lift chart for this dataset will be retrievedoffset (
Optional[int]
) – this many results will be skipped, default: 0limit (
Optional[int]
) – at most this many results are returned, default: 100, max 1000. To return all results, specify 0
- Return type:
List
[ExternalLiftChart
]- Returns:
A list of
ExternalLiftChart
objects
- classmethod get(project_id, model_id, dataset_id)
Retrieve lift chart for the model and prediction dataset.
- Parameters:
project_id (
str
) – project idmodel_id (
str
) – model iddataset_id (
str
) – prediction dataset id with target or actual value column for unsupervised case
- Return type:
- Returns:
ExternalLiftChart
object
- class datarobot.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:
dataset_id (
str
) – id of the prediction dataset with target or actual value column for unsupervised caseroc_points (
list
ofdict
) – List of precalculated metrics associated with thresholds for ROC curve.negative_class_predictions (
list
offloat
) – List of predictions from example for negative classpositive_class_predictions (
list
offloat
) – List of predictions from example for positive class
- classmethod list(project_id, model_id, dataset_id=None, offset=0, limit=100)
Retrieve list of the roc curves for the model.
- Parameters:
project_id (
str
) – id of the projectmodel_id (
str
) – if specified, only lift chart for this model will be retrieveddataset_id (
Optional[str]
) – if specified, only lift chart for this dataset will be retrievedoffset (
Optional[int]
) – this many results will be skipped, default: 0limit (
Optional[int]
) – at most this many results are returned, default: 100, max 1000. To return all results, specify 0
- Return type:
List
[ExternalRocCurve
]- Returns:
A list of
ExternalRocCurve
objects
- classmethod get(project_id, model_id, dataset_id)
Retrieve ROC curve chart for the model and prediction dataset.
- Parameters:
project_id (
str
) – project idmodel_id (
str
) – model iddataset_id (
str
) – prediction dataset id with target or actual value column for unsupervised case
- Return type:
- Returns:
ExternalRocCurve
object