Enum linfa_logistic::error::Error
source · [−]pub enum Error {
LinfaError(Error),
WrongNumberOfClasses,
ArgMinError(Error),
MismatchedShapes(usize, usize),
InvalidValues,
InitialParameterFeaturesMismatch {
rows: usize,
n_features: usize,
},
InitialParameterClassesMismatch {
cols: usize,
n_classes: usize,
},
InvalidGradientTolerance,
InvalidAlpha,
InvalidInitialParameters,
}
Variants
LinfaError(Error)
WrongNumberOfClasses
ArgMinError(Error)
MismatchedShapes(usize, usize)
InvalidValues
InitialParameterFeaturesMismatch
InitialParameterClassesMismatch
InvalidGradientTolerance
InvalidAlpha
InvalidInitialParameters
Trait Implementations
sourceimpl Error for Error
impl Error for Error
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl<'a, C: 'a + Ord + Clone, F: Float, D: Data<Elem = F>, T: AsTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidLogisticRegression<F>
impl<'a, C: 'a + Ord + Clone, F: Float, D: Data<Elem = F>, T: AsTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidLogisticRegression<F>
sourcefn 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>
sourceimpl<'a, C: 'a + Ord + Clone, F: Float, D: Data<Elem = F>, T: AsTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidMultiLogisticRegression<F>
impl<'a, C: 'a + Ord + Clone, F: Float, D: Data<Elem = F>, T: AsTargets<Elem = C>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, Error> for ValidMultiLogisticRegression<F>
sourcefn 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 !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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