pub enum Error {
LinfaError(Error),
TooManyClasses,
TooFewClasses,
ArgMinError(Error),
MismatchedShapes(usize, usize),
InvalidValues,
InitialParameterFeaturesMismatch {
rows: usize,
n_features: usize,
},
InitialParameterClassesMismatch {
cols: usize,
n_classes: usize,
},
InvalidGradientTolerance,
InvalidAlpha,
InvalidInitialParameters,
}
Variants§
LinfaError(Error)
TooManyClasses
TooFewClasses
ArgMinError(Error)
MismatchedShapes(usize, usize)
InvalidValues
InitialParameterFeaturesMismatch
InitialParameterClassesMismatch
InvalidGradientTolerance
InvalidAlpha
InvalidInitialParameters
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl<C: Ord + Clone, F: Float, D: Data<Elem = F>, T: AsSingleTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidLogisticRegression<F>
impl<C: Ord + Clone, F: Float, D: Data<Elem = F>, T: AsSingleTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidLogisticRegression<F>
Source§fn fit(
&self,
dataset: &DatasetBase<ArrayBase<D, Ix2>, T>,
) -> Result<Self::Object>
fn fit( &self, dataset: &DatasetBase<ArrayBase<D, Ix2>, T>, ) -> Result<Self::Object>
Given a 2-dimensional feature matrix array x
with shape
(n_samples, n_features) and an array of target classes to predict,
create a FittedLinearRegression
object which allows making
predictions.
The array of target classes y
must have exactly two discrete values, (e.g. 0 and 1, “cat”
and “dog”, …), which represent the two different classes the model is supposed to
predict.
The array y
must also have exactly n_samples
items, i.e.
exactly as many items as there are rows in the feature matrix x
.
This method returns an error if any of the preconditions are violated,
i.e. any values are Inf
or NaN
, y
doesn’t have as many items as
x
has rows, or if other parameters (gradient_tolerance, alpha) have
been set to inalid values.
type Object = FittedLogisticRegression<F, C>
Source§impl<C: Ord + Clone, F: Float, D: Data<Elem = F>, T: AsSingleTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidMultiLogisticRegression<F>
impl<C: Ord + Clone, F: Float, D: Data<Elem = F>, T: AsSingleTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidMultiLogisticRegression<F>
Source§fn fit(
&self,
dataset: &DatasetBase<ArrayBase<D, Ix2>, T>,
) -> Result<Self::Object>
fn fit( &self, dataset: &DatasetBase<ArrayBase<D, Ix2>, T>, ) -> Result<Self::Object>
Given a 2-dimensional feature matrix array x
with shape
(n_samples, n_features) and an array of target classes to predict,
create a MultiFittedLogisticRegression
object which allows making
predictions. The target classes can have any number of discrete values.
This method returns an error if any of the preconditions are violated,
i.e. any values are Inf
or NaN
, y
doesn’t have as many items as
x
has rows, or if other parameters (gradient_tolerance, alpha) have
been set to inalid values. The input features are also strongly recommended to be
normalized to ensure numerical stability.
type Object = MultiFittedLogisticRegression<F, C>
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.