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
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for Link
impl<'de> Deserialize<'de> for Link
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
impl Copy 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more