Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.preprocessing
Class HiSCPreprocessor<V extends RealVector<V,?>>

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.preprocessing.HiSCPreprocessor<V>
Type Parameters:
V - Vector type
All Implemented Interfaces:
PreferenceVectorPreprocessor<V>, Preprocessor<V>, Parameterizable

public class HiSCPreprocessor<V extends RealVector<V,?>>
extends AbstractParameterizable
implements PreferenceVectorPreprocessor<V>

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

Author:
Elke Achtert

Field Summary
private  double alpha
          The maximum allowed variance along a coordinate axis.
static OptionID ALPHA_ID
          OptionID for ALPHA_PARAM
private  DoubleParameter ALPHA_PARAM
          Alpha parameter
static double DEFAULT_ALPHA
          The default value for alpha.
private  Integer k
          The number of nearest neighbors considered to determine the preference vector.
static OptionID K_ID
          OptionID for K_PARAM
private  IntParameter K_PARAM
          k Parameter
 
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, logger
 
Constructor Summary
HiSCPreprocessor()
          Provides a new HiSCPreprocessor that computes the preference vector of objects of a certain database.
 
Method Summary
private  BitSet determinePreferenceVector(Database<V> database, Integer id, List<Integer> neighborIDs, StringBuffer msg)
          Determines the preference vector according to the specified neighbor ids.
 double getAlpha()
          Returns the value of the alpha parameter (i.e. the maximum allowed variance along a coordinate axis).
 int getK()
          Returns the value of the k parameter (i.e. the number of nearest neighbors considered to determine the preference vector).
 void run(Database<V> database, boolean verbose, boolean time)
          This method executes the actual preprocessing step of this Preprocessor for the objects of the specified database.
 List<String> setParameters(List<String> args)
          Grabs all specified options from the option handler.
 String shortDescription()
          Returns a short description of the class.
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, 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.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters
 

Field Detail

DEFAULT_ALPHA

public static final double DEFAULT_ALPHA
The default value for alpha.

See Also:
Constant Field Values

ALPHA_ID

public static final OptionID ALPHA_ID
OptionID for ALPHA_PARAM


ALPHA_PARAM

private final DoubleParameter ALPHA_PARAM
Alpha parameter


K_ID

public static final OptionID K_ID
OptionID for K_PARAM


K_PARAM

private final IntParameter K_PARAM
k Parameter


alpha

private double alpha
The maximum allowed variance along a coordinate axis.


k

private Integer k
The number of nearest neighbors considered to determine the preference vector.

Constructor Detail

HiSCPreprocessor

public HiSCPreprocessor()
Provides a new HiSCPreprocessor that computes the preference vector of objects of a certain database.

Method Detail

run

public void run(Database<V> database,
                boolean verbose,
                boolean time)
Description copied from interface: Preprocessor
This method executes the actual preprocessing step of this Preprocessor for the objects of the specified database.

Specified by:
run in interface Preprocessor<V extends RealVector<V,?>>
Parameters:
database - the database for which the preprocessing is performed
verbose - flag to allow verbose messages while performing the algorithm
time - flag to request output of performance time

shortDescription

public String shortDescription()
Description copied from class: AbstractParameterizable
Returns a short description of the class.

Specified by:
shortDescription in interface Parameterizable
Overrides:
shortDescription in class AbstractParameterizable
Returns:
Description of the class

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
Description copied from class: AbstractParameterizable
Grabs all specified options from the option handler. Any extending class should call this method first and return the returned array without further changes, but after setting further required parameters. An example for overwriting this method taking advantage from the previously (in superclasses) defined options would be:

 {
   List remainingParameters = super.setParameters(args);
   // set parameters for your class
   // for example like this:
   if(isSet(MY_PARAM_VALUE_PARAM))
   {
      myParamValue = getParameterValue(MY_PARAM_VALUE_PARAM);
   }
   .
   .
   .
   return remainingParameters;
   // or in case of attributes requesting parameters themselves
   // return parameterizableAttribbute.setParameters(remainingParameters);
 }
 

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractParameterizable
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting

getAlpha

public double getAlpha()
Returns the value of the alpha parameter (i.e. the maximum allowed variance along a coordinate axis).

Returns:
the value of the alpha parameter

getK

public int getK()
Returns the value of the k parameter (i.e. the number of nearest neighbors considered to determine the preference vector).

Returns:
the value of the k parameter

determinePreferenceVector

private BitSet determinePreferenceVector(Database<V> database,
                                         Integer id,
                                         List<Integer> neighborIDs,
                                         StringBuffer msg)
Determines the preference vector according to the specified neighbor ids.

Parameters:
database - the database storing the objects
id - the id of the object for which the preference vector should be determined
neighborIDs - the ids of the neighbors
msg - a string buffer for debug messages
Returns:
the preference vector

Release 0.2 (2009-07-06_1820)