fatf.utils.metrics.metrics.accuracy

fatf.utils.metrics.metrics.accuracy(confusion_matrix: numpy.ndarray) → float[source]

Computes the accuracy for an arbitrary confusion matrix.

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.

Returns
metricnumber

The accuracy.