public final class KMeansClustering extends Object
| Constructor and Description |
|---|
KMeansClustering(int k,
de.jungblut.math.DoubleVector[] vectors,
boolean random)
Initializes a new
KMeansClustering. |
KMeansClustering(int k,
List<de.jungblut.math.DoubleVector> vectors,
boolean random)
Initializes a new
KMeansClustering. |
KMeansClustering(List<de.jungblut.math.DoubleVector> centers,
List<de.jungblut.math.DoubleVector> vectors)
Initializes a new
KMeansClustering. |
| Modifier and Type | Method and Description |
|---|---|
List<Cluster> |
cluster(int iterations,
DistanceMeasurer distanceMeasurer,
double delta,
boolean verbose)
Starts the clustering process.
|
de.jungblut.math.DoubleVector[] |
getCenters() |
double |
getClusteringCost() |
public KMeansClustering(int k,
de.jungblut.math.DoubleVector[] vectors,
boolean random)
KMeansClustering.k - the number of centers to use.vectors - the vectors to cluster.random - true if use random initialization, else it will just pick the
first k vectors.public KMeansClustering(int k,
List<de.jungblut.math.DoubleVector> vectors,
boolean random)
KMeansClustering.k - the number of centers to use.vectors - the vectors to cluster.random - true if use random initialization, else it will just pick the
first k vectors.public KMeansClustering(List<de.jungblut.math.DoubleVector> centers, List<de.jungblut.math.DoubleVector> vectors)
KMeansClustering.centers - initial centers, maybe seeded from CanopyClustering.vectors - the vectors to cluster.public List<Cluster> cluster(int iterations, DistanceMeasurer distanceMeasurer, double delta, boolean verbose)
iterations - the iterations to cluster.distanceMeasurer - the distance measurement to use.delta - is the change in the sum of distances over iterations. If the
difference is lower than delta the iteration will stop.if - true, costs in each iteration will be printed.public double getClusteringCost()
public de.jungblut.math.DoubleVector[] getCenters()
Copyright © 2016. All rights reserved.