Skip to content

Commit

Permalink
error if less than 2 samples in map class
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfrantz committed Feb 12, 2024
1 parent 134c418 commit 323a2b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rstats/force-map-accuracy.r
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ for (m in 1:n_classes){
}
}

if (any(rowSums(confusion_counts) < 2)) {
exit_with_error("at least one map class has less than two samples")
}


acc_metrics <- function(confusion_matrix) {

Expand Down

0 comments on commit 323a2b6

Please sign in to comment.