pub struct LinearRegression {
pub slope: f64,
pub intercept: f64,
pub r_squared: f64,
pub residuals: Vec<f64>,
}
Fields§
§slope: f64
§intercept: f64
§r_squared: f64
§residuals: Vec<f64>
Implementations§
Source§impl LinearRegression
impl LinearRegression
pub fn new() -> Self
pub fn fit(&mut self, x: &[f64], y: &[f64]) -> Result<(), &'static str>
pub fn predict(&self, x: f64) -> f64
pub fn get_r_squared(&self) -> f64
pub fn get_residuals(&self) -> &[f64]
pub fn mean_squared_error(&self) -> f64
pub fn root_mean_squared_error(&self) -> 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 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