|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulg.montefiore.run.jahmm.KMeansCalculator<K>
public class KMeansCalculator<K extends CentroidFactory<? super K>>
This class can be used to divide a set of elements in clusters using the k-means algorithm.
The algorithm used is just the plain old k-means algorithm as explained in Clustering and the Continuous k-Means Algorithm (Vance Faber, Los Alamos Science number 22).
In order to get the theoretical complexity, the list of elements to be clustered must be accessible in O(1).
Constructor Summary | |
---|---|
KMeansCalculator(int k,
java.util.List<? extends K> elements)
This class divides a set of elements in a given number of clusters. |
Method Summary | |
---|---|
java.util.Collection<K> |
cluster(int index)
Returns the elements of one of the clusters. |
int |
nbClusters()
Returns the number of clusters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KMeansCalculator(int k, java.util.List<? extends K> elements)
k
- The number of clusters to get.elements
- The elements to divide in clusters.Method Detail |
---|
public java.util.Collection<K> cluster(int index)
index
- The cluster index of the cluster your are interested in (the
first cluster has the index 0, while the last has the index
given by nbClusters
- 1
.
public int nbClusters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |