Confusion chart

class datarobot.models.confusion_chart.ConfusionChart

Bases: APIObject

Confusion Chart data for model.

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:
  • 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

ConfusionChartWrapper = <Dict(<Key "data" <Dict(<Key "class_metrics" <List(<Dict(<Key "actual_count" <ToInt>>, <Key "class_name" <String>>, <Key "confusion_matrix_one_vs_all" <List(<List(<ToInt>)>)>>, <Key "f1" <Float(gte=0, lte=1)>>, <Key "precision" <Float(gte=0, lte=1)>>, <Key "predicted_count" <ToInt>>, <Key "recall" <Float(gte=0, lte=1)>>, <Key "was_actual_percentages" <List(<Dict(<Key "other_class_name" <String>>, <Key "percentage" <Float(gte=0, lte=1)>>)>)>>, <Key "was_predicted_percentages" <List(<Dict(<Key "other_class_name" <String>>, <Key "percentage" <Float(gte=0, lte=1)>>)>)>>)>)>>, <Key "classes" <List(<String>)>>, <Key "confusion_matrix" <List(<List(<ToInt>)>)>>)>>, <Key "source" <String>>, <Key "source_model_id" <String>>)>