Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities.scaling.outlier
Class MultiplicativeInverseScaling

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.scaling.outlier.MultiplicativeInverseScaling
All Implemented Interfaces:
Parameterizable, OutlierScalingFunction, ScalingFunction

public class MultiplicativeInverseScaling
extends Object
implements OutlierScalingFunction

Scaling function to invert values basically by computing 1/x, but in a variation that maps the values to the [0:1] interval and avoiding division by 0. The exact formula can be written as 1 / (value * max_{x!=0}(1 / abs(x))) = min_{x != 0}(abs(x)) / x with 1 / 0 := 1

Author:
Erich Schubert

Field Summary
(package private)  double scaleval
          Scaling value, set by prepare(de.lmu.ifi.dbs.elki.database.Database, de.lmu.ifi.dbs.elki.result.Result, de.lmu.ifi.dbs.elki.result.outlier.OutlierResult).
 
Constructor Summary
MultiplicativeInverseScaling()
          Constructor, adhering to Parameterizable
 
Method Summary
 double getMax()
          Get maximum resulting value.
 double getMin()
          Get minimum resulting value.
 double getScaled(double value)
          Transform a given value using the scaling function.
private static double getScaleValue(Database<?> db, OutlierResult or)
          Compute the scaling value in a linear scan over the annotation.
 void prepare(Database<?> db, Result result, OutlierResult or)
          Prepare is called once for each data set, before getScaled() will be called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scaleval

double scaleval
Scaling value, set by prepare(de.lmu.ifi.dbs.elki.database.Database, de.lmu.ifi.dbs.elki.result.Result, de.lmu.ifi.dbs.elki.result.outlier.OutlierResult).

Constructor Detail

MultiplicativeInverseScaling

public MultiplicativeInverseScaling()
Constructor, adhering to Parameterizable

Method Detail

getScaled

public double getScaled(double value)
Description copied from interface: ScalingFunction
Transform a given value using the scaling function.

Specified by:
getScaled in interface ScalingFunction
Parameters:
value - Original value
Returns:
Scaled value

prepare

public void prepare(Database<?> db,
                    Result result,
                    OutlierResult or)
Description copied from interface: OutlierScalingFunction
Prepare is called once for each data set, before getScaled() will be called. This function can be used to extract global parameters such as means, minimums or maximums from the Database, Result or Annotation.

Specified by:
prepare in interface OutlierScalingFunction
Parameters:
db - Database used
result - Result object
or - Outlier result to use

getScaleValue

private static double getScaleValue(Database<?> db,
                                    OutlierResult or)
Compute the scaling value in a linear scan over the annotation.

Parameters:
db - Database
or - Outlier result
Returns:
Scaling value.

getMin

public double getMin()
Description copied from interface: ScalingFunction
Get minimum resulting value. May be Double.NaN or Double.NEGATIVE_INFINITY.

Specified by:
getMin in interface ScalingFunction
Returns:
Minimum resulting value.

getMax

public double getMax()
Description copied from interface: ScalingFunction
Get maximum resulting value. May be Double.NaN or Double.POSITIVE_INFINITY.

Specified by:
getMax in interface ScalingFunction
Returns:
Maximum resulting value.

Release 0.3 (2010-03-31_1612)