[docs]classTSNE(DimRedMethod):""" t-distributed Stochastic Neighbor Embedding (t-SNE) method which wraps scikit-learn's TSNE. It can be useful for visualizing high-dimensional data. Input arguments for the method are the same as supported by scikit-learn (see `TSNE scikit-learn documentation <https://scikit-learn.org/stable/modules/generated/sklearn.manifold.TSNE.html#sklearn.manifold.TSNE>`_ for details). **YAML specification:** .. indent with spaces .. code-block:: yaml definitions: ml_methods: my_tsne: TSNE: # arguments as defined by scikit-learn n_components: 2 init: pca """def__init__(self,name:str=None,**kwargs):super().__init__(name)self.method_kwargs=kwargsself.method=SklearnTSNE(**self.method_kwargs)
[docs]deftransform(self,dataset:Dataset):logging.warning(f"{TSNE.__name__}: calling transform method of TSNE, but it only supports fit_transform. "f"Fitting the model and returning the transformed data...")returnself.method.fit_transform(dataset.encoded_data.examples)