Skip to content

Commit

Permalink
Performance improvement in function classify_kmeans
Browse files Browse the repository at this point in the history
  • Loading branch information
alesantuz committed Jan 5, 2024
1 parent 2167103 commit 7eae481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/classify_kmeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ classify_kmeans <- function(x,
)
}

withinss <- unlist(lapply(kmeans_all, function(y) sum(y$withinss)))
withinss <- vapply(kmeans_all, function(y) sum(y$withinss), FUN.VALUE = numeric(1))
withinss <- withinss - min(withinss)
withinss <- withinss / max(withinss)

Expand Down

0 comments on commit 7eae481

Please sign in to comment.