pub struct ValidationContext {
pub algorithm: String,
pub operation: String,
pub data_info: Option<DataInfo>,
}Expand description
Validation context for providing better error messages
Fields§
§algorithm: String§operation: String§data_info: Option<DataInfo>Implementations§
Source§impl ValidationContext
impl ValidationContext
Sourcepub fn new(algorithm: &str, operation: &str) -> ValidationContext
pub fn new(algorithm: &str, operation: &str) -> ValidationContext
Create a new validation context
Sourcepub fn with_data_info(
self,
n_samples: usize,
n_features: usize,
data_type: &str,
) -> ValidationContext
pub fn with_data_info( self, n_samples: usize, n_features: usize, data_type: &str, ) -> ValidationContext
Add data information to the context
Sourcepub fn format_error(&self, error: &SklearsError) -> String
pub fn format_error(&self, error: &SklearsError) -> String
Format error with context information
Trait Implementations§
Source§impl Clone for ValidationContext
impl Clone for ValidationContext
Source§fn clone(&self) -> ValidationContext
fn clone(&self) -> ValidationContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ValidationContext
impl RefUnwindSafe for ValidationContext
impl Send for ValidationContext
impl Sync for ValidationContext
impl Unpin for ValidationContext
impl UnwindSafe for ValidationContext
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> 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>
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