Struct clear_ml::models::LinearModel
source · pub struct LinearModel {
pub intercept: f64,
pub coefficients: Vec<f64>,
}Expand description
Fields§
§intercept: f64§coefficients: Vec<f64>Implementations§
source§impl LinearModel
impl LinearModel
sourcepub fn fit(&mut self, x: &Vec<Vec<f64>>, y: &Vec<f64>) -> Result<&Self, Error>
pub fn fit(&mut self, x: &Vec<Vec<f64>>, y: &Vec<f64>) -> Result<&Self, Error>
Fit linear model.
Note
Does not fit intercept for now! # TODO
Arguments
x- Matrix of featuresy- Vector of actual values
Requirements
xmust have the same length asyx’s rows must all be same length
Returns
Ok(&Self)if successfulErr(Error)if unsuccessful
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for LinearModel
impl Send for LinearModel
impl Sync for LinearModel
impl Unpin for LinearModel
impl UnwindSafe for LinearModel
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