V
- Vector typeD
- Distance typepublic class FarthestPointsInitialMeans<V,D extends NumberDistance<D,?>> extends AbstractKMeansInitialization<V> implements KMedoidsInitialization<V>
Modifier and Type | Class and Description |
---|---|
static class |
FarthestPointsInitialMeans.Parameterizer<V,D extends NumberDistance<D,?>>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
dropfirst
Discard the first vector.
|
rnd
Constructor and Description |
---|
FarthestPointsInitialMeans(RandomFactory rnd,
boolean dropfirst)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
List<V> |
chooseInitialMeans(Database database,
Relation<V> relation,
int k,
PrimitiveDistanceFunction<? super NumberVector<?>,?> distanceFunction)
Choose initial means
|
DBIDs |
chooseInitialMedoids(int k,
DistanceQuery<? super V,?> distQ2)
Choose initial means
|
public FarthestPointsInitialMeans(RandomFactory rnd, boolean dropfirst)
rnd
- Random generator.dropfirst
- Flag to discard the first vector.public List<V> chooseInitialMeans(Database database, Relation<V> relation, int k, PrimitiveDistanceFunction<? super NumberVector<?>,?> distanceFunction)
KMeansInitialization
chooseInitialMeans
in interface KMeansInitialization<V>
database
- Database contextrelation
- Relationk
- Parameter kdistanceFunction
- Distance functionpublic DBIDs chooseInitialMedoids(int k, DistanceQuery<? super V,?> distQ2)
KMedoidsInitialization
chooseInitialMedoids
in interface KMedoidsInitialization<V>
k
- Parameter kdistQ2
- Distance function