Struct rusty_machine::learning::glm::GenLinearModel
source · [−]pub struct GenLinearModel<C: Criterion> { /* private fields */ }
Expand description
The Generalized Linear Model
The model is generic over a Criterion which specifies the distribution family and the link function.
Implementations
sourceimpl<C: Criterion> GenLinearModel<C>
impl<C: Criterion> GenLinearModel<C>
sourcepub fn new(criterion: C) -> GenLinearModel<C>
pub fn new(criterion: C) -> GenLinearModel<C>
Constructs a new Generalized Linear Model.
Takes a Criterion which fully specifies the family and the link function used by the GLM.
use rusty_machine::learning::glm::GenLinearModel;
use rusty_machine::learning::glm::Bernoulli;
let glm = GenLinearModel::new(Bernoulli);
Trait Implementations
sourceimpl<C: Debug + Criterion> Debug for GenLinearModel<C>
impl<C: Debug + Criterion> Debug for GenLinearModel<C>
sourceimpl<C: Criterion> SupModel<Matrix<f64>, Vector<f64>> for GenLinearModel<C>
impl<C: Criterion> SupModel<Matrix<f64>, Vector<f64>> for GenLinearModel<C>
Supervised model trait for the GLM.
Predictions are made from the model by computing g^-1(Xb).
The model is trained using Iteratively Re-weighted Least Squares.
sourcefn predict(&self, inputs: &Matrix<f64>) -> LearningResult<Vector<f64>>
fn predict(&self, inputs: &Matrix<f64>) -> LearningResult<Vector<f64>>
Predict output from inputs.
sourcefn train(
&mut self,
inputs: &Matrix<f64>,
targets: &Vector<f64>
) -> LearningResult<()>
fn train(
&mut self,
inputs: &Matrix<f64>,
targets: &Vector<f64>
) -> LearningResult<()>
Train the model using inputs and targets.
Auto Trait Implementations
impl<C> RefUnwindSafe for GenLinearModel<C>where
C: RefUnwindSafe,
impl<C> Send for GenLinearModel<C>where
C: Send,
impl<C> Sync for GenLinearModel<C>where
C: Sync,
impl<C> Unpin for GenLinearModel<C>where
C: Unpin,
impl<C> UnwindSafe for GenLinearModel<C>where
C: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more