Table of Contents
ConfusionMatrix Objects
class ConfusionMatrix()
Confusion Matrix Class to hold labels and matrix data.
Attributes:
labels
- list of labels in a sorted orderprediction_field
- name of the prediction fieldtarget_field
- name of the target fieldscore_field
- name of the score fieldconfusion_matrix
nd.array - Confusion Matrix kept as matrix of NumberTrackerslabels
List[str] - list of labels for the confusion_matrix axes
add
| add(predictions: List[Union[str, int, bool]], targets: List[Union[str, int, bool]], scores: List[float])
Function adds predictions and targets to confusion matrix with scores.
Arguments:
predictions (List[Union[str, int, bool]]): targets (List[Union[str, int, bool]]): scores (List[float]):
Raises:
NotImplementedError
- in case targets do not fall into binary or multiclass suportValueError
- incase missing validation or predictions
merge
| merge(other_cm)
Merge two seperate confusion matrix which may or may not overlap in labels.
Arguments:
other_cm
Optional[ConfusionMatrix] - confusion_matrix to merge with self
Returns:
ConfusionMatrix
- merged confusion_matrix
to_protobuf
| to_protobuf()
Convert to protobuf
Returns:
TYPE
- Description