V
- Number vector typeD
- Distance typeM
- Actual model typepublic interface KMeans<V extends NumberVector<?>,D extends Distance<?>,M extends MeanModel<V>> extends ClusteringAlgorithm<Clustering<M>>, DistanceBasedAlgorithm<V,D>
Modifier and Type | Field and Description |
---|---|
static OptionID |
INIT_ID
Parameter to specify the initialization method
|
static OptionID |
K_ID
Parameter to specify the number of clusters to find, must be an integer
greater than 0.
|
static OptionID |
MAXITER_ID
Parameter to specify the number of clusters to find, must be an integer
greater or equal to 0, where 0 means no limit.
|
static OptionID |
SEED_ID
Parameter to specify the random generator seed.
|
DISTANCE_FUNCTION_ID
Modifier and Type | Method and Description |
---|---|
Clustering<M> |
run(Database database,
Relation<V> rel)
Run the clustering algorithm.
|
void |
setDistanceFunction(PrimitiveDistanceFunction<? super NumberVector<?>,D> distanceFunction)
Set the distance function to use.
|
void |
setK(int k)
Set the value of k.
|
run
getDistanceFunction
getInputTypeRestriction
static final OptionID INIT_ID
static final OptionID K_ID
static final OptionID MAXITER_ID
static final OptionID SEED_ID
Clustering<M> run(Database database, Relation<V> rel)
database
- Database to run on.rel
- Relation to process.void setK(int k)
k
- K parametervoid setDistanceFunction(PrimitiveDistanceFunction<? super NumberVector<?>,D> distanceFunction)
distanceFunction
- Distance function.