Struct linfa_ftrl::Ftrl
source · [−]pub struct Ftrl<F: Float> { /* private fields */ }Implementations
sourceimpl<F: Float> Ftrl<F>
impl<F: Float> Ftrl<F>
View the fitted parameters and make predictions with a fitted follow the regularized leader -proximal, model
sourcepub fn get_weights(&self) -> Array1<F>
pub fn get_weights(&self) -> Array1<F>
Calculate weights for model prediction
sourcepub fn update<D: Data<Elem = F>, T: AsSingleTargets<Elem = bool>>(
&mut self,
dataset: &DatasetBase<ArrayBase<D, Ix2>, T>,
probabilities: ArrayView1<'_, Pr>
)
pub fn update<D: Data<Elem = F>, T: AsSingleTargets<Elem = bool>>(
&mut self,
dataset: &DatasetBase<ArrayBase<D, Ix2>, T>,
probabilities: ArrayView1<'_, Pr>
)
Update method of the model hyperparameters in case of async mode. To use this method, we must store probabilities and features for the row, and update once the result (bool) is observed.
sourceimpl<F: Float> Ftrl<F>
impl<F: Float> Ftrl<F>
sourcepub fn params() -> FtrlParams<F, Xoshiro256Plus>
pub fn params() -> FtrlParams<F, Xoshiro256Plus>
Create a default parameter set for construction of Follow The Regularized Leader - proximal model The description can be found here
It requires data preprocessing done in the separate step. Create default hyperparameters. Random number generator will default to rand_xoshiro::Xoshiro256Plus
sourcepub fn params_with_rng<R: Rng>(rng: R) -> FtrlParams<F, R>
pub fn params_with_rng<R: Rng>(rng: R) -> FtrlParams<F, R>
Create default hyperparameters with custom random number generator
Trait Implementations
sourceimpl<'de, F: Float> Deserialize<'de> for Ftrl<F> where
F: Deserialize<'de>,
impl<'de, F: Float> Deserialize<'de> for Ftrl<F> where
F: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<Pr>, Dim<[usize; 1]>>> for Ftrl<F>
impl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<Pr>, Dim<[usize; 1]>>> for Ftrl<F>
Auto Trait Implementations
impl<F> RefUnwindSafe for Ftrl<F> where
F: RefUnwindSafe,
impl<F> Send for Ftrl<F>
impl<F> Sync for Ftrl<F>
impl<F> Unpin for Ftrl<F>
impl<F> UnwindSafe for Ftrl<F> where
F: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more