pub struct LogisticRegressionInput<T> {
pub x: Matrix<T, Dyn, Dyn, VecStorage<T, Dyn, Dyn>>,
pub y: Matrix<T, Dyn, Const<1>, VecStorage<T, Dyn, Const<1>>>,
}
Expand description
Struct to hold the input data for a logistic regression.
Fields§
§x: Matrix<T, Dyn, Dyn, VecStorage<T, Dyn, Dyn>>
The input data matrix, also known as the design matrix. You do not need to add a column of ones to the design matrix, as this is done automatically.
y: Matrix<T, Dyn, Const<1>, VecStorage<T, Dyn, Const<1>>>
The output data vector, also known as the response vector. The values of the response vector should be either 0 or 1.
Implementations§
Source§impl LogisticRegressionInput<f64>
impl LogisticRegressionInput<f64>
Sourcepub fn new(
x: Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>,
y: Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>,
) -> LogisticRegressionInput<f64>
pub fn new( x: Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>, y: Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, ) -> LogisticRegressionInput<f64>
Create a new LogisticRegressionInput
struct.
§Panics
Panics if the number of rows in x are not equal to the length of y.
Sourcepub fn fit(
&self,
method: LogisticRegressionAlgorithm,
tolerance: f64,
) -> Result<LogisticRegressionOutput<f64>, &'static str>
pub fn fit( &self, method: LogisticRegressionAlgorithm, tolerance: f64, ) -> Result<LogisticRegressionOutput<f64>, &'static str>
Fit a logistic regression model to the input data.
Trait Implementations§
Source§impl<T> Clone for LogisticRegressionInput<T>where
T: Clone,
impl<T> Clone for LogisticRegressionInput<T>where
T: Clone,
Source§fn clone(&self) -> LogisticRegressionInput<T>
fn clone(&self) -> LogisticRegressionInput<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 LogisticRegressionInput<T>
impl<T> RefUnwindSafe for LogisticRegressionInput<T>where
T: RefUnwindSafe,
impl<T> Send for LogisticRegressionInput<T>where
T: Send,
impl<T> Sync for LogisticRegressionInput<T>where
T: Sync,
impl<T> Unpin for LogisticRegressionInput<T>where
T: Unpin,
impl<T> UnwindSafe for LogisticRegressionInput<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.