pub struct GLM { /* private fields */ }Expand description
Generalized Linear Model.
Fits regression models for exponential family distributions using IRLS (Iteratively Reweighted Least Squares).
Implementations§
Source§impl GLM
impl GLM
Sourcepub fn new(family: Family) -> Self
pub fn new(family: Family) -> Self
Creates a new GLM with the specified family and its canonical link.
Sourcepub fn with_max_iter(self, max_iter: usize) -> Self
pub fn with_max_iter(self, max_iter: usize) -> Self
Sets the maximum number of IRLS iterations.
Sourcepub fn with_tolerance(self, tol: f32) -> Self
pub fn with_tolerance(self, tol: f32) -> Self
Sets the convergence tolerance.
Sourcepub fn with_dispersion(self, dispersion: f32) -> Self
pub fn with_dispersion(self, dispersion: f32) -> Self
Sets the dispersion parameter for Negative Binomial family.
The dispersion parameter α controls overdispersion: V(μ) = μ + α*μ². Higher α = more overdispersion. Default: 1.0.
Sourcepub fn coefficients(&self) -> Option<&[f32]>
pub fn coefficients(&self) -> Option<&[f32]>
Returns the fitted coefficients.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GLM
impl RefUnwindSafe for GLM
impl Send for GLM
impl Sync for GLM
impl Unpin for GLM
impl UnwindSafe for GLM
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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>
Converts
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>
Converts
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