V
- vector type to useD
- distance function value type@Title(value="K-Means") @Description(value="Finds a partitioning into k clusters.") @Reference(authors="J. MacQueen", title="Some Methods for Classification and Analysis of Multivariate Observations", booktitle="5th Berkeley Symp. Math. Statist. Prob., Vol. 1, 1967, pp 281-297", url="http://projecteuclid.org/euclid.bsmsp/1200512992") public class KMeansMacQueen<V extends NumberVector<?>,D extends Distance<D>> extends AbstractKMeans<V,D,KMeansModel<V>>
Reference:
J. MacQueen: Some Methods for Classification and Analysis of Multivariate
Observations.
In 5th Berkeley Symp. Math. Statist. Prob., Vol. 1, 1967, pp 281-297.
Modifier and Type | Class and Description |
---|---|
static class |
KMeansMacQueen.Parameterizer<V extends NumberVector<?>,D extends Distance<D>>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private static Logging |
LOG
The logger for this class.
|
initializer, k, maxiter
INIT_ID, K_ID, MAXITER_ID, SEED_ID
Constructor and Description |
---|
KMeansMacQueen(PrimitiveDistanceFunction<NumberVector<?>,D> distanceFunction,
int k,
int maxiter,
KMeansInitialization<V> initializer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
Clustering<KMeansModel<V>> |
run(Database database,
Relation<V> relation)
Run k-means.
|
assignToNearestCluster, getInputTypeRestriction, incrementalUpdateMean, macQueenIterate, means, medians
getDistanceFunction
makeParameterDistanceFunction, run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private static final Logging LOG
public KMeansMacQueen(PrimitiveDistanceFunction<NumberVector<?>,D> distanceFunction, int k, int maxiter, KMeansInitialization<V> initializer)
distanceFunction
- distance functionk
- k parametermaxiter
- Maxiter parameterinitializer
- Initialization methodpublic Clustering<KMeansModel<V>> run(Database database, Relation<V> relation)
database
- Databaserelation
- relation to useprotected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<Clustering<KMeansModel<V extends NumberVector<?>>>>