Package elki.clustering.kmedoids
Class FastCLARANS.Assignment
- java.lang.Object
-
- elki.clustering.kmedoids.CLARANS.Assignment
-
- elki.clustering.kmedoids.FastCLARANS.Assignment
-
- Enclosing class:
- FastCLARANS<V>
protected static class FastCLARANS.Assignment extends CLARANS.Assignment
Assignment state.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected int
lastbest
Last best medoid number(package private) double[]
loss
Array for storing the per-medoid loss.-
Fields inherited from class elki.clustering.kmedoids.CLARANS.Assignment
assignment, distQ, ids, medoids, miter, nearest, second, secondid
-
-
Constructor Summary
Constructors Constructor Description Assignment(DistanceQuery<?> distQ, DBIDs ids, int k)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
computeCostDifferential(DBIDRef h, double[] pcost)
Compute the reassignment cost, for one swap.protected void
computeRemovalCost(double[] pcost)
Precompute the costs of reassigning to the second closest medoid.protected void
performLastSwap(DBIDRef h)
Compute the reassignment cost, for one swap.-
Methods inherited from class elki.clustering.kmedoids.CLARANS.Assignment
assignToNearestCluster, computeCostDifferential, recompute
-
-
-
-
Constructor Detail
-
Assignment
public Assignment(DistanceQuery<?> distQ, DBIDs ids, int k)
Constructor.- Parameters:
distQ
- Distance queryids
- IDs to processk
- Number of medoids
-
-
Method Detail
-
computeRemovalCost
protected void computeRemovalCost(double[] pcost)
Precompute the costs of reassigning to the second closest medoid.- Parameters:
pcost
- Output cost
-
computeCostDifferential
protected double computeCostDifferential(DBIDRef h, double[] pcost)
Compute the reassignment cost, for one swap.- Parameters:
h
- Current object to swap with any medoidpcost
- Prior cost for removing- Returns:
- Cost change
-
performLastSwap
protected void performLastSwap(DBIDRef h)
Compute the reassignment cost, for one swap.- Parameters:
h
- Current object to swap with the best medoid
-
-