pub struct SpectralEmbedding { /* private fields */ }
Expand description
Spectral Embedding dimensionality reduction
Spectral embedding uses the eigenvectors of the graph Laplacian matrix to find a low-dimensional representation that preserves local neighborhood structure.
Implementations§
Source§impl SpectralEmbedding
impl SpectralEmbedding
Sourcepub fn new(n_components: usize, affinitymethod: AffinityMethod) -> Self
pub fn new(n_components: usize, affinitymethod: AffinityMethod) -> Self
Creates a new SpectralEmbedding instance
§Arguments
n_components
- Number of dimensions in the embedding spaceaffinity_method
- Method for constructing the affinity matrix
Sourcepub fn with_n_neighbors(self, nneighbors: usize) -> Self
pub fn with_n_neighbors(self, nneighbors: usize) -> Self
Set the number of neighbors for KNN graph construction
Sourcepub fn with_gamma(self, gamma: f64) -> Self
pub fn with_gamma(self, gamma: f64) -> Self
Set the gamma parameter for Gaussian kernel
Sourcepub fn with_epsilon(self, epsilon: f64) -> Self
pub fn with_epsilon(self, epsilon: f64) -> Self
Set the epsilon parameter for epsilon-ball graph
Sourcepub fn with_normalized(self, normalized: bool) -> Self
pub fn with_normalized(self, normalized: bool) -> Self
Set whether to use normalized Laplacian
Sourcepub fn with_random_state(self, seed: u64) -> Self
pub fn with_random_state(self, seed: u64) -> Self
Set random seed for reproducibility
Sourcepub fn affinity_matrix(&self) -> Option<&Array2<f64>>
pub fn affinity_matrix(&self) -> Option<&Array2<f64>>
Returns the affinity matrix
Sourcepub fn eigenvalues(&self) -> Option<&Array1<f64>>
pub fn eigenvalues(&self) -> Option<&Array1<f64>>
Returns the eigenvalues of the Laplacian
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 moreAuto Trait Implementations§
impl Freeze for SpectralEmbedding
impl RefUnwindSafe for SpectralEmbedding
impl Send for SpectralEmbedding
impl Sync for SpectralEmbedding
impl Unpin 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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.