adde Javadoc to KMeansClusterer

This commit is contained in:
Axel Uhl committed 2015-01-22 12:33:06 +01:00
1 parent 67b04fc778
commit e3f165f866
2 files changed
+9

No files matched your search

@@ -69,6 +69,10 @@ public class Cluster<E, ValueType, AveragesTo, T extends ScalableValueWithDistan
}
}
/**
* Determines the {@link ScalableValueWithDistance#getDistance(Object) distance} of the element <code>e</code> to
* this cluster's {@link #mean} value.
*/
public double getDistanceFromMean(final E e) {
return mapper.apply(e).getDistance(mean);
}
@@ -131,6 +131,11 @@ public class KMeansMappingClusterer<E, ValueType, AveragesTo, T extends Scalable
}
}
/**
* Computes the next iteration by creating new clusters that use as their mean the centroids of the
* current clusters; then, assigns all elements to these clusters and repeats this process until
* the latest iteration produces the same clustering that the previous iteration produced.
*/
private void iterate(Iterable<E> elements) {
List<Cluster<E, ValueType, AveragesTo, T>> oldClusters;
do {