Struct rusty_ai::regression::linear::LinearRegression
source · pub struct LinearRegression<T: RealNumber> { /* private fields */ }Implementations§
source§impl<T: RealNumber> LinearRegression<T>
impl<T: RealNumber> LinearRegression<T>
pub fn new() -> Self
pub fn with_params( dimension: Option<usize>, weights: Option<DVector<T>> ) -> Result<Self, Box<dyn Error>>
pub fn weights(&self) -> &DVector<T>
pub fn predict(&self, x_pred: &DMatrix<T>) -> Result<DVector<T>, Box<dyn Error>>
pub fn fit( &mut self, dataset: &Dataset<T, T>, lr: T, max_steps: usize, epsilon: Option<T>, progress: Option<usize> ) -> Result<String, Box<dyn Error>>
Trait Implementations§
source§impl<T: Clone + RealNumber> Clone for LinearRegression<T>
impl<T: Clone + RealNumber> Clone for LinearRegression<T>
source§fn clone(&self) -> LinearRegression<T>
fn clone(&self) -> LinearRegression<T>
Returns a copy 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<T: Debug + RealNumber> Debug for LinearRegression<T>
impl<T: Debug + RealNumber> Debug for LinearRegression<T>
source§impl<T: RealNumber> Default for LinearRegression<T>
impl<T: RealNumber> Default for LinearRegression<T>
source§impl<T: RealNumber> RegressionMetrics<T> for LinearRegression<T>
impl<T: RealNumber> RegressionMetrics<T> for LinearRegression<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for LinearRegression<T>where
T: RefUnwindSafe,
impl<T> Send for LinearRegression<T>
impl<T> Sync for LinearRegression<T>
impl<T> Unpin for LinearRegression<T>where
T: Unpin,
impl<T> UnwindSafe for LinearRegression<T>where
T: UnwindSafe,
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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.