Remove redundant learning curve implementation paths #963
Merged
bruAristimunha merged 13 commits intodevelopfrom Feb 4, 2026
Merged
Remove redundant learning curve implementation paths #963bruAristimunha merged 13 commits intodevelopfrom
bruAristimunha merged 13 commits intodevelopfrom
Conversation
* Initial plan * Remove redundant learning curve implementation - Remove data_size and n_perms parameters from WithinSessionEvaluation - Remove get_data_size_subsets(), score_explicit(), and _evaluate_learning_curve() methods - Simplify evaluate() to always use _evaluate() path - Update docstring to recommend cv_class=LearningCurveSplitter - Update all examples to use new LearningCurveSplitter API - Update tests to use new API Co-authored-by: bruAristimunha <[email protected]> * Fix pre-commit linting issues - Apply black formatting (line length 90) - Fix import sorting with isort - Remove unused imports (Optional, StratifiedShuffleSplit) - Apply ruff fixes Co-authored-by: bruAristimunha <[email protected]> * Apply final black formatting fixes - Remove extra blank lines per black style guide Co-authored-by: bruAristimunha <[email protected]> * Fix isort import ordering - Apply isort to properly order imports in all changed files Co-authored-by: bruAristimunha <[email protected]> * Resolve black/isort formatting conflict - Apply black formatting after isort - Remove extra blank line after imports * Add single-class safeguard for LearningCurveSplitter - Skip splits where training set collapses to single class - Log warning when splits are skipped due to single-class training sets - Fix ArrowStringArray shuffle warnings by converting to numpy arrays - Update tests to call process() since validation happens at evaluation time - Fix isort import ordering in learning curve examples --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bruAristimunha <[email protected]> Co-authored-by: Bru <[email protected]>
Document the learning curve and splitter improvements: - cv_class and cv_kwargs parameters for all evaluation classes - LearningCurveSplitter for sklearn-compatible learning curves - Removal of data_size and n_perms from WithinSessionEvaluation - Automatic metadata columns for learning curve results - Centralized CV resolution with _resolve_cv() method - Removal of redundant learning curve methods
Test that LearningCurveSplitter can be used as cv_class parameter for all main splitters: WithinSessionSplitter, WithinSubjectSplitter, CrossSessionSplitter, and CrossSubjectSplitter.
Document the extraction of _load_data() and _get_nchan() helpers into BaseEvaluation, the move of _pipeline_requires_epochs() to utils.py, and the WithinSessionSplitter creation hoisted outside the session loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR unifies the learning curve implementation by removing redundant code paths and consolidating all learning curve functionality into the
LearningCurveSplitterclass. This makes learning curves available across all evaluation types (WithinSession, CrossSession, CrossSubject) through a consistent API.Changes
New Features
cv_classandcv_kwargsparameters to all evaluation classes for custom cross-validation strategiesLearningCurveSplitteras a dedicated sklearn-compatible cross-validator for learning curvesAPI Changes
data_sizeandn_permsparameters fromWithinSessionEvaluationcv_class=LearningCurveSplitterwithcv_kwargs=dict(data_size=..., n_perms=...)insteadCode Health
BaseEvaluationwith new_resolve_cv()methodWithinSessionEvaluation:get_data_size_subsets()score_explicit()_evaluate_learning_curve()evaluate()to always use unified_evaluate()pathOther Improvements
LearningCurveSplitter(skip splits where training set collapses to single class)Migration Guide
Before:
After:
Test Plan
Closes #962