Package elki.algorithm
Class KNNDistancesSampler<O>
- java.lang.Object
-
- elki.algorithm.KNNDistancesSampler<O>
-
- Type Parameters:
O
- the type of objects handled by this algorithm
- All Implemented Interfaces:
Algorithm
@Title("KNN-Distance-Order") @Description("Assesses the knn distances for a specified k and orders them.") @Reference(authors="Martin Ester, Hans-Peter Kriegel, J\u00f6rg Sander, Xiaowei Xu",title="A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise",booktitle="Proc. 2nd Int. Conf. on Knowledge Discovery and Data Mining (KDD \'96)",url="http://www.aaai.org/Library/KDD/1996/kdd96-037.php",bibkey="DBLP:conf/kdd/EsterKSX96") @Reference(authors="Erich Schubert, J\u00f6rg Sander, Martin Ester, Hans-Peter Kriegel, Xiaowei Xu",title="DBSCAN Revisited, Revisited: Why and How You Should (Still) Use DBSCAN",booktitle="ACM Trans. Database Systems (TODS)",url="https://doi.org/10.1145/3068335",bibkey="DBLP:journals/tods/SchubertSEKX17") public class KNNDistancesSampler<O> extends java.lang.Object implements Algorithm
Provides an order of the kNN-distances for all objects within the database.This class can be used to estimate parameters for other algorithms, such as estimating the epsilon parameter for DBSCAN: set k to minPts-1, and then choose a percentile from the sample as epsilon, or plot the result as a graph and look for a bend or knee in this plot.
Reference:
Martin Ester, Hans-Peter Kriegel, Jörg Sander, Xiaowei Xu
A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise
Proc. 2nd Int. Conf. on Knowledge Discovery and Data Mining (KDD '96)Further discussion:
Erich Schubert, Jörg Sander, Martin Ester, Hans-Peter Kriegel, Xiaowei Xu
DBSCAN Revisited, Revisited: Why and How You Should (Still) Use DBSCAN
ACM Trans. Database Systems (TODS)- Since:
- 0.1
- Author:
- Arthur Zimek
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KNNDistancesSampler.KNNDistanceOrderResult
Curve result for a list containing the knn distances.static class
KNNDistancesSampler.Par<O>
Parameterization class.-
Nested classes/interfaces inherited from interface elki.Algorithm
Algorithm.Utils
-
-
Constructor Summary
Constructors Constructor Description KNNDistancesSampler(Distance<? super O> distance, int k, double sample, RandomFactory rnd)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeInformation[]
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.KNNDistancesSampler.KNNDistanceOrderResult
run(Relation<O> relation)
Provides an order of the kNN-distances for all objects within the specified database.
-
-
-
Field Detail
-
LOG
private static final Logging LOG
The logger for this class.
-
k
protected int k
Parameter k.
-
sample
protected double sample
Sampling percentage.
-
rnd
protected RandomFactory rnd
Random number seeding.
-
-
Constructor Detail
-
KNNDistancesSampler
public KNNDistancesSampler(Distance<? super O> distance, int k, double sample, RandomFactory rnd)
Constructor.- Parameters:
distance
- Distance functionk
- k Parametersample
- Sampling rate, or sample size (when > 1)rnd
- Random source.
-
-
Method Detail
-
run
public KNNDistancesSampler.KNNDistanceOrderResult run(Relation<O> relation)
Provides an order of the kNN-distances for all objects within the specified database.- Parameters:
relation
- Relation- Returns:
- Result
-
getInputTypeRestriction
public TypeInformation[] getInputTypeRestriction()
Description copied from interface:Algorithm
Get the input type restriction used for negotiating the data query.- Specified by:
getInputTypeRestriction
in interfaceAlgorithm
- Returns:
- Type restriction
-
-