de.lmu.ifi.dbs.elki.algorithm
Class KNNDistanceOrder<O,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<R>
      extended by de.lmu.ifi.dbs.elki.algorithm.AbstractDistanceBasedAlgorithm<O,D,KNNDistanceOrderResult<D>>
          extended by de.lmu.ifi.dbs.elki.algorithm.KNNDistanceOrder<O,D>
Type Parameters:
O - the type of DatabaseObjects handled by this Algorithm
D - the type of Distance used by this Algorithm
All Implemented Interfaces:
Algorithm, InspectionUtilFrequentlyScanned, Parameterizable

@Title(value="KNN-Distance-Order")
@Description(value="Assesses the knn distances for a specified k and orders them.")
public class KNNDistanceOrder<O,D extends Distance<D>>
extends AbstractDistanceBasedAlgorithm<O,D,KNNDistanceOrderResult<D>>

Provides an order of the kNN-distances for all objects within the database.


Nested Class Summary
static class KNNDistanceOrder.Parameterizer<O,D extends Distance<D>>
          Parameterization class.
 
Field Summary
private  int k
          Holds the value of K_ID.
static OptionID K_ID
          Parameter to specify the distance of the k-distant object to be assessed, must be an integer greater than 0.
private static Logging logger
          The logger for this class.
private  double percentage
          Holds the value of PERCENTAGE_ID.
static OptionID PERCENTAGE_ID
          Parameter to specify the average percentage of distances randomly chosen to be provided in the result, must be a double greater than 0 and less than or equal to 1.
 
Fields inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractDistanceBasedAlgorithm
DISTANCE_FUNCTION_ID
 
Constructor Summary
KNNDistanceOrder(DistanceFunction<O,D> distanceFunction, int k, double percentage)
          Constructor.
 
Method Summary
 TypeInformation[] getInputTypeRestriction()
          Get the input type restriction used for negotiating the data query.
protected  Logging getLogger()
          Get the (STATIC) logger for this class.
 KNNDistanceOrderResult<D> run(Database database, Relation<O> relation)
          Provides an order of the kNN-distances for all objects within the specified database.
 
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractDistanceBasedAlgorithm
getDistanceFunction
 
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm
makeParameterDistanceFunction, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final Logging logger
The logger for this class.


K_ID

public static final OptionID K_ID
Parameter to specify the distance of the k-distant object to be assessed, must be an integer greater than 0.


k

private int k
Holds the value of K_ID.


PERCENTAGE_ID

public static final OptionID PERCENTAGE_ID
Parameter to specify the average percentage of distances randomly chosen to be provided in the result, must be a double greater than 0 and less than or equal to 1.


percentage

private double percentage
Holds the value of PERCENTAGE_ID.

Constructor Detail

KNNDistanceOrder

public KNNDistanceOrder(DistanceFunction<O,D> distanceFunction,
                        int k,
                        double percentage)
Constructor.

Parameters:
distanceFunction - Distance function
k - k Parameter
percentage - percentage parameter
Method Detail

run

public KNNDistanceOrderResult<D> run(Database database,
                                     Relation<O> relation)
Provides an order of the kNN-distances for all objects within the specified database.

Parameters:
database - Database
relation - Relation
Returns:
Result

getInputTypeRestriction

public TypeInformation[] getInputTypeRestriction()
Description copied from class: AbstractAlgorithm
Get the input type restriction used for negotiating the data query.

Specified by:
getInputTypeRestriction in interface Algorithm
Specified by:
getInputTypeRestriction in class AbstractAlgorithm<KNNDistanceOrderResult<D extends Distance<D>>>
Returns:
Type restriction

getLogger

protected Logging getLogger()
Description copied from class: AbstractAlgorithm
Get the (STATIC) logger for this class.

Specified by:
getLogger in class AbstractAlgorithm<KNNDistanceOrderResult<D extends Distance<D>>>
Returns:
the static logger

Release 0.4.0 (2011-09-20_1324)