LassoFit

Struct LassoFit 

Source
pub struct LassoFit {
Show 13 fields pub lambda: f64, pub intercept: f64, pub coefficients: Vec<f64>, pub fitted_values: Vec<f64>, pub residuals: Vec<f64>, pub n_nonzero: usize, pub iterations: usize, pub converged: bool, pub r_squared: f64, pub adj_r_squared: f64, pub mse: f64, pub rmse: f64, pub mae: f64,
}
Expand description

Result of a lasso regression fit.

§Fields

  • lambda - The lambda value used for fitting
  • intercept - Intercept coefficient (on original scale)
  • coefficients - Slope coefficients (on original scale, may contain zeros)
  • fitted_values - In-sample predictions
  • residuals - Residuals (y - fitted_values)
  • n_nonzero - Number of non-zero coefficients (excluding intercept)
  • iterations - Number of coordinate descent iterations
  • converged - Whether the algorithm converged
  • r_squared - R² (coefficient of determination)
  • adj_r_squared - Adjusted R² (using effective df based on n_nonzero)
  • mse - Mean squared error
  • rmse - Root mean squared error
  • mae - Mean absolute error

Fields§

§lambda: f64

Lambda value used for fitting

§intercept: f64

Intercept on original scale

§coefficients: Vec<f64>

Slope coefficients on original scale

§fitted_values: Vec<f64>

Fitted values

§residuals: Vec<f64>

Residuals

§n_nonzero: usize

Number of non-zero coefficients

§iterations: usize

Number of iterations performed

§converged: bool

Whether convergence was achieved

§r_squared: f64

R² (coefficient of determination)

§adj_r_squared: f64

Adjusted R² (penalized for effective number of parameters)

§mse: f64

Mean squared error

§rmse: f64

Root mean squared error

§mae: f64

Mean absolute error

Trait Implementations§

Source§

impl Clone for LassoFit

Source§

fn clone(&self) -> LassoFit

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LassoFit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for LassoFit

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.