tumourkit.segmentation.evaluate.get_confusion_matrix
- tumourkit.segmentation.evaluate.get_confusion_matrix(gt_centroids: List[Tuple[int, int, int]], pred_centroids: List[Tuple[int, int, int]]) ndarray
Calculates the confusion matrix based on the ground truth and predicted centroids.
Each centroid is represented by a 3-tuple with (X, Y, class). The confusion matrix has (N+1)x(N+1) entries, where N is the maximum value encountered for the class. There is one additional entry for the background class when no match is found.
- Parameters:
gt_centroids (List[Tuple[int, int, int]]) – The ground truth centroids represented as a list of 3-tuples (X, Y, class).
pred_centroids (List[Tuple[int, int, int]]) – The predicted centroids represented as a list of 3-tuples (X, Y, class).
- Returns:
The confusion matrix.
- Return type:
np.ndarray