Record Class IsotonicMDS

java.lang.Object
java.lang.Record
smile.manifold.IsotonicMDS
Record Components:
stress - the objective function value.
coordinates - the principal coordinates

public record IsotonicMDS(double stress, double[][] coordinates) extends Record
Kruskal's non-metric MDS. In non-metric MDS, only the rank order of entries in the proximity matrix (not the actual dissimilarities) is assumed to contain the significant information. Hence, the distances of the final configuration should as far as possible be in the same rank order as the original data. Note that a perfect ordinal re-scaling of the data into distances is usually not possible. The relationship is typically found using isotonic regression.
  • Constructor Summary

    Constructors
    Constructor
    Description
    IsotonicMDS(double stress, double[][] coordinates)
    Creates an instance of a IsotonicMDS record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[][]
    Returns the value of the coordinates record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    of(double[][] proximity)
    Fits Kruskal's non-metric MDS with default k = 2, tolerance = 1E-4 and maxIter = 200.
    of(double[][] proximity, double[][] init, double tol, int maxIter)
    Fits Kruskal's non-metric MDS.
    of(double[][] proximity, int k)
    Fits Kruskal's non-metric MDS.
    of(double[][] proximity, int k, double tol, int maxIter)
    Fits Kruskal's non-metric MDS.
    of(double[][] proximity, Properties params)
    Fits Kruskal's non-metric MDS.
    double
    Returns the value of the stress record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • IsotonicMDS

      public IsotonicMDS(double stress, double[][] coordinates)
      Creates an instance of a IsotonicMDS record class.
      Parameters:
      stress - the value for the stress record component
      coordinates - the value for the coordinates record component
  • Method Details

    • of

      public static IsotonicMDS of(double[][] proximity)
      Fits Kruskal's non-metric MDS with default k = 2, tolerance = 1E-4 and maxIter = 200.
      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.
    • of

      public static IsotonicMDS of(double[][] proximity, int k)
      Fits Kruskal's non-metric MDS.
      Parameters:
      proximity - the non-negative proximity matrix of dissimilarities. The diagonal should be zero and all other elements should be positive and symmetric.
      k - the dimension of the projection.
      Returns:
      the model.
    • of

      public static IsotonicMDS of(double[][] proximity, Properties params)
      Fits Kruskal's non-metric MDS.
      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.
      params - the hyperparameters.
      Returns:
      the model.
    • of

      public static IsotonicMDS of(double[][] proximity, int k, double tol, int maxIter)
      Fits Kruskal's non-metric MDS.
      Parameters:
      proximity - the non-negative proximity matrix of dissimilarities. The diagonal should be zero and all other elements should be positive and symmetric.
      k - the dimension of the projection.
      tol - the tolerance for stopping iterations.
      maxIter - maximum number of iterations.
      Returns:
      the model.
    • of

      public static IsotonicMDS of(double[][] proximity, double[][] init, double tol, int maxIter)
      Fits Kruskal's non-metric MDS.
      Parameters:
      proximity - the non-negative 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.
      tol - the tolerance for stopping iterations.
      maxIter - maximum number of iterations.
      Returns:
      the model.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • stress

      public double stress()
      Returns the value of the stress record component.
      Returns:
      the value of the stress record component
    • coordinates

      public double[][] coordinates()
      Returns the value of the coordinates record component.
      Returns:
      the value of the coordinates record component