Package elki.projection
Class IntrinsicNearestNeighborAffinityMatrixBuilder<O>
- java.lang.Object
-
- elki.projection.GaussianAffinityMatrixBuilder<O>
-
- elki.projection.PerplexityAffinityMatrixBuilder<O>
-
- elki.projection.NearestNeighborAffinityMatrixBuilder<O>
-
- elki.projection.IntrinsicNearestNeighborAffinityMatrixBuilder<O>
-
- Type Parameters:
O
- Object type
- All Implemented Interfaces:
AffinityMatrixBuilder<O>
@Title("Intrinsic t-Stochastic Neighbor Embedding") @Reference(authors="Erich Schubert, Michael Gertz", title="Intrinsic t-Stochastic Neighbor Embedding for Visualization and Outlier Detection: A Remedy Against the Curse of Dimensionality?", booktitle="Proc. Int. Conf. Similarity Search and Applications, SISAP 2017", url="https://doi.org/10.1007/978-3-319-68474-1_13", bibkey="DBLP:conf/sisap/SchubertG17") public class IntrinsicNearestNeighborAffinityMatrixBuilder<O> extends NearestNeighborAffinityMatrixBuilder<O>
Build sparse affinity matrix using the nearest neighbors only, adjusting for intrinsic dimensionality. On data sets with high intrinsic dimensionality, this can give better results.Furthermore, this approach uses a different rule to combine affinities: rather than taking the arithmetic average of \(p_{ij}\) and \(p_{ji}\), we use \(\sqrt{p_{ij} \cdot p_{ji}}\), which prevents outliers from attaching closely to nearby clusters.
Reference:
Erich Schubert, Michael Gertz
Intrinsic t-Stochastic Neighbor Embedding for Visualization and Outlier Detection: A Remedy Against the Curse of Dimensionality?
Proc. Int. Conf. Similarity Search and Applications, SISAP 2017- Since:
- 0.7.5
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IntrinsicNearestNeighborAffinityMatrixBuilder.Par<O>
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description (package private) DistanceBasedIntrinsicDimensionalityEstimator
estimator
Estimator of intrinsic dimensionality.private static Logging
LOG
Class logger.-
Fields inherited from class elki.projection.NearestNeighborAffinityMatrixBuilder
numberOfNeighbours
-
Fields inherited from class elki.projection.PerplexityAffinityMatrixBuilder
distance, MIN_PIJ, perplexity, PERPLEXITY_ERROR, PERPLEXITY_MAXITER
-
Fields inherited from class elki.projection.GaussianAffinityMatrixBuilder
sigma
-
-
Constructor Summary
Constructors Constructor Description IntrinsicNearestNeighborAffinityMatrixBuilder(Distance<? super O> distance, double perplexity, DistanceBasedIntrinsicDimensionalityEstimator estimator)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends O>
AffinityMatrixcomputeAffinityMatrix(Relation<T> relation, double initialScale)
Compute the affinity matrix.protected void
computePij(DBIDRange ids, KNNSearcher<DBIDRef> knnq, boolean square, int numberOfNeighbours, double[][] pij, int[][] indices, double initialScale)
Compute the sparse pij using the nearest neighbors only.protected void
convertNeighbors(DBIDRange ids, DBIDRef ix, boolean square, KNNList neighbours, DoubleArray dist, IntegerArray ind, Mean m)
Load a neighbor query result into a double and and integer array, also removing the query point.-
Methods inherited from class elki.projection.NearestNeighborAffinityMatrixBuilder
computeH, computeSigma, containsIndex, convertNeighbors
-
Methods inherited from class elki.projection.PerplexityAffinityMatrixBuilder
computePi, computePij, estimateInitialBeta, getInputTypeRestriction
-
Methods inherited from class elki.projection.GaussianAffinityMatrixBuilder
buildDistanceMatrix, computeH
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
estimator
DistanceBasedIntrinsicDimensionalityEstimator estimator
Estimator of intrinsic dimensionality.
-
-
Constructor Detail
-
IntrinsicNearestNeighborAffinityMatrixBuilder
public IntrinsicNearestNeighborAffinityMatrixBuilder(Distance<? super O> distance, double perplexity, DistanceBasedIntrinsicDimensionalityEstimator estimator)
Constructor.- Parameters:
distance
- Distance functionperplexity
- Perplexityestimator
- Estimator of intrinsic dimensionality
-
-
Method Detail
-
computeAffinityMatrix
public <T extends O> AffinityMatrix computeAffinityMatrix(Relation<T> relation, double initialScale)
Description copied from interface:AffinityMatrixBuilder
Compute the affinity matrix.- Specified by:
computeAffinityMatrix
in interfaceAffinityMatrixBuilder<O>
- Overrides:
computeAffinityMatrix
in classNearestNeighborAffinityMatrixBuilder<O>
- Type Parameters:
T
- Relation type- Parameters:
relation
- Data relationinitialScale
- initial scale- Returns:
- Affinity matrix
-
computePij
protected void computePij(DBIDRange ids, KNNSearcher<DBIDRef> knnq, boolean square, int numberOfNeighbours, double[][] pij, int[][] indices, double initialScale)
Compute the sparse pij using the nearest neighbors only.- Overrides:
computePij
in classNearestNeighborAffinityMatrixBuilder<O>
- Parameters:
ids
- ID rangeknnq
- kNN querysquare
- Use squared distancesnumberOfNeighbours
- Number of neighbors to getpij
- Output of distancesindices
- Output of indexesinitialScale
- Initial scaling factor
-
convertNeighbors
protected void convertNeighbors(DBIDRange ids, DBIDRef ix, boolean square, KNNList neighbours, DoubleArray dist, IntegerArray ind, Mean m)
Load a neighbor query result into a double and and integer array, also removing the query point. This is necessary, because we have to modify the distances. TODO: sort by index, not distance- Parameters:
ids
- Indexesix
- Current Objectsquare
- Use squared distancesneighbours
- Neighbor listdist
- Output distance arrayind
- Output index arraym
- Mean id, for statistics.
-
-