Add cross validation and cross validation accessories.#69
Draft
dcelisgarza wants to merge 64 commits intomainfrom
Draft
Add cross validation and cross validation accessories.#69dcelisgarza wants to merge 64 commits intomainfrom
dcelisgarza wants to merge 64 commits intomainfrom
Conversation
Removed commented-out code and unused variables to clean up the function logic.
… fixed or variable, in order to allow for cross validation to pass on current weights, allow fallbacks to be optimisation results
Refactor the construction of matrix X for efficiency.
…d and walkforward
Removed unused calc_prediction_moment_target and related functions to clean up the code.
…sers. Breaking: ReturnRiskMeasure -> ExpectedReturn, ReturnRiskRatioRiskMeasure -> ExpectedReturnRiskRatio
This was referenced Feb 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds cross validation functionality and related accessories to PortfolioOptimisers.jl. The implementation includes multiple cross validation strategies (KFold, Combinatorial, WalkForward, MultipleRandomised), prediction and scoring infrastructure, and integration with existing optimisation estimators.
Changes:
- Adds 9 new cross validation files implementing various CV strategies and scoring mechanisms
- Implements factory pattern and
needs_previous_weightstracking across all optimisation estimators - Renames
ReturnRiskMeasure→ExpectedReturnandReturnRiskRatioRiskMeasure→ExpectedReturnRiskRatio - Adds comprehensive test coverage with new test data files
- Updates documentation, examples, and dependency versions
Reviewed changes
Copilot reviewed 115 out of 137 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/20_Optimisation/02_CrossValidation/*.jl | 9 new files implementing CV base types, KFold, Combinatorial, WalkForward, MultipleRandomised, validation, scoring, and wrappers |
| src/20_Optimisation/*Optimisation.jl | Added factory methods and needs_previous_weights tracking to all optimisation estimators |
| src/19_RiskMeasures/*.jl | Renamed risk measures, added MeanReturnRiskRatio, updated expected_risk functions |
| test/*.jl | Updated tests with new CV test cases and needs_previous_weights assertions |
| test/assets/*.csv.gz | New binary test data files for CV predictions |
| examples/.jl, docs/.md | Updated risk measure names throughout |
| Project.toml | Version bump to 0.16.0, added Combinatorics dependency |
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.
No description provided.