feat: optuna#121
Merged
ayushkrtiwari merged 12 commits intoOPCODE-Open-Spring-Fest:mainfrom Nov 15, 2025
Merged
Conversation
✅ Deploy Preview for strong-duckanoo-898b2c ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for qrsopcode canceled.
|
383edc4 to
8f2cbe7
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR integrates Optuna hyperparameter optimization into the quantitative research framework, enabling automated hyperparameter tuning for factor-based trading strategies with support for early stopping via pruning and distributed optimization via RDB storage.
Key changes:
- Added Optuna integration with pruning strategies (MedianPruner, PercentilePruner) for efficient hyperparameter search
- Implemented new
autotuneCLI command with YAML configuration support for optimizing momentum, volatility, and other factors - Added dependencies for
optuna>=3.0.0andpyyaml>=6.0to support the new functionality
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/quant_research_starter/tuning/optuna_runner.py | Core Optuna integration implementing OptunaRunner class, backtest objective function factory, and hyperparameter suggestion utilities |
| src/quant_research_starter/tuning/init.py | Module initialization exporting OptunaRunner |
| src/quant_research_starter/cli.py | Added autotune CLI command with options for data file, factor type, trials, metrics, storage, and pruning configuration |
| pyproject.toml | Added optuna and pyyaml dependencies |
| examples/autotune_config.yaml | Example YAML configuration demonstrating all tuning options |
| README.md | Documentation for hyperparameter tuning feature with usage examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
fabdd77 to
5203024
Compare
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.
Description
This PR integrates Optuna hyperparameter optimization with pruning support into the quantitative research framework. The implementation automates hyperparameter search for factor-based strategies, enabling efficient optimization of trading strategy parameters.
Key Changes
New
tuning/optuna_runner.pymodule: Core Optuna integration with support for:New CLI command
autotune: Command-line interface for hyperparameter tuning with:Example YAML configuration:
examples/autotune_config.yamldemonstrating all configuration optionsDependencies: Added
optuna>=3.0.0andpyyaml>=6.0to project dependenciesDocumentation: Updated README with comprehensive autotune documentation and usage examples
Testing
pytestpasses locallyruff,black)Semver Changes
Issues
Closes #95 - autotune: integrate Optuna hyperparameter optimization + pruning
Checklist