pub struct SpectralEmbedding { /* private fields */ }Expand description
Spectral Embedding (Laplacian Eigenmaps) configuration.
Holds hyperparameters for the spectral embedding algorithm. Call
Fit::fit to compute the Laplacian eigenmap and obtain a
FittedSpectralEmbedding.
Implementations§
Source§impl SpectralEmbedding
impl SpectralEmbedding
Sourcepub fn new(n_components: usize) -> Self
pub fn new(n_components: usize) -> Self
Create a new SpectralEmbedding with n_components dimensions.
The default affinity is RBF { gamma: 1.0 }.
Sourcepub fn with_affinity(self, affinity: Affinity) -> Self
pub fn with_affinity(self, affinity: Affinity) -> Self
Set the affinity function.
Sourcepub fn n_components(&self) -> usize
pub fn n_components(&self) -> usize
Return the configured number of components.
Trait Implementations§
Source§impl Clone for SpectralEmbedding
impl Clone for SpectralEmbedding
Source§fn clone(&self) -> SpectralEmbedding
fn clone(&self) -> SpectralEmbedding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpectralEmbedding
impl Debug for SpectralEmbedding
Source§impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ()> for SpectralEmbedding
impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ()> for SpectralEmbedding
Source§fn fit(
&self,
x: &Array2<f64>,
_y: &(),
) -> Result<FittedSpectralEmbedding, FerroError>
fn fit( &self, x: &Array2<f64>, _y: &(), ) -> Result<FittedSpectralEmbedding, FerroError>
Fit spectral embedding by building the affinity matrix, computing the normalized Laplacian, and extracting the bottom eigenvectors.
§Errors
FerroError::InvalidParameterifn_componentsis zero or too large.FerroError::InsufficientSamplesif there are fewer than 2 samples.
Source§type Fitted = FittedSpectralEmbedding
type Fitted = FittedSpectralEmbedding
The fitted model type returned by
fit.Source§type Error = FerroError
type Error = FerroError
The error type returned by
fit.Auto Trait Implementations§
impl Freeze for SpectralEmbedding
impl RefUnwindSafe for SpectralEmbedding
impl Send for SpectralEmbedding
impl Sync for SpectralEmbedding
impl Unpin for SpectralEmbedding
impl UnsafeUnpin for SpectralEmbedding
impl UnwindSafe for SpectralEmbedding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more