Record Class TSNE

java.lang.Object
java.lang.Record
smile.manifold.TSNE
Record Components:
cost - the objective function value.
coordinates - the principal coordinates
All Implemented Interfaces:
Serializable

public record TSNE(double cost, double[][] coordinates) extends Record implements Serializable
The t-distributed stochastic neighbor embedding. The t-SNE is a nonlinear dimensionality reduction technique that is particularly well suited for embedding high-dimensional data into a space of two or three dimensions, which can then be visualized in a scatter plot. Specifically, it models each high-dimensional object by a two- or three-dimensional point in such a way that similar objects are modeled by nearby points and dissimilar objects are modeled by distant points.

The t-SNE algorithm comprises two main stages. First, t-SNE constructs a probability distribution over pairs of high-dimensional objects in such a way that similar objects have a high probability of being picked, whilst dissimilar points have an infinitesimal probability of being picked. Second, t-SNE defines a similar probability distribution over the points in the low-dimensional map, and it minimizes the Kullback–Leibler divergence between the two distributions with respect to the locations of the points in the map. Note that while the original algorithm uses the Euclidean distance between objects as the base of its similarity metric, this should be changed as appropriate.

References

  1. L.J.P. van der Maaten. Accelerating t-SNE using Tree-Based Algorithms. Journal of Machine Learning Research 15(Oct):3221-3245, 2014.
  2. L.J.P. van der Maaten and G.E. Hinton. Visualizing Non-Metric Similarities in Multiple Maps. Machine Learning 87(1):33-55, 2012.
  3. L.J.P. van der Maaten. Learning a Parametric Embedding by Preserving Local Structure. In Proceedings of the Twelfth International Conference on Artificial Intelligence & Statistics (AI-STATS), JMLR W&CP 5:384-391, 2009.
  4. L.J.P. van der Maaten and G.E. Hinton. Visualizing High-Dimensional Data Using t-SNE. Journal of Machine Learning Research 9(Nov):2579-2605, 2008.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    The t-SNE hyperparameters.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    double[][]
    Returns the value of the coordinates record component.
    double
    Returns the value of the cost record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    static TSNE
    fit(double[][] X)
    Fits t-SNE for given number of iterations.
    static TSNE
    fit(double[][] X, TSNE.Options options)
    Fits t-SNE for given number of iterations.
    final int
    Returns a hash code value for this object.
    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

    • TSNE

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

    • fit

      public static TSNE fit(double[][] X)
      Fits t-SNE for given number of iterations.
      Parameters:
      X - the input data. If X is a square matrix, it is assumed to be the squared distance/dissimilarity matrix.
      Returns:
      the model.
    • fit

      public static TSNE fit(double[][] X, TSNE.Options options)
      Fits t-SNE for given number of iterations.
      Parameters:
      X - the input data. If X is a square matrix, it is assumed to be the squared distance/dissimilarity matrix.
      options - the hyperparameters.
      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.
    • cost

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

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