Struct linfa_tsne::TSneValidParams
source · pub struct TSneValidParams<F, R> { /* private fields */ }
Expand description
The t-SNE algorithm is a statistical method for visualizing high-dimensional data by giving each datapoint a location in a two or three-dimensional map.
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 are assigned a higher probability while dissimilar points are assigned a lower probability. Second, t-SNE defines a similar probability distribution over the points in the low-dimensional map, and it minimizes the Kullback–Leibler divergence (KL divergence) between the two distributions with respect to the locations of the points in the map.
This crate wraps the bhtsne crate for the linfa project. It implements the exact t-SNE, as well as the Barnes-Hut approximation.
Examples
use linfa::traits::Transformer;
use linfa_tsne::TSneParams;
let ds = linfa_datasets::iris();
let ds = TSneParams::embedding_size(2)
.perplexity(10.0)
.approx_threshold(0.6)
.transform(ds);
A verified hyper-parameter set ready for prediction
Implementations§
source§impl<F: Float, R> TSneValidParams<F, R>
impl<F: Float, R> TSneValidParams<F, R>
pub fn embedding_size(&self) -> usize
pub fn approx_threshold(&self) -> F
pub fn perplexity(&self) -> F
pub fn max_iter(&self) -> usize
pub fn preliminary_iter(&self) -> &Option<usize>
pub fn rng(&self) -> &R
Trait Implementations§
source§impl<F: Clone, R: Clone> Clone for TSneValidParams<F, R>
impl<F: Clone, R: Clone> Clone for TSneValidParams<F, R>
source§fn clone(&self) -> TSneValidParams<F, R>
fn clone(&self) -> TSneValidParams<F, R>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<F: PartialEq, R: PartialEq> PartialEq for TSneValidParams<F, R>
impl<F: PartialEq, R: PartialEq> PartialEq for TSneValidParams<F, R>
source§fn eq(&self, other: &TSneValidParams<F, R>) -> bool
fn eq(&self, other: &TSneValidParams<F, R>) -> bool
self
and other
values to be equal, and is used
by ==
.