fatf.utils.metrics.metrics.multiclass_treatment

fatf.utils.metrics.metrics.multiclass_treatment(confusion_matrix: numpy.ndarray, label_index: int) → float[source]

Computes the “treatment” metric for a multi-class confusion matrix.

A “treatment” is the proportion of all the predictions of a selected class that are incorrect to all incorrectly predicted instances.

See the documentation of fatf.utils.metrics.tools.validate_confusion_matrix for all the possible errors and exceptions.

Parameters
confusion_matrixnumpy.ndarray

A confusion matrix based on which the metric will be computed.

label_indexinteger

The index of a label that should be treated as “positive”. All the other labels will be treated as “negative”.

Returns
metricnumber

The “treatment” measurement.