[mlpack-git] [mlpack] Mean shift clustering (#388)
Ryan Curtin
notifications at github.com
Mon Jan 26 21:47:05 EST 2015
> +
> + }
> +
> + newCentroid /= sumWeight;
> +
> + completedIterations ++;
> +
> + // calc the mean shift vector.
> + arma::Col<double> mhVector = newCentroid - allCentroids.col(i);
> +
> + // update the centroid.
> + allCentroids.col(i) = newCentroid;
> +
> + if (arma::norm(mhVector, 2) < stopThresh ||
> + completedIterations > maxIterations) {
> + break;
This loop can be cleaner as a for loop instead of a `while(true)` where you manage `completedIterations` by hand.
---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/388/files#r23583975
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150126/ce57b30e/attachment.html>
More information about the mlpack-git
mailing list