pub struct MatrixCompletion<State = Untrained> {
pub rank: Option<usize>,
pub algorithm: CompletionAlgorithm,
pub max_iter: usize,
pub tol: f64,
pub random_state: Option<u64>,
pub learning_rate: f64,
pub regularization: f64,
pub use_bias: bool,
/* private fields */
}Expand description
Matrix completion transformer
Fields§
§rank: Option<usize>Rank of the matrix completion
algorithm: CompletionAlgorithmAlgorithm to use
max_iter: usizeMaximum number of iterations
tol: f64Convergence tolerance
random_state: Option<u64>Random state for reproducibility
learning_rate: f64Learning rate for gradient-based methods
regularization: f64Regularization parameter
use_bias: boolWhether to use bias terms
Implementations§
Source§impl MatrixCompletion<Untrained>
impl MatrixCompletion<Untrained>
Sourcepub fn algorithm(self, algorithm: CompletionAlgorithm) -> Self
pub fn algorithm(self, algorithm: CompletionAlgorithm) -> Self
Set the algorithm
Sourcepub fn random_state(self, random_state: u64) -> Self
pub fn random_state(self, random_state: u64) -> Self
Set random state
Sourcepub fn learning_rate(self, learning_rate: f64) -> Self
pub fn learning_rate(self, learning_rate: f64) -> Self
Set learning rate
Sourcepub fn regularization(self, regularization: f64) -> Self
pub fn regularization(self, regularization: f64) -> Self
Set regularization parameter
Source§impl MatrixCompletion<TrainedMatrixCompletion>
impl MatrixCompletion<TrainedMatrixCompletion>
Sourcepub fn user_factors(&self) -> &Array2<f64>
pub fn user_factors(&self) -> &Array2<f64>
Get the user factors
Sourcepub fn item_factors(&self) -> &Array2<f64>
pub fn item_factors(&self) -> &Array2<f64>
Get the item factors
Sourcepub fn reconstruction_error(&self) -> f64
pub fn reconstruction_error(&self) -> f64
Get the reconstruction error
Trait Implementations§
Source§impl<State: Clone> Clone for MatrixCompletion<State>
impl<State: Clone> Clone for MatrixCompletion<State>
Source§fn clone(&self) -> MatrixCompletion<State>
fn clone(&self) -> MatrixCompletion<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 MatrixCompletion<State>
impl<State: Debug> Debug for MatrixCompletion<State>
Source§impl Default for MatrixCompletion<Untrained>
impl Default for MatrixCompletion<Untrained>
Source§impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<bool>, Dim<[usize; 2]>>> for MatrixCompletion<Untrained>
impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<bool>, Dim<[usize; 2]>>> for MatrixCompletion<Untrained>
Source§type Fitted = MatrixCompletion<TrainedMatrixCompletion>
type Fitted = MatrixCompletion<TrainedMatrixCompletion>
The fitted model type
Source§fn fit(self, matrix: &Array2<f64>, mask: &Array2<bool>) -> Result<Self::Fitted>
fn fit(self, matrix: &Array2<f64>, mask: &Array2<bool>) -> 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 MatrixCompletion<State>where
State: Freeze,
impl<State> RefUnwindSafe for MatrixCompletion<State>where
State: RefUnwindSafe,
impl<State> Send for MatrixCompletion<State>where
State: Send,
impl<State> Sync for MatrixCompletion<State>where
State: Sync,
impl<State> Unpin for MatrixCompletion<State>where
State: Unpin,
impl<State> UnsafeUnpin for MatrixCompletion<State>where
State: UnsafeUnpin,
impl<State> UnwindSafe for MatrixCompletion<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