Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.distance.similarityfunction
Class SharedNearestNeighborSimilarityFunction<O extends DatabaseObject,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
              extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractSimilarityFunction<O,D>
                  extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractPreprocessorBasedSimilarityFunction<O,SharedNearestNeighborsPreprocessor<O,D>,IntegerDistance>
                      extended by de.lmu.ifi.dbs.elki.distance.similarityfunction.SharedNearestNeighborSimilarityFunction<O,D>
All Implemented Interfaces:
MeasurementFunction<O,IntegerDistance>, SimilarityFunction<O,IntegerDistance>, Loggable, Parameterizable

public class SharedNearestNeighborSimilarityFunction<O extends DatabaseObject,D extends Distance<D>>
extends AbstractPreprocessorBasedSimilarityFunction<O,SharedNearestNeighborsPreprocessor<O,D>,IntegerDistance>

Author:
Arthur Zimek

Field Summary
static AssociationID<SortedSet> ASSOCIATION_ID
          The Assocoiation ID for the association to be set by the preprocessor.
static String DEFAULT_PREPROCESSOR_CLASS
          The default preprocessor class name.
static String PREPROCESSOR_CLASS_D
          Description for parameter preprocessor.
static Class<SharedNearestNeighborsPreprocessor> PREPROCESSOR_SUPER_CLASS
          The super class for the preprocessor.
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
INFINITY_PATTERN
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
SharedNearestNeighborSimilarityFunction()
           
 
Method Summary
(package private)  AssociationID<SortedSet> getAssociationID()
          Returns the assocoiation ID for the association to be set by the preprocessor.
(package private)  String getDefaultPreprocessorClassName()
          Returns the name of the default preprocessor.
(package private)  String getPreprocessorClassDescription()
          Returns the description for parameter preprocessor.
(package private)  Class<? extends Preprocessor> getPreprocessorSuperClassName()
          Returns the super class for the preprocessor.
 IntegerDistance infiniteDistance()
          Provides an infinite distance.
 boolean isInfiniteDistance(IntegerDistance distance)
          Returns true, if the given distance is an infinite distance, false otherwise.
 boolean isNullDistance(IntegerDistance distance)
          Returns true, if the given distance is a null distance, false otherwise.
 boolean isUndefinedDistance(IntegerDistance distance)
          Returns true, if the given distance is an undefined distance, false otherwise.
 IntegerDistance nullDistance()
          Provides a null distance.
 IntegerDistance similarity(Integer id1, Integer id2)
          Returns the similarity between the two objects specified by their object ids.
 IntegerDistance undefinedDistance()
          Provides an undefined distance.
 IntegerDistance valueOf(String pattern)
          Provides a measurement suitable to this measurement function based on the given pattern.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractPreprocessorBasedSimilarityFunction
getAttributeSettings, getPreprocessor, setDatabase, setParameters
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.similarityfunction.AbstractSimilarityFunction
similarity, similarity
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
getDatabase, matches, requiredInputPattern, setRequiredInputPattern
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, checkGlobalParameterConstraints, deleteOption, description, description, description, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
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.distance.MeasurementFunction
requiredInputPattern
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, description, getParameters, getPossibleOptions, inlineDescription
 

Field Detail

ASSOCIATION_ID

public static final AssociationID<SortedSet> ASSOCIATION_ID
The Assocoiation ID for the association to be set by the preprocessor.


PREPROCESSOR_SUPER_CLASS

public static final Class<SharedNearestNeighborsPreprocessor> PREPROCESSOR_SUPER_CLASS
The super class for the preprocessor.


DEFAULT_PREPROCESSOR_CLASS

public static final String DEFAULT_PREPROCESSOR_CLASS
The default preprocessor class name.


PREPROCESSOR_CLASS_D

public static final String PREPROCESSOR_CLASS_D
Description for parameter preprocessor.

See Also:
Constant Field Values
Constructor Detail

SharedNearestNeighborSimilarityFunction

public SharedNearestNeighborSimilarityFunction()
Method Detail

similarity

public IntegerDistance similarity(Integer id1,
                                  Integer id2)
Description copied from interface: SimilarityFunction
Returns the similarity between the two objects specified by their object ids.

Parameters:
id1 - first object id
id2 - second object id
Returns:
the similarity between the two objects specified by their object ids

infiniteDistance

public IntegerDistance infiniteDistance()
Description copied from interface: MeasurementFunction
Provides an infinite distance.

Returns:
an infinite distance

isInfiniteDistance

public boolean isInfiniteDistance(IntegerDistance distance)
Description copied from interface: MeasurementFunction
Returns true, if the given distance is an infinite distance, false otherwise.

Parameters:
distance - the distance to be tested on infinity
Returns:
true, if the given distance is an infinite distance, false otherwise

isNullDistance

public boolean isNullDistance(IntegerDistance distance)
Description copied from interface: MeasurementFunction
Returns true, if the given distance is a null distance, false otherwise.

Parameters:
distance - the distance to be tested whether it is a null distance
Returns:
true, if the given distance is a null distance, false otherwise

isUndefinedDistance

public boolean isUndefinedDistance(IntegerDistance distance)
Description copied from interface: MeasurementFunction
Returns true, if the given distance is an undefined distance, false otherwise.

Parameters:
distance - the distance to be tested whether it is undefined
Returns:
true, if the given distance is an undefined distance, false otherwise

nullDistance

public IntegerDistance nullDistance()
Description copied from interface: MeasurementFunction
Provides a null distance.

Returns:
a null distance

undefinedDistance

public IntegerDistance undefinedDistance()
Description copied from interface: MeasurementFunction
Provides an undefined distance.

Returns:
an undefined distance

valueOf

public IntegerDistance valueOf(String pattern)
                        throws IllegalArgumentException
Description copied from interface: MeasurementFunction
Provides a measurement suitable to this measurement function based on the given pattern.

Parameters:
pattern - a pattern defining a similarity suitable to this measurement function
Returns:
a measurement suitable to this measurement function based on the given pattern
Throws:
IllegalArgumentException - if the given pattern is not compatible with the requirements of this measurement function

getAssociationID

AssociationID<SortedSet> getAssociationID()
Description copied from class: AbstractPreprocessorBasedSimilarityFunction
Returns the assocoiation ID for the association to be set by the preprocessor.

Specified by:
getAssociationID in class AbstractPreprocessorBasedSimilarityFunction<O extends DatabaseObject,SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>,IntegerDistance>

getDefaultPreprocessorClassName

String getDefaultPreprocessorClassName()
Description copied from class: AbstractPreprocessorBasedSimilarityFunction
Returns the name of the default preprocessor.

Specified by:
getDefaultPreprocessorClassName in class AbstractPreprocessorBasedSimilarityFunction<O extends DatabaseObject,SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>,IntegerDistance>

getPreprocessorClassDescription

String getPreprocessorClassDescription()
Description copied from class: AbstractPreprocessorBasedSimilarityFunction
Returns the description for parameter preprocessor.

Specified by:
getPreprocessorClassDescription in class AbstractPreprocessorBasedSimilarityFunction<O extends DatabaseObject,SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>,IntegerDistance>

getPreprocessorSuperClassName

Class<? extends Preprocessor> getPreprocessorSuperClassName()
Description copied from class: AbstractPreprocessorBasedSimilarityFunction
Returns the super class for the preprocessor.

Specified by:
getPreprocessorSuperClassName in class AbstractPreprocessorBasedSimilarityFunction<O extends DatabaseObject,SharedNearestNeighborsPreprocessor<O extends DatabaseObject,D extends Distance<D>>,IntegerDistance>

Release 0.1 (2008-07-10_1838)