Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.application.visualization
Class KNNExplorer<O extends NumberVector<O,?>,N extends NumberDistance<N,D>,D extends Number>

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.application.AbstractApplication
              extended by de.lmu.ifi.dbs.elki.application.visualization.KNNExplorer<O,N,D>
Type Parameters:
O - Object type
All Implemented Interfaces:
Parameterizable

public class KNNExplorer<O extends NumberVector<O,?>,N extends NumberDistance<N,D>,D extends Number>
extends AbstractApplication

User application to explore the k Nearest Neighbors for a given data set and distance function. When selecting one or more data entries, the nearest neighbors each are determined and visualized.

Reference:
Elke Achtert, Thomas Bernecker, Hans-Peter Kriegel, Erich Schubert, Arthur Zimek:
ELKI in Time: ELKI 0.2 for the Performance Evaluation of Distance Measures for Time Series.
In Proc. 11th International Symposium on Spatial and Temporal Databases (SSTD 2009), Aalborg, Denmark, 2009.

Usage example:

Main invocation:
java -cp elki.jar de.lmu.ifi.dbs.elki.visualization.KNNExplorer

The application supports the usual parametrization, in particular parameters -dbc.in and -explorer.distancefunction to select an input file and the distance function to explore.

Author:
Erich Schubert

Nested Class Summary
(package private)  class KNNExplorer.ExplorerWindow
           
 
Field Summary
private  ClassParameter<DatabaseConnection<O>> DATABASE_CONNECTION_PARAM
          Parameter to specify the database connection to be used, must extend DatabaseConnection.
private  DatabaseConnection<O> databaseConnection
          Holds the database connection to have the algorithm run with.
static OptionID DISTANCE_FUNCTION_ID
          OptionID for DISTANCE_FUNCTION_PARAM
protected  ClassParameter<DistanceFunction<O,N>> DISTANCE_FUNCTION_PARAM
          Parameter to specify the distance function to determine the distance between database objects, must extend DistanceFunction.
private  DistanceFunction<O,N> distanceFunction
          Holds the instance of the distance function specified by DISTANCE_FUNCTION_PARAM.
private  Normalization<O> normalization
          A normalization - per default no normalization is used.
private  ClassParameter<Normalization<O>> NORMALIZATION_PARAM
          Optional Parameter to specify a normalization in order to use a database with normalized values.
 
Fields inherited from class de.lmu.ifi.dbs.elki.application.AbstractApplication
INFORMATION
 
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
KNNExplorer()
           
 
Method Summary
static void main(String[] args)
          Main method to run this wrapper.
 void run()
          Runs the application.
 List<String> setParameters(List<String> args)
          Grabs all specified options from the option handler.
 
Methods inherited from class de.lmu.ifi.dbs.elki.application.AbstractApplication
getRemainingParameters, isVerbose, runCLIApplication, usage
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription
 
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
 

Field Detail

DATABASE_CONNECTION_PARAM

private final ClassParameter<DatabaseConnection<O extends NumberVector<O,?>>> DATABASE_CONNECTION_PARAM
Parameter to specify the database connection to be used, must extend DatabaseConnection.

Key: -dbc

Default value: FileBasedDatabaseConnection


NORMALIZATION_PARAM

private final ClassParameter<Normalization<O extends NumberVector<O,?>>> NORMALIZATION_PARAM
Optional Parameter to specify a normalization in order to use a database with normalized values.

Key: -norm


DISTANCE_FUNCTION_ID

public static final OptionID DISTANCE_FUNCTION_ID
OptionID for DISTANCE_FUNCTION_PARAM


DISTANCE_FUNCTION_PARAM

protected final ClassParameter<DistanceFunction<O extends NumberVector<O,?>,N extends NumberDistance<N,D>>> DISTANCE_FUNCTION_PARAM
Parameter to specify the distance function to determine the distance between database objects, must extend DistanceFunction.

Key: -explorer.distancefunction

Default value: EuclideanDistanceFunction


databaseConnection

private DatabaseConnection<O extends NumberVector<O,?>> databaseConnection
Holds the database connection to have the algorithm run with.


distanceFunction

private DistanceFunction<O extends NumberVector<O,?>,N extends NumberDistance<N,D>> distanceFunction
Holds the instance of the distance function specified by DISTANCE_FUNCTION_PARAM.


normalization

private Normalization<O extends NumberVector<O,?>> normalization
A normalization - per default no normalization is used.

Constructor Detail

KNNExplorer

public KNNExplorer()
Method Detail

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 AbstractApplication
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting
See Also:
AbstractParameterizable.setParameters(java.util.List)

run

public void run()
         throws IllegalStateException
Description copied from class: AbstractApplication
Runs the application.

Specified by:
run in class AbstractApplication
Throws:
IllegalStateException

main

public static void main(String[] args)
Main method to run this wrapper.

Parameters:
args - the arguments to run this wrapper

Release 0.2 (2009-07-06_1820)