pub enum SVMError {
Show 37 variants
InvalidInput {
message: String,
suggestion: Option<String>,
},
DimensionMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
context: String,
expected_str: String,
actual_str: String,
},
EmptyDataset {
context: String,
},
InvalidLabels {
reason: String,
suggestion: String,
},
InsufficientData {
required: usize,
actual: usize,
context: String,
},
InvalidHyperparameter {
parameter: String,
value: String,
reason: String,
valid_range: Option<String>,
},
InvalidKernel {
kernel_type: String,
message: String,
suggestion: String,
},
InvalidSolver {
solver: String,
reason: String,
compatible_solvers: Vec<String>,
},
ConvergenceFailure {
iterations: usize,
final_objective: Option<f64>,
tolerance: f64,
suggestions: Vec<String>,
},
NumericalInstability {
issue: String,
context: String,
suggestions: Vec<String>,
},
OptimizationFailure {
algorithm: String,
reason: String,
iteration: Option<usize>,
objective_value: Option<f64>,
},
InfeasibleProblem {
reason: String,
suggestions: Vec<String>,
},
KernelComputationError {
kernel_type: String,
reason: String,
sample_indices: Option<Vec<usize>>,
},
NonPositiveSemidefiniteKernel {
eigenvalue_info: Option<String>,
suggestions: Vec<String>,
},
KernelCacheError {
operation: String,
reason: String,
memory_usage: Option<usize>,
},
OutOfMemory {
operation: String,
requested_bytes: Option<usize>,
available_bytes: Option<usize>,
suggestions: Vec<String>,
},
InsufficientResources {
resource: String,
required: String,
available: String,
},
AllocationError {
purpose: String,
reason: String,
size_bytes: Option<usize>,
},
ModelNotTrained {
operation: String,
suggestions: Vec<String>,
},
PredictionError {
reason: String,
sample_count: Option<usize>,
context: String,
},
ModelStateInconsistency {
issue: String,
context: String,
},
ParallelProcessingError {
operation: String,
reason: String,
thread_count: Option<usize>,
},
SynchronizationError {
details: String,
operation: String,
},
GpuError {
reason: String,
device_info: Option<String>,
fallback_available: bool,
},
SimdError {
operation: String,
reason: String,
fallback_used: bool,
},
SerializationError {
operation: String,
reason: String,
format: String,
},
IoError {
operation: String,
path: Option<String>,
reason: String,
},
CrossValidationError {
fold: Option<usize>,
reason: String,
total_folds: Option<usize>,
},
HyperparameterOptimizationError {
method: String,
reason: String,
iteration: Option<usize>,
best_score: Option<f64>,
},
MultiClassError {
strategy: String,
reason: String,
class_count: Option<usize>,
},
MultiLabelError {
reason: String,
label_indices: Option<Vec<usize>>,
},
StructuredSVMError {
reason: String,
sequence_info: Option<String>,
},
TopicModelingError {
model_type: String,
reason: String,
topic_count: Option<usize>,
},
TextProcessingError {
operation: String,
reason: String,
document_index: Option<usize>,
},
ComputerVisionError {
kernel_type: String,
reason: String,
image_dimensions: Option<(usize, usize)>,
},
InternalError {
message: String,
location: String,
debug_info: Option<String>,
},
Unknown {
message: String,
context: String,
},
}Expand description
Main SVM Error type that encompasses all possible SVM operation failures
Variants§
InvalidInput
Invalid input data dimensions or format
DimensionMismatch
Dimension mismatch between arrays
Fields
EmptyDataset
Empty dataset provided
InvalidLabels
Invalid labels (e.g., non-finite, wrong format)
InsufficientData
Insufficient data for training
InvalidHyperparameter
Invalid hyperparameters
InvalidKernel
Invalid kernel configuration
InvalidSolver
Invalid solver configuration
ConvergenceFailure
Training failed to converge
NumericalInstability
Numerical instability during training
OptimizationFailure
Optimization algorithm failure
InfeasibleProblem
Infeasible optimization problem
KernelComputationError
Kernel matrix computation failed
NonPositiveSemidefiniteKernel
Kernel matrix is not positive semidefinite
KernelCacheError
Kernel cache errors
OutOfMemory
Out of memory during computation
Fields
InsufficientResources
Insufficient computational resources
AllocationError
Memory allocation failed
ModelNotTrained
Model not trained
PredictionError
Prediction failed
ModelStateInconsistency
Model state inconsistency
ParallelProcessingError
Parallel processing error
SynchronizationError
Thread synchronization error
GpuError
GPU computation error
SimdError
SIMD operation error
SerializationError
Model serialization/deserialization error
IoError
File I/O error during model operations
CrossValidationError
Cross-validation error
HyperparameterOptimizationError
Hyperparameter optimization error
MultiClassError
Multi-class strategy error
MultiLabelError
Multi-label SVM error
StructuredSVMError
Structured SVM error
TopicModelingError
Topic modeling integration error
TextProcessingError
Text processing error
ComputerVisionError
Computer vision kernel error
InternalError
Internal error (should not normally occur)
Unknown
Unknown or unexpected error
Implementations§
Source§impl SVMError
impl SVMError
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get the severity level of this error
Sourcepub fn error_code(&self) -> u32
pub fn error_code(&self) -> u32
Get error code for programmatic handling
Sourcepub fn suggestions(&self) -> Vec<String>
pub fn suggestions(&self) -> Vec<String>
Get suggestions for resolving this error
Sourcepub fn detailed_report(&self) -> String
pub fn detailed_report(&self) -> String
Create a detailed error report
Source§impl SVMError
Convenience functions for creating common errors
impl SVMError
Convenience functions for creating common errors
Sourcepub fn invalid_input(message: impl Into<String>) -> Self
pub fn invalid_input(message: impl Into<String>) -> Self
Create an invalid input error with suggestions
Sourcepub fn invalid_input_with_suggestion(
message: impl Into<String>,
suggestion: impl Into<String>,
) -> Self
pub fn invalid_input_with_suggestion( message: impl Into<String>, suggestion: impl Into<String>, ) -> Self
Create an invalid input error with a suggestion
Sourcepub fn dimension_mismatch(
expected: Vec<usize>,
actual: Vec<usize>,
context: impl Into<String>,
) -> Self
pub fn dimension_mismatch( expected: Vec<usize>, actual: Vec<usize>, context: impl Into<String>, ) -> Self
Create a dimension mismatch error
Sourcepub fn convergence_failure(
iterations: usize,
tolerance: f64,
suggestions: Vec<String>,
) -> Self
pub fn convergence_failure( iterations: usize, tolerance: f64, suggestions: Vec<String>, ) -> Self
Create a convergence failure error
Sourcepub fn model_not_trained(operation: impl Into<String>) -> Self
pub fn model_not_trained(operation: impl Into<String>) -> Self
Create a model not trained error
Sourcepub fn out_of_memory(operation: impl Into<String>) -> Self
pub fn out_of_memory(operation: impl Into<String>) -> Self
Create an out of memory error with suggestions
Trait Implementations§
Source§impl Error for SVMError
impl Error for SVMError
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
Source§impl From<GpuKernelError> for SVMError
Conversion functions for backward compatibility with existing error types
impl From<GpuKernelError> for SVMError
Conversion functions for backward compatibility with existing error types
Source§fn from(err: GpuKernelError) -> Self
fn from(err: GpuKernelError) -> Self
impl StructuralPartialEq for SVMError
Auto Trait Implementations§
impl Freeze for SVMError
impl RefUnwindSafe for SVMError
impl Send for SVMError
impl Sync for SVMError
impl Unpin for SVMError
impl UnwindSafe for SVMError
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> 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