Package elki.clustering.kmeans
Class KMediansLloyd.Instance
- java.lang.Object
-
- elki.clustering.kmeans.AbstractKMeans.Instance
-
- elki.clustering.kmeans.KMediansLloyd.Instance
-
- Enclosing class:
- KMediansLloyd<V extends NumberVector>
protected static class KMediansLloyd.Instance extends AbstractKMeans.Instance
Inner instance, storing state for a single data set.- Author:
- Erich Schubert
-
-
Field Summary
-
Fields inherited from class elki.clustering.kmeans.AbstractKMeans.Instance
assignment, clusters, diststat, isSquared, k, key, means, relation, varsum
-
-
Constructor Summary
Constructors Constructor Description Instance(Relation<? extends NumberVector> relation, NumberVectorDistance<?> df, double[][] means)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Clustering<MeanModel>
buildMediansResult()
protected Logging
getLogger()
Get the class logger.protected int
iterate(int iteration)
Main loop function.protected double[][]
medians(java.util.List<? extends DBIDs> clusters, double[][] medians, Relation<? extends NumberVector> relation)
Returns the median vectors of the given clusters in the given database.-
Methods inherited from class elki.clustering.kmeans.AbstractKMeans.Instance
assignToNearestCluster, buildResult, buildResult, computeSquaredSeparation, copyMeans, distance, distance, distance, initialSeperation, meansFromSums, movedDistance, recomputeSeperation, recomputeVariance, run, sqrtdistance, sqrtdistance, sqrtdistance
-
-
-
-
Constructor Detail
-
Instance
public Instance(Relation<? extends NumberVector> relation, NumberVectorDistance<?> df, double[][] means)
Constructor.- Parameters:
relation
- Relationmeans
- Initial means
-
-
Method Detail
-
iterate
protected int iterate(int iteration)
Description copied from class:AbstractKMeans.Instance
Main loop function.- Specified by:
iterate
in classAbstractKMeans.Instance
- Parameters:
iteration
- Iteration number (beginning at 1)- Returns:
- Number of reassigned points
-
buildMediansResult
protected Clustering<MeanModel> buildMediansResult()
-
medians
protected double[][] medians(java.util.List<? extends DBIDs> clusters, double[][] medians, Relation<? extends NumberVector> relation)
Returns the median vectors of the given clusters in the given database.- Parameters:
clusters
- the clusters to compute the meansmedians
- the recent mediansrelation
- the relation containing the vectors- Returns:
- the mean vectors of the given clusters in the given database
-
getLogger
protected Logging getLogger()
Description copied from class:AbstractKMeans.Instance
Get the class logger.- Specified by:
getLogger
in classAbstractKMeans.Instance
- Returns:
- Logger
-
-