Record Class MDS
java.lang.Object
java.lang.Record
smile.manifold.MDS
- Record Components:
scores- the component scores.proportion- the proportion of variance contained in each principal component.coordinates- the principal coordinates
Classical multidimensional scaling, also known as principal coordinates
analysis. Given a matrix of dissimilarities (e.g. pairwise distances), MDS
finds a set of points in low dimensional space that well-approximates the
dissimilarities. We are not restricted to using Euclidean
distance metric. However, when Euclidean distances are used MDS is
equivalent to PCA.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMDS(double[] scores, double[] proportion, double[][] coordinates) Creates an instance of aMDSrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]Returns the value of thecoordinatesrecord component.final booleanIndicates whether some other object is "equal to" this one.static MDSfit(double[][] proximity) Fits the classical multidimensional scaling.static MDSfit(double[][] proximity, MDS.Options options) Fits the classical multidimensional scaling.final inthashCode()Returns a hash code value for this object.double[]Returns the value of theproportionrecord component.double[]scores()Returns the value of thescoresrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MDS
public MDS(double[] scores, double[] proportion, double[][] coordinates) Creates an instance of aMDSrecord class.- Parameters:
scores- the value for thescoresrecord componentproportion- the value for theproportionrecord componentcoordinates- the value for thecoordinatesrecord component
-
-
Method Details
-
fit
Fits the classical multidimensional scaling. Map original data into 2-dimensional Euclidean space.- Parameters:
proximity- the non-negative 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.- Returns:
- the model.
-
fit
Fits the classical multidimensional scaling.- Parameters:
proximity- the non-negative 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.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. All components in this record class are compared withObjects::equals(Object,Object). -
scores
-
proportion
public double[] proportion()Returns the value of theproportionrecord component.- Returns:
- the value of the
proportionrecord component
-
coordinates
public double[][] coordinates()Returns the value of thecoordinatesrecord component.- Returns:
- the value of the
coordinatesrecord component
-