pub struct Ols { /* private fields */ }Expand description
Ordinary least squares with an intercept and optional ridge penalty.
ridge (default 0) is added to the diagonal for slopes only, which keeps
the fit well defined when covariates are collinear.
Implementations§
Trait Implementations§
Source§impl Regressor for Ols
impl Regressor for Ols
Source§fn fit_weighted(
&mut self,
x: ArrayView2<'_, f64>,
y: ArrayView1<'_, f64>,
w: ArrayView1<'_, f64>,
) -> Result<()>
fn fit_weighted( &mut self, x: ArrayView2<'_, f64>, y: ArrayView1<'_, f64>, w: ArrayView1<'_, f64>, ) -> Result<()>
Weighted least squares: minimises Σ wᵢ (yᵢ − b − xᵢᵀβ)² + ridge·‖β‖².
fn fit(&mut self, x: ArrayView2<'_, f64>, y: ArrayView1<'_, f64>) -> Result<()>
fn predict(&self, x: ArrayView2<'_, f64>) -> Result<Array1<f64>>
fn fresh(&self) -> Box<dyn Regressor>
Auto Trait Implementations§
impl Freeze for Ols
impl RefUnwindSafe for Ols
impl Send for Ols
impl Sync for Ols
impl Unpin for Ols
impl UnsafeUnpin for Ols
impl UnwindSafe for Ols
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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