pub struct LogisticRegressionOutput<T> {
pub coefficients: Matrix<T, Dyn, Const<1>, VecStorage<T, Dyn, Const<1>>>,
pub iterations: usize,
}
Expand description
Struct to hold the output data for a logistic regression.
Fields§
§coefficients: Matrix<T, Dyn, Const<1>, VecStorage<T, Dyn, Const<1>>>
The coefficients of the logistic regression, often denoted as b0, b1, b2, …, bn. The first coefficient is the intercept (aka. b0 or alpha).
iterations: usize
Number of iterations required to converge.
Implementations§
Source§impl LogisticRegressionOutput<f64>
impl LogisticRegressionOutput<f64>
Sourcepub fn predict(
&self,
input: &Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>,
) -> Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>
pub fn predict( &self, input: &Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, ) -> Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>
Predicts the output for the given input data.
Sourcepub fn predict_proba(
&self,
input: &Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>,
) -> Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>
pub fn predict_proba( &self, input: &Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, ) -> Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>
Compute the probabilities $Pr(output_i=1|input_i,coefficients)$ for the given input data.
Sourcepub fn score_misclassification(
&self,
y: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
y_hat: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
) -> f64
pub fn score_misclassification( &self, y: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, y_hat: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, ) -> f64
Compute the misclassification rate for given y
and y_hat
.
§Panics
Panics if the shape of y
is not equal to the shape of y_hat
.
Sourcepub fn score_cross_entropy(
&self,
y: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
p_hat: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
) -> f64
pub fn score_cross_entropy( &self, y: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, p_hat: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, ) -> f64
Compute average cross-entropy for given y and p_hat
.
§Panics
Panics if the shape of y
is not equal to the shape of p_hat
.
Trait Implementations§
Source§impl<T> Clone for LogisticRegressionOutput<T>where
T: Clone,
impl<T> Clone for LogisticRegressionOutput<T>where
T: Clone,
Source§fn clone(&self) -> LogisticRegressionOutput<T>
fn clone(&self) -> LogisticRegressionOutput<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> Freeze for LogisticRegressionOutput<T>
impl<T> RefUnwindSafe for LogisticRegressionOutput<T>where
T: RefUnwindSafe,
impl<T> Send for LogisticRegressionOutput<T>where
T: Send,
impl<T> Sync for LogisticRegressionOutput<T>where
T: Sync,
impl<T> Unpin for LogisticRegressionOutput<T>where
T: Unpin,
impl<T> UnwindSafe for LogisticRegressionOutput<T>where
T: UnwindSafe,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.