V
- Vector typeM
- Model typepublic class BestOfMultipleKMeans<V extends NumberVector,M extends MeanModel> extends AbstractAlgorithm<Clustering<M>> implements KMeans<V,M>
Modifier and Type | Class and Description |
---|---|
static class |
BestOfMultipleKMeans.Parameterizer<V extends NumberVector,M extends MeanModel>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private KMeans<V,M> |
innerkMeans
Variant of kMeans for the bisecting step.
|
private static Logging |
LOG
The logger for this class.
|
private KMeansQualityMeasure<? super V> |
qualityMeasure
Quality measure which should be used.
|
private int |
trials
Number of trials to do.
|
ALGORITHM_ID
INIT_ID, K_ID, MAXITER_ID, SEED_ID, VARSTAT_ID
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
BestOfMultipleKMeans(int trials,
KMeans<V,M> innerkMeans,
KMeansQualityMeasure<? super V> qualityMeasure)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
DistanceFunction<? super V> |
getDistanceFunction()
Returns the distanceFunction.
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
Clustering<M> |
run(Database database,
Relation<V> relation)
Run the clustering algorithm.
|
void |
setDistanceFunction(NumberVectorDistanceFunction<? super V> distanceFunction)
Set the distance function to use.
|
void |
setInitializer(KMeansInitialization init)
Set the initialization method.
|
void |
setK(int k)
Set the value of k.
|
run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private static final Logging LOG
private int trials
private KMeans<V extends NumberVector,M extends MeanModel> innerkMeans
private KMeansQualityMeasure<? super V extends NumberVector> qualityMeasure
public BestOfMultipleKMeans(int trials, KMeans<V,M> innerkMeans, KMeansQualityMeasure<? super V> qualityMeasure)
trials
- Number of trials to do.innerkMeans
- K-Means variant to actually use.qualityMeasure
- Quality measurepublic Clustering<M> run(Database database, Relation<V> relation)
KMeans
public TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<Clustering<M extends MeanModel>>
public DistanceFunction<? super V> getDistanceFunction()
DistanceBasedAlgorithm
getDistanceFunction
in interface DistanceBasedAlgorithm<V extends NumberVector>
public void setK(int k)
KMeans
public void setDistanceFunction(NumberVectorDistanceFunction<? super V> distanceFunction)
KMeans
setDistanceFunction
in interface KMeans<V extends NumberVector,M extends MeanModel>
distanceFunction
- Distance function.public void setInitializer(KMeansInitialization init)
KMeans
setInitializer
in interface KMeans<V extends NumberVector,M extends MeanModel>
init
- Initialization methodprotected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<Clustering<M extends MeanModel>>
Copyright © 2019 ELKI Development Team. License information.