Package elki.clustering.kmeans
Class AbstractKMeans.Par<V extends NumberVector>
- java.lang.Object
-
- elki.clustering.kmeans.AbstractKMeans.Par<V>
-
- All Implemented Interfaces:
Parameterizer
- Direct Known Subclasses:
BetulaLloydKMeans.Par
,CompareMeans.Par
,GMeans.Par
,HamerlyKMeans.Par
,HartiganWongKMeans.Parameterizer
,KDTreePruningKMeans.Par
,KMeansMinusMinus.Par
,KMediansLloyd.Par
,LloydKMeans.Par
,MacQueenKMeans.Par
,SimplifiedElkanKMeans.Par
,SingleAssignmentKMeans.Par
,SortMeans.Par
,SphericalKMeans.Par
,YinYangKMeans.Par
- Enclosing class:
- AbstractKMeans<V extends NumberVector,M extends Model>
public abstract static class AbstractKMeans.Par<V extends NumberVector> extends java.lang.Object implements Parameterizer
Parameterization class.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected NumberVectorDistance<? super V>
distance
The distance function to use.protected KMeansInitialization
initializer
Initialization method.protected int
k
k Parameter.protected int
maxiter
Maximum number of iterations.protected boolean
varstat
Compute the final variance statistic (not used by all).
-
Constructor Summary
Constructors Constructor Description Par()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
configure(Parameterization config)
Configure the class.protected void
getParameterDistance(Parameterization config)
Get the distance function parameter.protected void
getParameterInitialization(Parameterization config)
Get the initialization method parameter.protected void
getParameterK(Parameterization config)
Get the k parameter.protected void
getParameterMaxIter(Parameterization config)
Get the max iterations parameter.protected void
getParameterVarstat(Parameterization config)
Get the variance statistics parameter.abstract AbstractKMeans<V,?>
make()
Make an instance after successful configuration.protected boolean
needsMetric()
Users could use other non-metric distances at their own risk; but some k-means variants make explicit use of the triangle inequality, we emit extra warnings then.
-
-
-
Field Detail
-
k
protected int k
k Parameter.
-
maxiter
protected int maxiter
Maximum number of iterations.
-
initializer
protected KMeansInitialization initializer
Initialization method.
-
varstat
protected boolean varstat
Compute the final variance statistic (not used by all).
-
distance
protected NumberVectorDistance<? super V extends NumberVector> distance
The distance function to use.
-
-
Method Detail
-
configure
public void configure(Parameterization config)
Description copied from interface:Parameterizer
Configure the class.Note: the status is collected by the parameterization object, so that multiple errors may arise and be reported in one run.
- Specified by:
configure
in interfaceParameterizer
- Parameters:
config
- Parameterization
-
getParameterK
protected void getParameterK(Parameterization config)
Get the k parameter.- Parameters:
config
- Parameterization
-
getParameterDistance
protected void getParameterDistance(Parameterization config)
Get the distance function parameter.- Parameters:
config
- Parameterization
-
needsMetric
protected boolean needsMetric()
Users could use other non-metric distances at their own risk; but some k-means variants make explicit use of the triangle inequality, we emit extra warnings then.- Returns:
true
if the algorithm uses triangle inequality
-
getParameterInitialization
protected void getParameterInitialization(Parameterization config)
Get the initialization method parameter.- Parameters:
config
- Parameterization
-
getParameterMaxIter
protected void getParameterMaxIter(Parameterization config)
Get the max iterations parameter.- Parameters:
config
- Parameterization
-
getParameterVarstat
protected void getParameterVarstat(Parameterization config)
Get the variance statistics parameter.- Parameters:
config
- Parameterization
-
make
public abstract AbstractKMeans<V,?> make()
Description copied from interface:Parameterizer
Make an instance after successful configuration.Note: your class should return the exact type, only this very broad interface should use
Object
as return type.- Specified by:
make
in interfaceParameterizer
- Returns:
- a new instance
-
-