de.lmu.ifi.dbs.elki.index.preprocessed.preference
Class DiSHPreferenceVectorIndex<V extends NumberVector<?,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.index.AbstractIndex<O>
      extended by de.lmu.ifi.dbs.elki.index.preprocessed.AbstractPreprocessorIndex<NV,BitSet>
          extended by de.lmu.ifi.dbs.elki.index.preprocessed.preference.AbstractPreferenceVectorIndex<V>
              extended by de.lmu.ifi.dbs.elki.index.preprocessed.preference.DiSHPreferenceVectorIndex<V>
All Implemented Interfaces:
Index, PreferenceVectorIndex<V>, Result

@Description(value="Computes the preference vector of objects of a certain database according to the DiSH algorithm.")
public class DiSHPreferenceVectorIndex<V extends NumberVector<?,?>>
extends AbstractPreferenceVectorIndex<V>
implements PreferenceVectorIndex<V>

Preprocessor for DiSH preference vector assignment to objects of a certain database.


Nested Class Summary
static class DiSHPreferenceVectorIndex.Factory<V extends NumberVector<?,?>>
          Factory class
static class DiSHPreferenceVectorIndex.Strategy
          Available strategies for determination of the preference vector.
 
Field Summary
protected  DoubleDistance[] epsilon
          The epsilon value for each dimension;
protected static Logging logger
          Logger to use
protected  int minpts
          Threshold for minimum number of points in the neighborhood.
protected  DiSHPreferenceVectorIndex.Strategy strategy
          The strategy to determine the preference vector.
 
Fields inherited from class de.lmu.ifi.dbs.elki.index.preprocessed.AbstractPreprocessorIndex
storage
 
Fields inherited from class de.lmu.ifi.dbs.elki.index.AbstractIndex
relation
 
Constructor Summary
DiSHPreferenceVectorIndex(Relation<V> relation, DoubleDistance[] epsilon, int minpts, DiSHPreferenceVectorIndex.Strategy strategy)
          Constructor.
 
Method Summary
private  BitSet determinePreferenceVector(Relation<V> relation, ModifiableDBIDs[] neighborIDs, StringBuffer msg)
          Determines the preference vector according to the specified neighbor ids.
private  BitSet determinePreferenceVectorByApriori(Relation<V> relation, ModifiableDBIDs[] neighborIDs, StringBuffer msg)
          Determines the preference vector with the apriori strategy.
private  BitSet determinePreferenceVectorByMaxIntersection(ModifiableDBIDs[] neighborIDs, StringBuffer msg)
          Determines the preference vector with the max intersection strategy.
protected  Logging getLogger()
          Get the classes static logger.
 String getLongName()
          A "pretty" name for the result, for use in titles, captions and menus.
 String getShortName()
          A short name for the result, useful for file names.
private  RangeQuery<V,DoubleDistance>[] initRangeQueries(Relation<V> relation, int dimensionality)
          Initializes the dimension selecting distancefunctions to determine the preference vectors.
private  int max(Map<Integer,ModifiableDBIDs> candidates)
          Returns the set with the maximum size contained in the specified map.
private  int maxIntersection(Map<Integer,ModifiableDBIDs> candidates, DBIDs set, ModifiableDBIDs result)
          Returns the index of the set having the maximum intersection set with the specified set contained in the specified map.
protected  void preprocess()
          Preprocessing step.
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.preprocessed.preference.AbstractPreferenceVectorIndex
getPreferenceVector
 
Methods inherited from class de.lmu.ifi.dbs.elki.index.AbstractIndex
delete, deleteAll, getPageFileStatistics, insert, insertAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.preprocessed.preference.PreferenceVectorIndex
getPreferenceVector
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.Index
delete, deleteAll, getPageFileStatistics, insert, insertAll
 

Field Detail

logger

protected static final Logging logger
Logger to use


epsilon

protected DoubleDistance[] epsilon
The epsilon value for each dimension;


minpts

protected int minpts
Threshold for minimum number of points in the neighborhood.


strategy

protected DiSHPreferenceVectorIndex.Strategy strategy
The strategy to determine the preference vector.

Constructor Detail

DiSHPreferenceVectorIndex

public DiSHPreferenceVectorIndex(Relation<V> relation,
                                 DoubleDistance[] epsilon,
                                 int minpts,
                                 DiSHPreferenceVectorIndex.Strategy strategy)
Constructor.

Parameters:
relation - Relation to use
epsilon - Epsilon value
minpts - MinPts value
strategy - Strategy
Method Detail

preprocess

protected void preprocess()
Description copied from class: AbstractPreferenceVectorIndex
Preprocessing step.

Specified by:
preprocess in class AbstractPreferenceVectorIndex<V extends NumberVector<?,?>>

determinePreferenceVector

private BitSet determinePreferenceVector(Relation<V> relation,
                                         ModifiableDBIDs[] neighborIDs,
                                         StringBuffer msg)
                                  throws ParameterException,
                                         UnableToComplyException
Determines the preference vector according to the specified neighbor ids.

Parameters:
relation - the database storing the objects
neighborIDs - the list of ids of the neighbors in each dimension
msg - a string buffer for debug messages
Returns:
the preference vector
Throws:
ParameterException
UnableToComplyException

determinePreferenceVectorByApriori

private BitSet determinePreferenceVectorByApriori(Relation<V> relation,
                                                  ModifiableDBIDs[] neighborIDs,
                                                  StringBuffer msg)
                                           throws ParameterException,
                                                  UnableToComplyException
Determines the preference vector with the apriori strategy.

Parameters:
relation - the database storing the objects
neighborIDs - the list of ids of the neighbors in each dimension
msg - a string buffer for debug messages
Returns:
the preference vector
Throws:
ParameterException
UnableToComplyException

determinePreferenceVectorByMaxIntersection

private BitSet determinePreferenceVectorByMaxIntersection(ModifiableDBIDs[] neighborIDs,
                                                          StringBuffer msg)
Determines the preference vector with the max intersection strategy.

Parameters:
neighborIDs - the list of ids of the neighbors in each dimension
msg - a string buffer for debug messages
Returns:
the preference vector

max

private int max(Map<Integer,ModifiableDBIDs> candidates)
Returns the set with the maximum size contained in the specified map.

Parameters:
candidates - the map containing the sets
Returns:
the set with the maximum size

maxIntersection

private int maxIntersection(Map<Integer,ModifiableDBIDs> candidates,
                            DBIDs set,
                            ModifiableDBIDs result)
Returns the index of the set having the maximum intersection set with the specified set contained in the specified map.

Parameters:
candidates - the map containing the sets
set - the set to intersect with
result - the set to put the result in
Returns:
the set with the maximum size

initRangeQueries

private RangeQuery<V,DoubleDistance>[] initRangeQueries(Relation<V> relation,
                                                        int dimensionality)
                                                                           throws ParameterException
Initializes the dimension selecting distancefunctions to determine the preference vectors.

Parameters:
relation - the database storing the objects
dimensionality - the dimensionality of the objects
Returns:
the dimension selecting distancefunctions to determine the preference vectors
Throws:
ParameterException

getLogger

protected Logging getLogger()
Description copied from class: AbstractPreprocessorIndex
Get the classes static logger.

Specified by:
getLogger in class AbstractPreprocessorIndex<V extends NumberVector<?,?>,BitSet>
Returns:
Logger

getLongName

public String getLongName()
Description copied from interface: Result
A "pretty" name for the result, for use in titles, captions and menus.

Specified by:
getLongName in interface Result
Specified by:
getLongName in class AbstractIndex<V extends NumberVector<?,?>>
Returns:
result name

getShortName

public String getShortName()
Description copied from interface: Result
A short name for the result, useful for file names.

Specified by:
getShortName in interface Result
Specified by:
getShortName in class AbstractIndex<V extends NumberVector<?,?>>
Returns:
result name

Release 0.4.0 (2011-09-20_1324)