pub enum RegressionError {
RowMismatch {
rows_x: usize,
rows_y: usize,
},
EmptyInput,
RaggedRows,
Singular,
InvalidPenalty,
}Expand description
Errors that prevent a linear model from being fitted.
Returned (never panicked) so callers stay clear of the crate’s unwrap/panic
lint gate and can surface a clean diagnostic.
Variants§
RowMismatch
x and y disagreed on the number of observations (rows).
Fields
EmptyInput
The design matrix had no rows, so no model can be fitted.
RaggedRows
Rows of x did not all share the same number of columns.
Singular
The (penalised) normal-equations matrix was singular to working precision, so the coefficients are not uniquely determined.
InvalidPenalty
The ridge penalty λ was negative (or non-finite), which is not a valid L2
regularisation strength.
Trait Implementations§
Source§impl Clone for RegressionError
impl Clone for RegressionError
Source§fn clone(&self) -> RegressionError
fn clone(&self) -> RegressionError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegressionError
impl Debug for RegressionError
Source§impl Display for RegressionError
impl Display for RegressionError
impl Eq for RegressionError
Source§impl Error for RegressionError
impl Error for RegressionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for RegressionError
impl PartialEq for RegressionError
Source§fn eq(&self, other: &RegressionError) -> bool
fn eq(&self, other: &RegressionError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RegressionError
Auto Trait Implementations§
impl Freeze for RegressionError
impl RefUnwindSafe for RegressionError
impl Send for RegressionError
impl Sync for RegressionError
impl Unpin for RegressionError
impl UnsafeUnpin for RegressionError
impl UnwindSafe for RegressionError
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