Struct linfa_tsne::TSneParams
source · pub struct TSneParams<F, R>(/* private fields */);
Implementations§
source§impl<F: Float> TSneParams<F, SmallRng>
impl<F: Float> TSneParams<F, SmallRng>
sourcepub fn embedding_size(embedding_size: usize) -> TSneParams<F, SmallRng>
pub fn embedding_size(embedding_size: usize) -> TSneParams<F, SmallRng>
Create a t-SNE param set with given embedding size
Defaults to:
approx_threshold
: 0.5perplexity
: 5.0max_iter
: 2000rng
: SmallRng with seed 42
source§impl<F: Float, R: Rng + Clone> TSneParams<F, R>
impl<F: Float, R: Rng + Clone> TSneParams<F, R>
sourcepub fn embedding_size_with_rng(
embedding_size: usize,
rng: R
) -> TSneParams<F, R>
pub fn embedding_size_with_rng( embedding_size: usize, rng: R ) -> TSneParams<F, R>
Create a t-SNE param set with given embedding size and random number generator
Defaults to:
approx_threshold
: 0.5perplexity
: 5.0max_iter
: 2000
sourcepub fn approx_threshold(self, threshold: F) -> Self
pub fn approx_threshold(self, threshold: F) -> Self
Set the approximation threshold of the Barnes Hut algorithm
The threshold decides whether a cluster centroid can be used as a summary for the whole area. This was proposed by Barnes and Hut and compares the ratio of cell radius and distance to a factor theta. This threshold lies in range (0, inf) where a value of 0 disables approximation and a positive value approximates the gradient with the cell center.
sourcepub fn perplexity(self, perplexity: F) -> Self
pub fn perplexity(self, perplexity: F) -> Self
Set the perplexity of the t-SNE algorithm
sourcepub fn preliminary_iter(self, num_iter: usize) -> Self
pub fn preliminary_iter(self, num_iter: usize) -> Self
Set the number of iterations after which the true P distribution is used
At the beginning of the training process it is useful to multiply the P distribution values by a certain factor (here 12x) to get the global view right. After this number of iterations the true P distribution value is used. If None the number is estimated.
Trait Implementations§
source§impl<F: Clone, R: Clone> Clone for TSneParams<F, R>
impl<F: Clone, R: Clone> Clone for TSneParams<F, R>
source§fn clone(&self) -> TSneParams<F, R>
fn clone(&self) -> TSneParams<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: Float, R> ParamGuard for TSneParams<F, R>
impl<F: Float, R> ParamGuard for TSneParams<F, R>
§type Checked = TSneValidParams<F, R>
type Checked = TSneValidParams<F, R>
source§fn check(self) -> Result<Self::Checked, Self::Error>
fn check(self) -> Result<Self::Checked, Self::Error>
source§fn check_unwrap(self) -> Self::Checkedwhere
Self: Sized,
fn check_unwrap(self) -> Self::Checkedwhere
Self: Sized,
check()
and unwraps the resultsource§impl<F: PartialEq, R: PartialEq> PartialEq for TSneParams<F, R>
impl<F: PartialEq, R: PartialEq> PartialEq for TSneParams<F, R>
source§fn eq(&self, other: &TSneParams<F, R>) -> bool
fn eq(&self, other: &TSneParams<F, R>) -> bool
self
and other
values to be equal, and is used
by ==
.