pub enum KernelPcaError {
NotFitted(String),
InvalidInput(String),
EigendecompositionFailed(String),
DimensionMismatch {
expected: usize,
got: usize,
context: String,
},
InsufficientComponents {
requested: usize,
available: usize,
},
}Expand description
Failure modes for crate::kernel_pca::KernelPCA and friends.
Variants are deliberately coarse — one variant per kind of failure
— and each carries a String message that names the offending
argument. The five variants listed below match the
v0.2.0 research-preview contract.
Variants§
NotFitted(String)
Operation was requested against a model that has not been fitted
yet (e.g. transform before fit).
InvalidInput(String)
Input violates an invariant of the Kernel PCA API — empty
training set, zero-dimensional feature vector, n_components = 0
requested, etc.
EigendecompositionFailed(String)
The underlying symmetric eigensolver refused the problem or
failed numerically. The inner String is the message reported
by the solver.
DimensionMismatch
Vector or matrix supplied to transform has a different feature
dimension than the data used at fit time.
Fields
InsufficientComponents
The eigendecomposition produced fewer positive eigenvalues than the number of components requested by the caller — i.e. the kernel matrix is effectively low-rank and the requested KPCA embedding dimension is unreachable.
Trait Implementations§
Source§impl Debug for KernelPcaError
impl Debug for KernelPcaError
Source§impl Display for KernelPcaError
impl Display for KernelPcaError
Source§impl Error for KernelPcaError
impl Error for KernelPcaError
1.30.0 · 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
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for KernelPcaError
impl RefUnwindSafe for KernelPcaError
impl Send for KernelPcaError
impl Sync for KernelPcaError
impl Unpin for KernelPcaError
impl UnsafeUnpin for KernelPcaError
impl UnwindSafe for KernelPcaError
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