Record Class SammonMapping
- Record Components:
stress- the objective function value.coordinates- the principal coordinates
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 good 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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordSammon's mapping hyperparameters. -
Constructor Summary
ConstructorsConstructorDescriptionSammonMapping(double stress, double[][] coordinates) Creates an instance of aSammonMappingrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]Returns the value of thecoordinatesrecord component.final booleanIndicates whether some other object is "equal to" this one.static SammonMappingfit(double[][] proximity) Fits Sammon's mapping with default d = 2, step = 0.2, tolerance = 1E-4 and maxIter = 100.static SammonMappingfit(double[][] proximity, double[][] coordinates, SammonMapping.Options options) Fits Sammon's mapping.static SammonMappingfit(double[][] proximity, SammonMapping.Options options) Fits Sammon's mapping.final inthashCode()Returns a hash code value for this object.doublestress()Returns the value of thestressrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SammonMapping
public SammonMapping(double stress, double[][] coordinates) Creates an instance of aSammonMappingrecord class.- Parameters:
stress- the value for thestressrecord componentcoordinates- the value for thecoordinatesrecord component
-
-
Method Details
-
fit
Fits Sammon's mapping with default d = 2, step = 0.2, tolerance = 1E-4 and maxIter = 100.- Parameters:
proximity- the non-negative proximity matrix of dissimilarities. The diagonal should be zero and all other elements should be positive and symmetric.- Returns:
- the model.
-
fit
Fits Sammon's mapping.- Parameters:
proximity- the non-negative proximity matrix of dissimilarities. The diagonal should be zero and all other elements should be positive and symmetric.options- the hyperparameters.- Returns:
- the model.
-
fit
public static SammonMapping fit(double[][] proximity, double[][] coordinates, SammonMapping.Options options) Fits Sammon's mapping.- Parameters:
proximity- the non-negative proximity matrix of dissimilarities. The diagonal should be zero and all other elements should be positive and symmetric.coordinates- the initial projected coordinates, of which the column size is the projection dimension. It will be modified.options- the hyperparameters.- Returns:
- the model.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
stress
-
coordinates
public double[][] coordinates()Returns the value of thecoordinatesrecord component.- Returns:
- the value of the
coordinatesrecord component
-