pub enum ProjectionError {
EmptyCorpus,
DimensionTooLow {
got: usize,
required: usize,
},
InconsistentDimension {
index: usize,
expected: usize,
got: usize,
},
TooFewEmbeddings {
got: usize,
required: usize,
},
InvalidSigma {
got: f64,
},
SliceLengthMismatch {
expected: usize,
got: usize,
},
}Expand description
Reasons a projection fit can fail.
Every concrete projection’s fit used to panic via assert! on
invalid input, which turned typos in Python / WASM bindings into
PanicExceptions. These variants classify the same preconditions
so callers can surface typed errors instead.
Variants§
EmptyCorpus
The input slice was empty. Fitting needs at least one embedding.
DimensionTooLow
Embedding dimensionality below the projection’s requirement.
PCA and kernel PCA need dim >= 3; Laplacian requires dim > 0.
InconsistentDimension
Embeddings disagreed on dimensionality. Every row must match the first one; the mismatch is reported with the offending index.
TooFewEmbeddings
Projection needs more embeddings than were provided. Laplacian
eigenmap’s graph construction requires n >= 4.
InvalidSigma
fit_with_sigma was given a non-positive Gaussian bandwidth.
SliceLengthMismatch
A parallel slice (e.g. category labels) did not have the same length as the embedding slice.
Trait Implementations§
Source§impl Clone for ProjectionError
impl Clone for ProjectionError
Source§fn clone(&self) -> ProjectionError
fn clone(&self) -> ProjectionError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectionError
impl Debug for ProjectionError
Source§impl Display for ProjectionError
impl Display for ProjectionError
Source§impl Error for ProjectionError
impl Error for ProjectionError
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()
Source§impl From<ProjectionError> for PipelineError
impl From<ProjectionError> for PipelineError
Source§fn from(source: ProjectionError) -> Self
fn from(source: ProjectionError) -> Self
Source§impl PartialEq for ProjectionError
impl PartialEq for ProjectionError
Source§fn eq(&self, other: &ProjectionError) -> bool
fn eq(&self, other: &ProjectionError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProjectionError
Auto Trait Implementations§
impl Freeze for ProjectionError
impl RefUnwindSafe for ProjectionError
impl Send for ProjectionError
impl Sync for ProjectionError
impl Unpin for ProjectionError
impl UnsafeUnpin for ProjectionError
impl UnwindSafe for ProjectionError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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