lazyslide.metrics.segmentation.accuracy

Contents

lazyslide.metrics.segmentation.accuracy#

accuracy(stats)#

Compute accuracy from segmentation statistics.

Accuracy is the proportion of correctly classified instances (both positive and negative) out of the total instances.

Parameters:
statsSegmentationStats

Segmentation statistics containing true positives (tp), false positives (fp), false negatives (fn), and true negatives (tn).

Returns:
float

Accuracy score in the range [0, 1], where 1 is perfect accuracy. Returns 0.0 if the denominator is zero.

Notes

Accuracy = (TP + TN) / (TP + FP + FN + TN)