pub struct ContractTester { /* private fields */ }Expand description
Main contract testing framework
Implementations§
Source§impl ContractTester
impl ContractTester
Sourcepub fn new() -> ContractTester
pub fn new() -> ContractTester
Create a new contract tester with default configuration
Sourcepub fn with_config(config: ContractTestConfig) -> ContractTester
pub fn with_config(config: ContractTestConfig) -> ContractTester
Create a contract tester with custom configuration
Sourcepub fn test_estimator_contract<E>(
&mut self,
estimator: &E,
) -> Result<(), SklearsError>where
E: Estimator + Clone + Debug + Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>,
<E as Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>>::Fitted: Predict<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>,
pub fn test_estimator_contract<E>(
&mut self,
estimator: &E,
) -> Result<(), SklearsError>where
E: Estimator + Clone + Debug + Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>,
<E as Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>>::Fitted: Predict<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>,
Test an estimator implementation against the Estimator trait contract
Sourcepub fn test_transform_contract<T>(
&mut self,
transformer: &T,
) -> Result<(), SklearsError>where
T: Clone + Debug + Transform<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>> + Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>,
<T as Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>>::Fitted: Transform<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>>,
pub fn test_transform_contract<T>(
&mut self,
transformer: &T,
) -> Result<(), SklearsError>where
T: Clone + Debug + Transform<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>> + Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>,
<T as Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>, f64>>>::Fitted: Transform<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>, f64>>,
Test a transformer implementation against the Transform trait contract
Sourcepub fn test_predict_proba_contract<P>(
&mut self,
predictor: &P,
) -> Result<(), SklearsError>
pub fn test_predict_proba_contract<P>( &mut self, predictor: &P, ) -> Result<(), SklearsError>
Test prediction probability contracts for classifiers
Sourcepub fn generate_report(&self) -> String
pub fn generate_report(&self) -> String
Generate a comprehensive test report
Sourcepub fn get_summary(&self) -> ContractTestSummary
pub fn get_summary(&self) -> ContractTestSummary
Get summary statistics for all contract tests
Trait Implementations§
Source§impl Debug for ContractTester
impl Debug for ContractTester
Source§impl Default for ContractTester
impl Default for ContractTester
Source§fn default() -> ContractTester
fn default() -> ContractTester
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ContractTester
impl RefUnwindSafe for ContractTester
impl Send for ContractTester
impl Sync for ContractTester
impl Unpin for ContractTester
impl UnsafeUnpin for ContractTester
impl UnwindSafe for ContractTester
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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