public class SammonMapping
extends java.lang.Object
Ideally when we project from a high dimensional space to a low dimensional space the image would be geometrically congruent to the original figure. This is called an isometric projection. Unfortunately it is rarely possible to isometrically project objects down into lower dimensional spaces. Instead of trying to achieve equality between corresponding inter-point distances we can minimize the difference between corresponding inter-point distances. This is one goal of the Sammon's mapping algorithm. A second goal of the Sammon's mapping algorithm is to preserve the topology as best as possible by giving greater emphasize to smaller interpoint distances. The Sammon's mapping algorithm has the advantage that whenever it is possible to isometrically project an object into a lower dimensional space it will be isometrically projected into the lower dimensional space. But whenever an object cannot be projected down isometrically the Sammon's mapping projects it down to reduce the distortion in interpoint distances and to limit the change in the topology of the object.
The projection cannot be solved in a closed form and may be found by an iterative algorithm such as gradient descent suggested by Sammon. Kohonen also provides a heuristic that is simple and works reasonably well.
Modifier and Type | Field and Description |
---|---|
double[][] |
coordinates
The coordinates.
|
double |
stress
The final stress achieved.
|
Constructor and Description |
---|
SammonMapping(double stress,
double[][] coordinates)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static SammonMapping |
of(double[][] proximity)
Fits Sammon's mapping with default k = 2, lambda = 0.2, tolerance = 1E-4 and maxIter = 100.
|
static SammonMapping |
of(double[][] proximity,
double[][] init,
double lambda,
double tol,
double stepTol,
int maxIter)
Fits Sammon's mapping.
|
static SammonMapping |
of(double[][] proximity,
int k)
Fits Sammon's mapping.
|
static SammonMapping |
of(double[][] proximity,
int k,
double lambda,
double tol,
double stepTol,
int maxIter)
Fits Sammon's mapping.
|
static SammonMapping |
of(double[][] proximity,
java.util.Properties prop)
Fits Sammon's mapping.
|
public final double stress
public final double[][] coordinates
public SammonMapping(double stress, double[][] coordinates)
stress
- the objective function value.coordinates
- the principal coordinatespublic static SammonMapping of(double[][] proximity)
proximity
- the nonnegative proximity matrix of dissimilarities. The
diagonal should be zero and all other elements should be positive and symmetric.public static SammonMapping of(double[][] proximity, int k)
proximity
- the nonnegative proximity matrix of dissimilarities. The
diagonal should be zero and all other elements should be positive and symmetric.k
- the dimension of the projection.public static SammonMapping of(double[][] proximity, java.util.Properties prop)
proximity
- the nonnegative proximity matrix of dissimilarities. The
diagonal should be zero and all other elements should be positive and
symmetric. For pairwise distances matrix, it should be just the plain
distance, not squared.public static SammonMapping of(double[][] proximity, int k, double lambda, double tol, double stepTol, int maxIter)
proximity
- the nonnegative proximity matrix of dissimilarities. The
diagonal should be zero and all other elements should be positive and symmetric.k
- the dimension of the projection.lambda
- initial value of the step size constant in diagonal Newton method.tol
- the tolerance on objective function for stopping iterations.stepTol
- the tolerance on step size.maxIter
- maximum number of iterations.public static SammonMapping of(double[][] proximity, double[][] init, double lambda, double tol, double stepTol, int maxIter)
proximity
- the nonnegative proximity matrix of dissimilarities. The
diagonal should be zero and all other elements should be positive and symmetric.init
- the initial projected coordinates, of which the column
size is the projection dimension. It will be modified.lambda
- initial value of the step size constant in diagonal Newton method.tol
- the tolerance for stopping iterations.stepTol
- the tolerance on step size.maxIter
- maximum number of iterations.