pub struct LowRankMatrixRecovery<State = Untrained> {
pub algorithm: RecoveryAlgorithm,
pub rank: Option<usize>,
pub max_iter: usize,
pub tol: f64,
pub lambda: f64,
pub mu: f64,
pub random_state: Option<u64>,
/* private fields */
}Expand description
Low-rank Matrix Recovery algorithms for robust decomposition
These methods are designed to recover low-rank matrices from corrupted observations, handling outliers and sparse corruption better than standard matrix completion.
Fields§
§algorithm: RecoveryAlgorithmAlgorithm to use for recovery
rank: Option<usize>Rank of the low-rank component (if known)
max_iter: usizeMaximum number of iterations
tol: f64Convergence tolerance
lambda: f64Regularization parameter for sparse component
mu: f64Regularization parameter for nuclear norm
random_state: Option<u64>Random state for reproducibility
Implementations§
Source§impl LowRankMatrixRecovery<Untrained>
impl LowRankMatrixRecovery<Untrained>
Sourcepub fn algorithm(self, algorithm: RecoveryAlgorithm) -> Self
pub fn algorithm(self, algorithm: RecoveryAlgorithm) -> Self
Set the recovery algorithm
Sourcepub fn random_state(self, random_state: u64) -> Self
pub fn random_state(self, random_state: u64) -> Self
Set random state
Source§impl LowRankMatrixRecovery<TrainedLowRankMatrixRecovery>
impl LowRankMatrixRecovery<TrainedLowRankMatrixRecovery>
Sourcepub fn low_rank_component(&self) -> &Array2<f64>
pub fn low_rank_component(&self) -> &Array2<f64>
Get the recovered low-rank component
Sourcepub fn sparse_component(&self) -> &Array2<f64>
pub fn sparse_component(&self) -> &Array2<f64>
Get the sparse component (outliers/corruption)
Sourcepub fn estimated_rank(&self) -> usize
pub fn estimated_rank(&self) -> usize
Get the estimated rank
Sourcepub fn factors(&self) -> &Option<(Array2<f64>, Array1<f64>, Array2<f64>)>
pub fn factors(&self) -> &Option<(Array2<f64>, Array1<f64>, Array2<f64>)>
Get SVD factors if available
Sourcepub fn recover_low_rank_component(&self, x: &Array2<f64>) -> Result<Array2<f64>>
pub fn recover_low_rank_component(&self, x: &Array2<f64>) -> Result<Array2<f64>>
Recover low-rank component from new corrupted data
Sourcepub fn reconstruct(&self) -> Array2<f64>
pub fn reconstruct(&self) -> Array2<f64>
Reconstruct the original matrix (low-rank + sparse)
Trait Implementations§
Source§impl<State: Clone> Clone for LowRankMatrixRecovery<State>
impl<State: Clone> Clone for LowRankMatrixRecovery<State>
Source§fn clone(&self) -> LowRankMatrixRecovery<State>
fn clone(&self) -> LowRankMatrixRecovery<State>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<State: Debug> Debug for LowRankMatrixRecovery<State>
impl<State: Debug> Debug for LowRankMatrixRecovery<State>
Source§impl Default for LowRankMatrixRecovery<Untrained>
impl Default for LowRankMatrixRecovery<Untrained>
Source§impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ()> for LowRankMatrixRecovery<Untrained>
impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ()> for LowRankMatrixRecovery<Untrained>
Source§type Fitted = LowRankMatrixRecovery<TrainedLowRankMatrixRecovery>
type Fitted = LowRankMatrixRecovery<TrainedLowRankMatrixRecovery>
The fitted model type
Source§fn fit(self, x: &Array2<f64>, _y: &()) -> Result<Self::Fitted>
fn fit(self, x: &Array2<f64>, _y: &()) -> Result<Self::Fitted>
Fit the model to the provided data with validation
Source§fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
Fit with custom validation and early stopping
Auto Trait Implementations§
impl<State> Freeze for LowRankMatrixRecovery<State>where
State: Freeze,
impl<State> RefUnwindSafe for LowRankMatrixRecovery<State>where
State: RefUnwindSafe,
impl<State> Send for LowRankMatrixRecovery<State>where
State: Send,
impl<State> Sync for LowRankMatrixRecovery<State>where
State: Sync,
impl<State> Unpin for LowRankMatrixRecovery<State>where
State: Unpin,
impl<State> UnsafeUnpin for LowRankMatrixRecovery<State>where
State: UnsafeUnpin,
impl<State> UnwindSafe for LowRankMatrixRecovery<State>where
State: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more