pub enum Link {
Log,
Identity,
}Expand description
The link function g of a Generalized Linear Model, mapping the mean mu
to the linear predictor eta = g(mu) (and back via the inverse link h,
mu = h(eta)).
Mirrors the link carried by sklearn’s loss classes
(sklearn/linear_model/_glm/glm.py:119-131): HalfPoissonLoss,
HalfGammaLoss and HalfTweedieLoss use the log link
(y_pred = exp(X @ coef + intercept)); HalfSquaredError and
HalfTweedieLossIdentity use the identity link
(y_pred = X @ coef + intercept).
Variants§
Log
Log link: g(mu) = ln(mu), inverse h(eta) = exp(eta).
Used by Poisson, Gamma and Tweedie-with-power > 0 losses.
Identity
Identity link: g(mu) = mu, inverse h(eta) = eta.
Used by the Normal/least-squares loss and Tweedie-with-power <= 0.
Trait Implementations§
impl Copy for Link
impl Eq for Link
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnsafeUnpin for Link
impl UnwindSafe for Link
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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