fatf.utils.metrics.tools.validate_confusion_matrix_size

fatf.utils.metrics.tools.validate_confusion_matrix_size(confusion_matrix, size)[source]

Validates the exact shape of the confusion matrix.

Parameters
confusion_matrixnumpy.ndarray

A confusion matrix to be validated.

sizeinteger, optional (default=None)

The expected width and height of the confusion matrix.

Returns
is_validboolean

True if the confusion matrix size is valid, False otherwise.

Raises
IncorrectShapeError

If the confusion matrix is not of a given size (height and width).