Struct linfa_elasticnet::ElasticNet [−][src]
pub struct ElasticNet<F> { /* fields omitted */ }
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.
Implementations
impl<F: Float> ElasticNet<F>
[src]
impl<F: Float> ElasticNet<F>
[src]View the fitted parameters and make predictions with a fitted elastic net model
pub fn parameters(&self) -> &Array1<F>
[src]
Get the fitted parameters
pub fn intercept(&self) -> F
[src]
Get the fitted intercept, 0. if no intercept was fitted
pub fn n_steps(&self) -> u32
[src]
Get the number of steps taken in optimization algorithm
pub fn duality_gap(&self) -> F
[src]
Get the duality gap at the end of the optimization algorithm
pub fn z_score(&self) -> Result<Array1<F>>
[src]
Calculate the Z score
pub fn confidence_95th(&self) -> Result<Array1<(F, F)>>
[src]
Calculate the confidence level
impl<F: Float> ElasticNet<F>
[src]
impl<F: Float> ElasticNet<F>
[src]pub fn params() -> ElasticNetParams<F>
[src]
Create a default elastic net 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.
pub fn ridge() -> ElasticNetParams<F>
[src]
Create a ridge model
pub fn lasso() -> ElasticNetParams<F>
[src]
Create a lasso model
Trait Implementations
impl<F: Float, D: Data<Elem = F>> PredictRef<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>> for ElasticNet<F>
[src]
impl<F: Float, D: Data<Elem = F>> PredictRef<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>> for ElasticNet<F>
[src]fn predict_ref<'a>(&'a self, x: &ArrayBase<D, Ix2>) -> Array1<F>
[src]
Given an input matrix X
, with shape (n_samples, n_features)
,
predict
returns the target variable according to elastic net
learned from the training data distribution.
Auto Trait Implementations
impl<F> RefUnwindSafe for ElasticNet<F> where
F: RefUnwindSafe,
impl<F> RefUnwindSafe for ElasticNet<F> where
F: RefUnwindSafe,
impl<F> Send for ElasticNet<F> where
F: Send,
impl<F> Send for ElasticNet<F> where
F: Send,
impl<F> Sync for ElasticNet<F> where
F: Sync,
impl<F> Sync for ElasticNet<F> where
F: Sync,
impl<F> Unpin for ElasticNet<F> where
F: Unpin,
impl<F> Unpin for ElasticNet<F> where
F: Unpin,
impl<F> UnwindSafe for ElasticNet<F> where
F: RefUnwindSafe + UnwindSafe,
impl<F> UnwindSafe for ElasticNet<F> where
F: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<'a, F, D, T, O> Predict<&'a ArrayBase<D, Dim<[usize; 2]>>, T> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
[src]
impl<'a, F, D, T, O> Predict<&'a ArrayBase<D, Dim<[usize; 2]>>, T> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
[src]impl<'a, F, R, T, S, O> Predict<&'a DatasetBase<R, T>, S> for O where
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>,
[src]
impl<'a, F, R, T, S, O> Predict<&'a DatasetBase<R, T>, S> for O where
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>,
[src]pub fn predict(&self, ds: &'a DatasetBase<R, T>) -> S
[src]
impl<F, D, T, O> Predict<ArrayBase<D, Dim<[usize; 2]>>, DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
[src]
impl<F, D, T, O> Predict<ArrayBase<D, Dim<[usize; 2]>>, DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
[src]impl<F, R, T, S, O> Predict<DatasetBase<R, T>, DatasetBase<R, S>> for O where
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>,
[src]
impl<F, R, T, S, O> Predict<DatasetBase<R, T>, DatasetBase<R, S>> for O where
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>,
[src]pub fn predict(&self, ds: DatasetBase<R, T>) -> DatasetBase<R, S>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,