O
- Object type@Title(value="Distance Histogram") @Description(value="Computes a histogram over the distances occurring in the data set.") public class DistanceStatisticsWithClasses<O> extends AbstractDistanceBasedAlgorithm<O,CollectionResult<DoubleVector>>
Modifier and Type | Class and Description |
---|---|
static class |
DistanceStatisticsWithClasses.Parameterizer<O>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
exact
Compute exactly (slower).
|
private static Logging |
LOG
The logger for this class.
|
protected int |
numbin
Number of bins to use in sampling.
|
protected boolean |
sampling
Sampling flag.
|
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
DistanceStatisticsWithClasses(DistanceFunction<? super O> distanceFunction,
int numbins,
boolean exact,
boolean sampling)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private DoubleMinMax |
exactMinMax(Relation<O> relation,
DistanceQuery<O> distFunc)
Compute the exact maximum and minimum.
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
HistogramResult<DoubleVector> |
run(Database database)
Runs the algorithm.
|
private DoubleMinMax |
sampleMinMax(Relation<O> relation,
DistanceQuery<O> distFunc)
Estimate minimum and maximum via sampling.
|
private static void |
shrinkHeap(TreeSet<DoubleDBIDPair> hotset,
int k)
Shrink the heap of "hot" (extreme) items.
|
getDistanceFunction
makeParameterDistanceFunction
private static final Logging LOG
protected int numbin
protected boolean sampling
protected boolean exact
public DistanceStatisticsWithClasses(DistanceFunction<? super O> distanceFunction, int numbins, boolean exact, boolean sampling)
distanceFunction
- Distance function to usenumbins
- Number of binsexact
- Exactness flagsampling
- Sampling flagpublic HistogramResult<DoubleVector> run(Database database)
Algorithm
run
in interface Algorithm
run
in class AbstractAlgorithm<CollectionResult<DoubleVector>>
database
- the database to run the algorithm onprivate DoubleMinMax sampleMinMax(Relation<O> relation, DistanceQuery<O> distFunc)
relation
- Relation to processdistFunc
- Distance function to useprivate DoubleMinMax exactMinMax(Relation<O> relation, DistanceQuery<O> distFunc)
relation
- Relation to processdistFunc
- Distance functionprivate static void shrinkHeap(TreeSet<DoubleDBIDPair> hotset, int k)
hotset
- Set of hot itemsk
- target sizepublic TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<CollectionResult<DoubleVector>>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<CollectionResult<DoubleVector>>
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.