Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an autoregressive (AR) alpha implementation and a new alpha evaluation utility (information coefficient) with corresponding unit tests, extending the alpha pipeline with model-based signals and evaluation tooling.
Changes:
- Introduces AR model utilities + a bundled pretrained weights file under
alpha/AutoRegression/. - Adds
AutoregressionAlphathat computes anar_predsignal column from AR predictions. - Adds
AlphaEvaluatorto compute Spearman IC vs. forward returns, plus new tests for AR alpha and IC evaluation.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_alpha.py |
Adds tests for AutoregressionAlpha and AlphaEvaluator. |
alpha/interface.py |
Adds AlphaEvaluator and forward-return timeframe configuration. |
alpha/AutoregressionAlpha.py |
Implements AR-based alpha signal (ar_pred) using a pretrained torch model. |
alpha/AutoRegression/data_processing.py |
Adds utilities to load data and compute log returns (training/experimentation support). |
alpha/AutoRegression/autoregression.py |
Adds AR model definition, training/inference helpers, and model-loading logic. |
alpha/AutoRegression/ar_model.pth |
Adds pretrained AR model weights artifact. |
💡 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>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…a instance Agent-Logs-Url: https://github.com/mlsys-io/PortfolioBench/sessions/36ad2240-1e58-424c-a71e-18338280393a Co-authored-by: CYX22222003 <138369841+CYX22222003@users.noreply.github.com>
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.
This pull request introduces an autoregressive (AR) model for time series prediction and adds an evaluation framework for alpha signals, along with corresponding tests. The main themes are the implementation of the AR model, integration into the alpha signal pipeline, and the addition of an information coefficient (IC) evaluation utility.
Key changes:
Autoregressive Model Implementation
ARmodel class and related utilities for training, inference, and dataset preparation inautoregression.py, including functions to build training data, train the model, and load a pretrained model.data_processing.py) to load financial time series data and compute log returns.Integration with Alpha Pipeline
AutoregressionAlpha, anIAlphasubclass, which computes AR-based predictions and adds them as a new column (ar_pred) to the DataFrame.Alpha Signal Evaluation
AlphaEvaluatorclass tointerface.py, which computes the information coefficient (Spearman correlation) between specified alpha signals and future returns over multiple timeframes.Testing
AutoregressionAlphato verify the presence and correctness of thear_predcolumn and its handling of short series.AlphaEvaluatorto ensure correct output format, value types, and expected behavior on constant alpha signals.