pub struct ElasticNet<F> { /* private fields */ }
Expand description
Elastic Net model
This struct contains the parameters of a fitted elastic net model. This includes the seperating hyperplane, (optionally) intercept, duality gaps and the number of step needed in the computation.
§Model implementation
The coordinate descent algorithm is used to solve the lasso and ridge problem. It optimizes each parameter seperately, holding all the others fixed. This cycles as long as the coefficients have not stabilized or the maximum number of iterations is reached.
See also:
Implementations§
Source§impl<F: Float> ElasticNet<F>
View the fitted parameters and make predictions with a fitted
elastic net model
impl<F: Float> ElasticNet<F>
View the fitted parameters and make predictions with a fitted elastic net model
Sourcepub fn hyperplane(&self) -> &Array1<F>
pub fn hyperplane(&self) -> &Array1<F>
Get the fitted hyperplane
Sourcepub fn duality_gap(&self) -> F
pub fn duality_gap(&self) -> F
Get the duality gap at the end of the optimization algorithm
Sourcepub fn confidence_95th(&self) -> Result<Array1<(F, F)>>
pub fn confidence_95th(&self) -> Result<Array1<(F, F)>>
Calculate the confidence level
Source§impl<F: Float> ElasticNet<F>
impl<F: Float> ElasticNet<F>
Sourcepub fn params() -> ElasticNetParams<F>
pub fn params() -> ElasticNetParams<F>
Create a default parameter set for construction of ElasticNet model
By default, an intercept will be fitted. To disable fitting an
intercept, call .with_intercept(false)
before calling .fit()
.
To additionally normalize the feature matrix before fitting, call
fit_intercept_and_normalize()
before calling fit()
. The feature
matrix will not be normalized by default.
Sourcepub fn ridge() -> ElasticNetParams<F>
pub fn ridge() -> ElasticNetParams<F>
Create a ridge only model
Sourcepub fn lasso() -> ElasticNetParams<F>
pub fn lasso() -> ElasticNetParams<F>
Create a LASSO only model
Trait Implementations§
Source§impl<F: Clone> Clone for ElasticNet<F>
impl<F: Clone> Clone for ElasticNet<F>
Source§fn clone(&self) -> ElasticNet<F>
fn clone(&self) -> ElasticNet<F>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<F: Debug> Debug for ElasticNet<F>
impl<F: Debug> Debug for ElasticNet<F>
Source§impl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>> for ElasticNet<F>
impl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>> for ElasticNet<F>
Auto Trait Implementations§
impl<F> Freeze for ElasticNet<F>where
F: Freeze,
impl<F> RefUnwindSafe for ElasticNet<F>where
F: RefUnwindSafe,
impl<F> Send for ElasticNet<F>where
F: Send,
impl<F> Sync for ElasticNet<F>where
F: Sync,
impl<F> Unpin for ElasticNet<F>where
F: Unpin,
impl<F> UnwindSafe for ElasticNet<F>where
F: UnwindSafe + RefUnwindSafe,
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
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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<'a, F, R, T, S, O> Predict<&'a DatasetBase<R, T>, S> for Owhere
R: Records<Elem = F>,
O: PredictInplace<R, S>,
impl<'a, F, R, T, S, O> Predict<&'a DatasetBase<R, T>, S> for Owhere
R: Records<Elem = F>,
O: PredictInplace<R, S>,
§impl<F, D, E, T, O> Predict<ArrayBase<D, Dim<[usize; 2]>>, DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>> for O
impl<F, D, E, T, O> Predict<ArrayBase<D, Dim<[usize; 2]>>, DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>> for O
§impl<F, R, T, E, S, O> Predict<DatasetBase<R, T>, DatasetBase<R, S>> for Owhere
R: Records<Elem = F>,
S: AsTargets<Elem = E>,
O: PredictInplace<R, S>,
impl<F, R, T, E, S, O> Predict<DatasetBase<R, T>, DatasetBase<R, S>> for Owhere
R: Records<Elem = F>,
S: AsTargets<Elem = E>,
O: PredictInplace<R, S>,
§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>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.