Package smile.manifold
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
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
- L.J.P. van der Maaten. Accelerating t-SNE using Tree-Based Algorithms. Journal of Machine Learning Research 15(Oct):3221-3245, 2014.
- L.J.P. van der Maaten and G.E. Hinton. Visualizing Non-Metric Similarities in Multiple Maps. Machine Learning 87(1):33-55, 2012.
- 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.
- 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 -
Constructor Summary
ConstructorsConstructorDescriptionTSNE
(double cost, double[][] coordinates) Creates an instance of aTSNE
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]
Returns the value of thecoordinates
record component.double
cost()
Returns the value of thecost
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
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
TSNE
public TSNE(double cost, double[][] coordinates) Creates an instance of aTSNE
record class.- Parameters:
cost
- the value for thecost
record componentcoordinates
- the value for thecoordinates
record component
-
-
Method Details
-
fit
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
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
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. -
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. -
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 '=='. -
cost
public double cost()Returns the value of thecost
record component.- Returns:
- the value of the
cost
record component
-
coordinates
public double[][] coordinates()Returns the value of thecoordinates
record component.- Returns:
- the value of the
coordinates
record component
-