pub struct OnlineLinearRegression { /* private fields */ }Expand description
Simple online linear regression using SGD
Implements OnlineLearner for incremental least squares fitting.
Implementations§
Source§impl OnlineLinearRegression
impl OnlineLinearRegression
Sourcepub fn with_config(n_features: usize, config: OnlineLearnerConfig) -> Self
pub fn with_config(n_features: usize, config: OnlineLearnerConfig) -> Self
Create with custom configuration
Sourcepub fn predict_one(&self, x: &[f64]) -> Result<f64>
pub fn predict_one(&self, x: &[f64]) -> Result<f64>
Predict for a single sample
Trait Implementations§
Source§impl Clone for OnlineLinearRegression
impl Clone for OnlineLinearRegression
Source§fn clone(&self) -> OnlineLinearRegression
fn clone(&self) -> OnlineLinearRegression
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 OnlineLinearRegression
impl Debug for OnlineLinearRegression
Source§impl OnlineLearner for OnlineLinearRegression
impl OnlineLearner for OnlineLinearRegression
Source§fn partial_fit(
&mut self,
x: &[f64],
y: &[f64],
learning_rate: Option<f64>,
) -> Result<f64>
fn partial_fit( &mut self, x: &[f64], y: &[f64], learning_rate: Option<f64>, ) -> Result<f64>
Update model with single sample (or mini-batch) Read more
Source§fn current_learning_rate(&self) -> f64
fn current_learning_rate(&self) -> f64
Get current effective learning rate
Source§fn n_samples_seen(&self) -> u64
fn n_samples_seen(&self) -> u64
Number of samples seen so far
Source§fn supports_warm_start(&self) -> bool
fn supports_warm_start(&self) -> bool
Check if model supports warm-starting from checkpoint
Auto Trait Implementations§
impl Freeze for OnlineLinearRegression
impl RefUnwindSafe for OnlineLinearRegression
impl Send for OnlineLinearRegression
impl Sync for OnlineLinearRegression
impl Unpin for OnlineLinearRegression
impl UnwindSafe for OnlineLinearRegression
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 more