pub struct LinearRegression {
pub weights: Vec<f64>,
pub bias: f64,
}Fields§
§weights: Vec<f64>§bias: f64Implementations§
Source§impl LinearRegression
impl LinearRegression
pub fn new(n_features: usize) -> Self
pub fn predict(&self, x: &[f64]) -> f64
pub fn fit_least_squares(x_data: &[Vec<f64>], y_data: &[f64]) -> Self
pub fn r_squared(&self, x_data: &[Vec<f64>], y_data: &[f64]) -> f64
pub fn mse(&self, x_data: &[Vec<f64>], y_data: &[f64]) -> f64
Auto Trait Implementations§
impl Freeze for LinearRegression
impl RefUnwindSafe for LinearRegression
impl Send for LinearRegression
impl Sync for LinearRegression
impl Unpin for LinearRegression
impl UnsafeUnpin 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