Skip to content

Commit 988ebf5

Browse files
authored
Fix MG kmeans intertia_check n_iters (#2020)
We should only check the intertia_check convergence on n_iters > 1 (on the second iteration). Otherwise we don't have a previous iteration to compare against. The SG path is already like this. MG n_iters > 0 (bug) SG n_iters > 1 Authors: - Anupam (https://github.com/aamijar) Approvers: - Tarang Jain (https://github.com/tarang-jain) URL: #2020
1 parent c95625b commit 988ebf5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cpp/src/cluster/detail/kmeans_mg.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ void fit(const raft::resources& handle,
738738
"Too few points and centroids being found is getting 0 cost from "
739739
"centers\n");
740740

741-
if (n_iter[0] > 0) {
741+
if (n_iter[0] > 1) {
742742
DataT delta = curClusteringCost / priorClusteringCost;
743743
if (delta > 1 - params.tol) done = true;
744744
}

0 commit comments

Comments
 (0)