Struct linfa_elasticnet::ElasticNet [−][src]
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]
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]
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]
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,
F: RefUnwindSafe,
impl<F> Send for ElasticNet<F> where
F: Send,
F: Send,
impl<F> Sync for ElasticNet<F> where
F: Sync,
F: Sync,
impl<F> Unpin for ElasticNet<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for ElasticNet<F> where
F: RefUnwindSafe + UnwindSafe,
F: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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]
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
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]
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>,
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]
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
pub fn predict(
&self,
records: ArrayBase<D, Dim<[usize; 2]>>
) -> DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>[src]
&self,
records: ArrayBase<D, Dim<[usize; 2]>>
) -> DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>
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]
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>,
pub fn predict(&self, ds: DatasetBase<R, T>) -> DatasetBase<R, S>[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,