O
- Object type@Reference(authors="S. I. Ao, K. Yip, M. Ng, D. Cheung, P.-Y. Fong, I. Melhado, P. C. Sham",title="CLUSTAG: hierarchical clustering and graph methods for selecting tag SNPs",booktitle="Bioinformatics, 21 (8)",url="https://doi.org/10.1093/bioinformatics/bti201",bibkey="DBLP:journals/bioinformatics/AoYNCFMS05") @Reference(authors="J. Bien, R. Tibshirani",title="Hierarchical Clustering with Prototypes via Minimax Linkage",booktitle="Journal of the American Statistical Association 106(495)",url="https://doi.org/10.1198/jasa.2011.tm10183",bibkey="doi:10.1198/jasa.2011.tm10183") public class MiniMax<O> extends AbstractDistanceBasedAlgorithm<O,PointerPrototypeHierarchyRepresentationResult> implements HierarchicalClusteringAlgorithm
Reference:
S. I. Ao, K. Yip, M. Ng, D. Cheung, P.-Y. Fong, I. Melhado, P. C. Sham
CLUSTAG: hierarchical clustering and graph methods for selecting tag SNPs
Bioinformatics, 21 (8)
J. Bien and R. Tibshirani
Hierarchical Clustering with Prototypes via Minimax Linkage
Journal of the American Statistical Association 106(495)
Modifier and Type | Class and Description |
---|---|
static class |
MiniMax.Parameterizer<O>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private static Logging |
LOG
Class Logger.
|
ALGORITHM_ID
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
MiniMax(DistanceFunction<? super O> distanceFunction)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private static double |
findMax(DistanceQuery<?> dq,
DBIDIter i,
DBIDs cy,
double maxDist,
double minMaxDist)
Find the maximum distance of one object to a set.
|
protected static int |
findMerge(int end,
MatrixParadigm mat,
DBIDArrayMIter prots,
PointerHierarchyRepresentationBuilder builder,
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<ModifiableDBIDs> clusters,
DistanceQuery<?> dq)
Find the best merge.
|
private static double |
findPrototype(DistanceQuery<?> dq,
DBIDs cx,
DBIDs cy,
DBIDVar prototype,
double minMaxDist)
Find the prototypes.
|
private static double |
findPrototypeSingleton(DistanceQuery<?> dq,
DBIDs cx,
DBIDRef cy,
DBIDVar prototype)
Find the prototypes.
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
protected static <O> void |
initializeMatrices(MatrixParadigm mat,
ArrayModifiableDBIDs prots,
DistanceQuery<O> dq)
Initializes the inter-cluster distance matrix of possible merges
|
protected static void |
merge(int size,
MatrixParadigm mat,
DBIDArrayMIter prots,
PointerHierarchyRepresentationBuilder builder,
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<ModifiableDBIDs> clusters,
DistanceQuery<?> dq,
int x,
int y)
Merges two clusters given by x, y, their points with smallest IDs, and y to
keep
|
PointerPrototypeHierarchyRepresentationResult |
run(Database db,
Relation<O> relation)
Run the algorithm on a database.
|
protected static void |
updateEntry(MatrixParadigm mat,
DBIDArrayMIter prots,
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<ModifiableDBIDs> clusters,
DistanceQuery<?> dq,
int x,
int y)
Update entry at x,y for distance matrix distances
|
protected static <O> void |
updateMatrices(int size,
MatrixParadigm mat,
DBIDArrayMIter prots,
PointerHierarchyRepresentationBuilder builder,
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<ModifiableDBIDs> clusters,
DistanceQuery<O> dq,
int c)
Update the entries of the matrices that contain a distance to c, the newly
merged cluster.
|
getDistanceFunction
run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private static final Logging LOG
public MiniMax(DistanceFunction<? super O> distanceFunction)
distanceFunction
- Distance function to use.public PointerPrototypeHierarchyRepresentationResult run(Database db, Relation<O> relation)
db
- Databaserelation
- Relation to process.protected static <O> void initializeMatrices(MatrixParadigm mat, ArrayModifiableDBIDs prots, DistanceQuery<O> dq)
mat
- Matrixdq
- The distance queryprotected static int findMerge(int end, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq)
mat
- Matrix viewprots
- Prototypesbuilder
- Result builderclusters
- Current clustersdq
- Distance queryprotected static void merge(int size, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq, int x, int y)
size
- number of ids in the data setmat
- distance matrixprots
- calculated prototypesbuilder
- Result builderclusters
- the clustersdq
- distance query of the data setx
- first cluster to mergey
- second cluster to mergeprotected static <O> void updateMatrices(int size, MatrixParadigm mat, DBIDArrayMIter prots, PointerHierarchyRepresentationBuilder builder, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<O> dq, int c)
size
- number of ids in the data setmat
- matrix paradigmprots
- calculated prototypesbuilder
- Result builderclusters
- the clustersdq
- distance query of the data setc
- the cluster to update distances toprotected static void updateEntry(MatrixParadigm mat, DBIDArrayMIter prots, it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<ModifiableDBIDs> clusters, DistanceQuery<?> dq, int x, int y)
mat
- distance matrixprots
- calculated prototypesclusters
- the clustersdq
- distance query on the data setx
- index of cluster, x > y
y
- index of cluster, y < x
private static double findPrototype(DistanceQuery<?> dq, DBIDs cx, DBIDs cy, DBIDVar prototype, double minMaxDist)
dq
- Distance querycx
- First setcy
- Second setprototype
- Prototype output variableminMaxDist
- Previously best distance.private static double findPrototypeSingleton(DistanceQuery<?> dq, DBIDs cx, DBIDRef cy, DBIDVar prototype)
dq
- Distance querycx
- First setcy
- Singleton objectprototype
- Prototype output variableprivate static double findMax(DistanceQuery<?> dq, DBIDIter i, DBIDs cy, double maxDist, double minMaxDist)
dq
- Distance queryi
- Current objectcy
- Set of candidatesmaxDist
- Known maximum to othersminMaxDist
- Early stopping thresholdpublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<PointerPrototypeHierarchyRepresentationResult>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<PointerPrototypeHierarchyRepresentationResult>
Copyright © 2019 ELKI Development Team. License information.