protected static class KMedoidsFastPAM1.Instance extends KMedoidsPAM.Instance
assignment, distQ, ids, nearest, second| Constructor and Description |
|---|
Instance(DistanceQuery<?> distQ,
DBIDs ids,
WritableIntegerDataStore assignment)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
assignToNearestCluster(ArrayDBIDs means)
Returns a list of clusters.
|
protected void |
computeReassignmentCost(DBIDRef h,
double[] cost)
Compute the reassignment cost, for all medoids in one pass.
|
protected double |
run(ArrayModifiableDBIDs medoids,
int maxiter)
Run the PAM optimization phase.
|
protected void |
updateAssignment(ArrayModifiableDBIDs medoids,
DBIDArrayIter miter,
DBIDRef h,
int m)
Update an existing cluster assignment.
|
private int |
updateSecondNearest(DBIDRef j,
DBIDArrayIter medoids,
int h,
double dist_h,
int n)
Find the second nearest medoid.
|
computeReassignmentCostpublic Instance(DistanceQuery<?> distQ, DBIDs ids, WritableIntegerDataStore assignment)
distQ - Distance queryids - IDs to processassignment - Cluster assignmentprotected double run(ArrayModifiableDBIDs medoids, int maxiter)
run in class KMedoidsPAM.Instancemedoids - Medoids listmaxiter - protected double assignToNearestCluster(ArrayDBIDs means)
assignToNearestCluster in class KMedoidsPAM.Instancemeans - Object centroidsprotected void computeReassignmentCost(DBIDRef h, double[] cost)
h - Current object to swap with any medoid.cost - Cost aggregation array, must have size kprotected void updateAssignment(ArrayModifiableDBIDs medoids, DBIDArrayIter miter, DBIDRef h, int m)
medoids - Medoids setmiter - Medoid iteratorh - New medoidm - Position of replaced medoidprivate int updateSecondNearest(DBIDRef j, DBIDArrayIter medoids, int h, double dist_h, int n)
j - Query pointmedoids - Medoidsh - Known medoiddist_h - Distance to hn - Known nearestKMedoidsPAM.Instance.second is updated.Copyright © 2019 ELKI Development Team. License information.