Class GreedyG<O>
- java.lang.Object
-
- elki.clustering.kmedoids.initialization.GreedyG<O>
-
- Type Parameters:
O
- Object type for KMedoids initialization
- All Implemented Interfaces:
KMedoidsInitialization<O>
@Reference(authors="M. Eug\u00e9nia Captivo", title="Fast primal and dual heuristics for the p-median location problem", booktitle="European Journal of Operational Research 52(1)", url="https://doi.org/10.1016/0377-2217(91)90336-T", bibkey="doi:10.1016/0377-2217(91)90336-T") public class GreedyG<O> extends java.lang.Object implements KMedoidsInitialization<O>
Initialization method for k-medoids that combines the Greedy (PAMBUILD
) with "alternate" refinement steps. After choosing a new medoid, all points are assigned to the nearest center, and the medoid of the resulting partitions is used.Reference:
M. Eugénia Captivo
Fast primal and dual heuristics for the p-median location problem
European Journal of Operational Research 52(1)- Since:
- 0.8.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GreedyG.Par<V>
Parameterization class.
-
Constructor Summary
Constructors Constructor Description GreedyG()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DBIDs
chooseInitialMedoids(int k, DBIDs ids, DistanceQuery<? super O> distQ)
Choose initial meansstatic double
findMedoid(DBIDs ids, DistanceQuery<?> distQ, int j, DBIDArrayMIter miter, double bestm, WritableDoubleDataStore temp, WritableDoubleDataStore tempbest, WritableDoubleDataStore mindist)
Find the best medoid of a given fixed set.
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
-
Method Detail
-
chooseInitialMedoids
public DBIDs chooseInitialMedoids(int k, DBIDs ids, DistanceQuery<? super O> distQ)
Description copied from interface:KMedoidsInitialization
Choose initial means- Specified by:
chooseInitialMedoids
in interfaceKMedoidsInitialization<O>
- Parameters:
k
- Parameter kids
- Candidate IDs.distQ
- Distance function- Returns:
- List of chosen means for k-means
-
findMedoid
public static double findMedoid(DBIDs ids, DistanceQuery<?> distQ, int j, DBIDArrayMIter miter, double bestm, WritableDoubleDataStore temp, WritableDoubleDataStore tempbest, WritableDoubleDataStore mindist)
Find the best medoid of a given fixed set.- Parameters:
j
- Cluster numberids
- Object idsdistQ
- Distance querymiter
- Medoid iterator, pointing to the current medoid (modified)bestm
- Prior cost, of the current assignmenttemp
- Temporary storage for distancestempbest
- Second temporary storage for distancesmindist
- Minimum distance (output)- Returns:
- New cost
-
-