pub struct DataValidator;Expand description
Re-exported validation utilities.
This includes validators for data integrity, parameter constraints, and common model hyperparameter validation. Validator for input data integrity.
Provides methods to check data quality including finiteness, positivity, dimensional consistency, and target value validity.
Implementations§
Source§impl DataValidator
impl DataValidator
Sourcepub fn check_finite(&self, values: &[f64]) -> ValidationResult<()>
pub fn check_finite(&self, values: &[f64]) -> ValidationResult<()>
Sourcepub fn check_positive(&self, values: &[f64]) -> ValidationResult<()>
pub fn check_positive(&self, values: &[f64]) -> ValidationResult<()>
Sourcepub fn check_probability(&self, values: &[f64]) -> ValidationResult<()>
pub fn check_probability(&self, values: &[f64]) -> ValidationResult<()>
Sourcepub fn validate_features(
&self,
n_samples: usize,
n_features: usize,
feature_names: Option<&[String]>,
) -> ValidationResult<()>
pub fn validate_features( &self, n_samples: usize, n_features: usize, feature_names: Option<&[String]>, ) -> ValidationResult<()>
Sourcepub fn validate_targets(
&self,
targets: &[f64],
is_classification: bool,
) -> ValidationResult<()>
pub fn validate_targets( &self, targets: &[f64], is_classification: bool, ) -> ValidationResult<()>
Validates target values for regression or classification.
§Arguments
targets- Target values to validateis_classification- Whether this is a classification problem
§Returns
Ok(()) if targets are valid, Err otherwise
§Behavior
- For classification: targets must be 0.0 or 1.0
- For regression: targets must be finite (no other constraints)
Sourcepub fn assert_same_length(&self, a: &[f64], b: &[f64]) -> ValidationResult<()>
pub fn assert_same_length(&self, a: &[f64], b: &[f64]) -> ValidationResult<()>
Sourcepub fn assert_non_empty(&self, values: &[f64]) -> ValidationResult<()>
pub fn assert_non_empty(&self, values: &[f64]) -> ValidationResult<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataValidator
impl RefUnwindSafe for DataValidator
impl Send for DataValidator
impl Sync for DataValidator
impl Unpin for DataValidator
impl UnwindSafe for DataValidator
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