pub struct LinearRegression {
pub coef_: Option<Vec<f32>>,
pub intercept_: Option<f32>,
pub fit_intercept: bool,
pub solver: LinearSolver,
pub learning_rate: f32,
pub max_iter: usize,
pub tol: f32,
}Expand description
Linear Regression using Ordinary Least Squares (closed-form) or Gradient Descent
Fields§
§coef_: Option<Vec<f32>>Coefficients (weights)
intercept_: Option<f32>Intercept (bias)
fit_intercept: boolWhether to fit intercept
solver: LinearSolverSolver to use
learning_rate: f32Learning rate for gradient descent
max_iter: usizeMaximum iterations for gradient descent
tol: f32Tolerance for convergence
Implementations§
Source§impl LinearRegression
impl LinearRegression
pub fn new() -> Self
pub fn fit_intercept(self, fit: bool) -> Self
pub fn solver(self, solver: LinearSolver) -> Self
pub fn learning_rate(self, lr: f32) -> Self
pub fn max_iter(self, n: usize) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinearRegression
impl RefUnwindSafe for LinearRegression
impl Send for LinearRegression
impl Sync for LinearRegression
impl Unpin for LinearRegression
impl UnwindSafe for LinearRegression
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> 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