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 classLinearWeightedExtendedNeighborhood.Factory<O>Factory class.
-
Field Summary
Fields Modifier and Type Field Description private NeighborSetPredicateinnerThe data store to useprivate intstepsThe 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 doublecomputeWeight(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:WeightedNeighborSetPredicateGet the neighbors of a reference object for DBSCAN.- Specified by:
getWeightedNeighborsin interfaceWeightedNeighborSetPredicate- Parameters:
reference- Reference object- Returns:
- Weighted Neighborhood
-
-