List of usage examples for org.apache.commons.math3.ml.clustering Clusterer cluster
public abstract List<? extends Cluster<T>> cluster(Collection<T> points) throws MathIllegalArgumentException, ConvergenceException;
From source file:edu.cmu.sv.modelinference.eventtool.classification.Clusterer1D.java
private List<? extends Cluster<DataWrapper>> computeClusters(Collection<DataWrapper> dataCol, int k) { List<? extends Cluster<DataWrapper>> clusterResults = null; try {/* ww w . ja v a 2 s . c o m*/ Clusterer<DataWrapper> clusterer = new MultiKMeansPlusPlusClusterer<>( new KMeansPlusPlusClusterer<DataWrapper>(k, maxIterations), trials); clusterResults = clusterer.cluster(dataCol); } catch (NumberIsTooSmallException e) { logger.warn("Too few datapoints for clusters: " + e.getMessage()); } return clusterResults; }