Example usage for org.apache.commons.math3.ml.clustering Clusterer cluster

List of usage examples for org.apache.commons.math3.ml.clustering Clusterer cluster

Introduction

In this page you can find the example usage for org.apache.commons.math3.ml.clustering Clusterer cluster.

Prototype

public abstract List<? extends Cluster<T>> cluster(Collection<T> points)
        throws MathIllegalArgumentException, ConvergenceException;

Source Link

Document

Perform a cluster analysis on the given set of Clusterable instances.

Usage

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;
}