Enum linfa_linear::Link
source · pub enum Link {
Identity,
Log,
Logit,
}
Expand description
Link functions used by GLM
Variants§
Identity
The identity link function g(x)=x
Log
The log link function g(x)=log(x)
Logit
The logit link function g(x)=logit(x)
Implementations§
source§impl Link
impl Link
sourcepub fn link<A: Float>(&self, ypred: &Array1<A>) -> Array1<A>
pub fn link<A: Float>(&self, ypred: &Array1<A>) -> Array1<A>
Compute the link function g(ypred)
The link function links the mean ypred=E[y]
to the so called
linear predictor, g(ypred)=linear predictor
sourcepub fn link_derivative<A: Float>(&self, ypred: &Array1<A>) -> Array1<A>
pub fn link_derivative<A: Float>(&self, ypred: &Array1<A>) -> Array1<A>
Computes the derivative of the link g'(ypred)
sourcepub fn inverse<A: Float>(&self, lin_pred: &Array1<A>) -> Array1<A>
pub fn inverse<A: Float>(&self, lin_pred: &Array1<A>) -> Array1<A>
Computes the inverse link function h(linear predictor)
Gives the inverse relationship between the linear predictor and the mean
ypred=E[y]
, i.e. h(linear predictor)=ypred
sourcepub fn inverse_derviative<A: Float>(&self, lin_pred: &Array1<A>) -> Array1<A>
pub fn inverse_derviative<A: Float>(&self, lin_pred: &Array1<A>) -> Array1<A>
Computes the derivative of the inverse link function h'(linear predictor)
Trait Implementations§
source§impl PartialEq for Link
impl PartialEq for Link
impl Copy for Link
impl Eq for Link
impl StructuralEq for Link
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
Blanket Implementations§
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.