pub enum TreeError {
SplitterError(SplitterError),
CriterionError(CriterionError),
DataError(DataError),
FeatureMatrixError(FeatureMatrixError),
BuildingError(String),
ConfigError(String),
}Expand description
Errors that can occur during tree construction and manipulation.
This enum aggregates errors from all tree-related submodules, providing
a unified error type for tree operations. It uses the #[from] attribute
to enable automatic conversion from submodule-specific errors.
§Error Variants
SplitterError: Failed to find optimal split (e.g., insufficient samples)CriterionError: Error computing split gain or leaf valuesDataError: Invalid training data structureFeatureMatrixError: Problem accessing feature valuesBuildingError: General tree construction failureConfigError: Invalid tree configuration
§Conversions
TreeError can be converted to CoreError for integration with the
main boosting pipeline.
Variants§
SplitterError(SplitterError)
CriterionError(CriterionError)
DataError(DataError)
FeatureMatrixError(FeatureMatrixError)
BuildingError(String)
ConfigError(String)
Trait Implementations§
Source§impl Error for TreeError
impl Error for TreeError
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 From<CriterionError> for TreeError
impl From<CriterionError> for TreeError
Source§fn from(source: CriterionError) -> Self
fn from(source: CriterionError) -> Self
Converts to this type from the input type.
Source§impl From<FeatureMatrixError> for TreeError
impl From<FeatureMatrixError> for TreeError
Source§fn from(source: FeatureMatrixError) -> Self
fn from(source: FeatureMatrixError) -> Self
Converts to this type from the input type.
Source§impl From<SplitterError> for TreeError
impl From<SplitterError> for TreeError
Source§fn from(source: SplitterError) -> Self
fn from(source: SplitterError) -> Self
Converts to this type from the input type.
Source§impl From<TreeError> for CoreError
Conversion from tree errors to core library errors.
impl From<TreeError> for CoreError
Conversion from tree errors to core library errors.
This From implementation enables seamless error propagation from
tree construction up to the main crate::core::CoreError type used
by the gradient booster.
All tree errors are converted to CoreError::TrainingError with a
descriptive message.
Auto Trait Implementations§
impl Freeze for TreeError
impl !RefUnwindSafe for TreeError
impl Send for TreeError
impl Sync for TreeError
impl Unpin for TreeError
impl !UnwindSafe for TreeError
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
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>
Converts
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>
Converts
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