Imp
[using it]
Interface Manipulation Package v4.0 (2008-06-25) a-projector ©copyright Author


imp.classifier
Class Mapping

java.lang.Object
  extended by imp.classifier.Mapping

public class Mapping
extends Object

Defines a numerical data mapping.

Formally this may be defined as a function: double[dim] -> double[dim] which associated to a numerical value vector a low-dimensional representation of the data set.
Very easily a user construct a mapping and: as defined by manifold learning methods. The present class provides an interface for manifold learning mechanisms and implements local geodesic distance estimation.


Constructor Summary
Mapping(double step, int size)
          Constructs a mapping for the given parameter.
 
Method Summary
 Mapping add(double[] data)
          Add a data sample and return this.
 double[] getData(int index)
          Gets the n-th input data point.
 int getDim()
          Gets the reduce representation dimension.
 double getDistance(int i1, int i2)
          Gets the local geodesic distance between two data point.
 double getDotprod(int i1, int i2)
          Gets the local geodesic dot-product between two data point.
 double[] getMap(int index)
          Gets the reduce representation of a given input.
 int[] getNeighbors(int index)
          Gets the local neighborhood of the n-th input data point.
 int size()
          Returns the number of data input.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mapping

public Mapping(double step,
               int size)
Constructs a mapping for the given parameter.

Parameters:
step - [optional, default is huge] Maximal distance between two points in the same neighborhood.
size - [optional, default is huge] Maximal size of a neighborhood. Either a size or a step must be defined.
Method Detail

add

public Mapping add(double[] data)
Add a data sample and return this.

Parameters:
data - data input value.

getData

public double[] getData(int index)
Gets the n-th input data point.

Parameters:
index - data index.
Returns:
The input data point.

getDim

public int getDim()
Gets the reduce representation dimension.
Manifold learning algorithms override this method.


getDistance

public double getDistance(int i1,
                          int i2)
Gets the local geodesic distance between two data point.

Parameters:
i1 - data point index.
i2 - data point index.
Returns:
The Euclidean distance between the data points if in the same neighborhood, else -1.

getDotprod

public double getDotprod(int i1,
                         int i2)
Gets the local geodesic dot-product between two data point.

Parameters:
i1 - data point index.
i2 - data point index.
Returns:
The Euclidean dotprod between the data points if in the same neighborhood, else 0;

getMap

public double[] getMap(int index)
Gets the reduce representation of a given input.
Manifold learning algorithms override this method.

Parameters:
index - data index.
Returns:
A low-dimensional representation of a data.

getNeighbors

public int[] getNeighbors(int index)
Gets the local neighborhood of the n-th input data point.

Parameters:
index - data index.
Returns:
An array of the index of the data points in the neighborhood, in distance increasing order.

size

public int size()
Returns the number of data input.