Class LinearWeightedExtendedNeighborhood
- java.lang.Object
-
- elki.outlier.spatial.neighborhood.weighted.LinearWeightedExtendedNeighborhood
-
- All Implemented Interfaces:
WeightedNeighborSetPredicate
public class LinearWeightedExtendedNeighborhood extends java.lang.Object implements WeightedNeighborSetPredicate
Neighborhood obtained by computing the k-fold closure of an existing neighborhood. Objects are weighted linearly by their distance: the object itself has a weight of 1 and this decreases linearly to 1/(n+1) for the nth-step neighbors.TODO: make actual weighting parameterizable?
- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LinearWeightedExtendedNeighborhood.Factory<O>
Factory class.
-
Field Summary
Fields Modifier and Type Field Description private NeighborSetPredicate
inner
The data store to useprivate int
steps
The number of steps to extend to.
-
Constructor Summary
Constructors Constructor Description LinearWeightedExtendedNeighborhood(NeighborSetPredicate inner, int steps)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double
computeWeight(int tsteps)
Compute the weight from the number of steps needed.java.util.Collection<DoubleDBIDPair>
getWeightedNeighbors(DBIDRef reference)
Get the neighbors of a reference object for DBSCAN.
-
-
-
Field Detail
-
inner
private NeighborSetPredicate inner
The data store to use
-
steps
private int steps
The number of steps to extend to.
-
-
Constructor Detail
-
LinearWeightedExtendedNeighborhood
public LinearWeightedExtendedNeighborhood(NeighborSetPredicate inner, int steps)
Constructor.- Parameters:
inner
- Inner neighborhoodsteps
- Number of steps to expand
-
-
Method Detail
-
computeWeight
private double computeWeight(int tsteps)
Compute the weight from the number of steps needed.- Parameters:
tsteps
- steps to target- Returns:
- weight
-
getWeightedNeighbors
public java.util.Collection<DoubleDBIDPair> getWeightedNeighbors(DBIDRef reference)
Description copied from interface:WeightedNeighborSetPredicate
Get the neighbors of a reference object for DBSCAN.- Specified by:
getWeightedNeighbors
in interfaceWeightedNeighborSetPredicate
- Parameters:
reference
- Reference object- Returns:
- Weighted Neighborhood
-
-