Struct linfa_tsne::TSneParams

source ·
pub struct TSneParams<F, R>(/* private fields */);

Implementations§

source§

impl<F: Float> TSneParams<F, SmallRng>

source

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.5
  • perplexity: 5.0
  • max_iter: 2000
  • rng: SmallRng with seed 42
source§

impl<F: Float, R: Rng + Clone> TSneParams<F, R>

source

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.5
  • perplexity: 5.0
  • max_iter: 2000
source

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.

source

pub fn perplexity(self, perplexity: F) -> Self

Set the perplexity of the t-SNE algorithm

source

pub fn max_iter(self, max_iter: usize) -> Self

Set the maximal number of iterations

source

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>

source§

fn clone(&self) -> TSneParams<F, R>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: Debug, R: Debug> Debug for TSneParams<F, R>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<F: Float, R> ParamGuard for TSneParams<F, R>

source§

fn check_ref(&self) -> Result<&Self::Checked, Self::Error>

Validates parameters

§

type Checked = TSneValidParams<F, R>

The checked hyperparameters
§

type Error = TSneError

Error type resulting from failed hyperparameter checking
source§

fn check(self) -> Result<Self::Checked, Self::Error>

Checks the hyperparameters and returns the checked hyperparameters if successful
source§

fn check_unwrap(self) -> Self::Checked
where Self: Sized,

Calls check() and unwraps the result
source§

impl<F: PartialEq, R: PartialEq> PartialEq for TSneParams<F, R>

source§

fn eq(&self, other: &TSneParams<F, R>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<F: Float, R: Rng + Clone> Transformer<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, Result<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, TSneError>> for TSneParams<F, R>

source§

fn transform(&self, x: Array2<F>) -> Result<Array2<F>>

source§

impl<T, F: Float, R: Rng + Clone> Transformer<DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>, Result<DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>, TSneError>> for TSneParams<F, R>

source§

fn transform( &self, ds: DatasetBase<Array2<F>, T> ) -> Result<DatasetBase<Array2<F>, T>>

source§

impl<F, R> StructuralPartialEq for TSneParams<F, R>

Auto Trait Implementations§

§

impl<F, R> RefUnwindSafe for TSneParams<F, R>

§

impl<F, R> Send for TSneParams<F, R>
where F: Send, R: Send,

§

impl<F, R> Sync for TSneParams<F, R>
where F: Sync, R: Sync,

§

impl<F, R> Unpin for TSneParams<F, R>
where F: Unpin, R: Unpin,

§

impl<F, R> UnwindSafe for TSneParams<F, R>
where F: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V