Enum linfa_linear::LinearError
source · [−]#[non_exhaustive]
pub enum LinearError<F: Float> {
Argmin(Error),
BaseCrate(Error),
NotEnoughSamples,
NotEnoughTargets,
InvalidPenalty(F),
InvalidTweediePower(F),
InvalidTargetRange(F),
LinalgError(LinalgError),
}
Expand description
An error when modeling a Linear algorithm
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Argmin(Error)
Errors encountered when using argmin’s solver
BaseCrate(Error)
NotEnoughSamples
NotEnoughTargets
InvalidPenalty(F)
InvalidTweediePower(F)
InvalidTargetRange(F)
LinalgError(LinalgError)
Trait Implementations
sourceimpl<F: Debug + Float> Debug for LinearError<F>
impl<F: Debug + Float> Debug for LinearError<F>
sourceimpl<F: Float> Display for LinearError<F> where
F: Display,
impl<F: Float> Display for LinearError<F> where
F: Display,
sourceimpl<F: Float> Error for LinearError<F> where
Self: Debug + Display,
impl<F: Float> Error for LinearError<F> where
Self: Debug + Display,
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>
🔬 This is a nightly-only experimental API. (
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
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl<F: Float, D: Data<Elem = F>, T: AsSingleTargets<Elem = F>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, LinearError<F>> for LinearRegression
impl<F: Float, D: Data<Elem = F>, T: AsSingleTargets<Elem = F>> Fit<ArrayBase<D, Dim<[usize; 2]>>, T, LinearError<F>> for LinearRegression
sourcefn fit(
&self,
dataset: &DatasetBase<ArrayBase<D, Ix2>, T>
) -> Result<Self::Object, F>
fn fit(
&self,
dataset: &DatasetBase<ArrayBase<D, Ix2>, T>
) -> Result<Self::Object, F>
Fit a linear regression model given a feature matrix X
and a target
variable y
.
The feature matrix X
must have shape (n_samples, n_features)
The target variable y
must have shape (n_samples)
Returns a FittedLinearRegression
object which contains the fitted
parameters and can be used to predict
values of the target variable
for new feature values.
type Object = FittedLinearRegression<F>
sourceimpl<F: Float> From<Error> for LinearError<F>
impl<F: Float> From<Error> for LinearError<F>
sourceimpl<F: Float> From<Error> for LinearError<F>
impl<F: Float> From<Error> for LinearError<F>
sourceimpl<F: Float> From<LinalgError> for LinearError<F>
impl<F: Float> From<LinalgError> for LinearError<F>
sourcefn from(source: LinalgError) -> Self
fn from(source: LinalgError) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<F> !RefUnwindSafe for LinearError<F>
impl<F> Send for LinearError<F>
impl<F> Sync for LinearError<F>
impl<F> Unpin for LinearError<F>
impl<F> !UnwindSafe for LinearError<F>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more