Skip to content

test: Add integration tests for CrossValidators module [P1] #625

Description

@ooples

Overview

This issue tracks integration tests for the CrossValidators module. P1 (High Priority).

Parent Issue: #615

Current Status

  • Coverage: 0%
  • Source Files: 9 files
  • Test Files: None

Module Location

src/CrossValidators/

Components to Test

Cross-Validators

  • KFoldCrossValidator
  • StratifiedKFoldCrossValidator
  • GroupKFoldCrossValidator
  • LeaveOneOutCrossValidator
  • TimeSeriesCrossValidator
  • MonteCarloValidator
  • NestedCrossValidator
  • StandardCrossValidator
  • CrossValidatorBase

Test Categories

1. K-Fold Tests

  • Verify fold sizes are equal
  • Test with different k values
  • Verify no data leakage between folds
  • Test shuffling behavior

2. Stratified K-Fold Tests

  • Verify class proportions preserved
  • Test with imbalanced classes
  • Compare against scikit-learn

3. Group K-Fold Tests

  • Verify groups not split across folds
  • Test with varying group sizes

4. Leave-One-Out Tests

  • Verify n folds for n samples
  • Test computational efficiency

5. Time Series Tests

  • Verify temporal ordering preserved
  • Test gap and max_train_size
  • No future data leakage

6. Nested CV Tests

  • Verify inner/outer loop separation
  • Test hyperparameter selection
  • Verify unbiased evaluation

7. Monte Carlo Tests

  • Test random splits
  • Verify split ratios
  • Test reproducibility with seed

Edge Cases

  • Test with very small datasets
  • Test with single class (should fail gracefully)
  • Test with k > n samples

Acceptance Criteria

  • All 9 validators tested
  • No data leakage verified
  • Fold indices correct
  • Compare against scikit-learn
  • 80%+ coverage

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions