11 January 2026
Equity factor payoffs are strongly time-varying, raising the practical question of whether factor exposure can be adapted across market regimes using a simple, pre-specified, implementable rule rather than discretionary timing. We study adaptive factor allocation via machine-learning-based regime classification in a long-only U.S. equity setting. Using 25 fundamental characteristics, we construct investable signal portfolios and aggregate them into two tradable sleeves: an Offensive basket (growth-oriented signals) and a Defensive basket (quality and conservative signals). Market regimes are defined from an EWMA volatility proxy computed on an investable benchmark and mapped into a binary high/low state. We train multiple supervised classifiers under a common feature set and evaluate them in a walk-forward design with annual refits at June formation dates and a fixed July–June holding horizon. The out-of-sample evaluation spans July 1980–June 2024 and enforces strict point-in-time constraints and explicit timing alignment to preclude look-ahead bias. Performance is reported gross and net of turnover-scaled transaction costs, and risk-adjusted results are assessed under alternative factor models with HAC inference and multiple-testing diagnostics. We find that several regime-switching configurations improve net performance relative to the market benchmark with an economically modest gross-to-net wedge under annual implementation. However, incremental gains relative to transparent buy-and-hold allocations (including a 50/50 Offensive/Defensive benchmark) are typically modest, benchmark-dependent, and sensitive to the risk-adjustment model. Overall, machine learning can add value for regime-based factor allocation in some configurations, but the effect is heterogeneous and implementation frictions are first-order for net performance.
Machine Learning • Regime Detection • Factor Investing • Asset Allocation • Volatility Regimes • Long-Only Portfolios • Transaction Costs • Out-of-Sample Evaluation
Abdul Kadir Jeylani Bakari
HEC Lausanne, Université de Lausanne
The repository is organized to ensure full reproducibility of the research paper results.
adaptive-factor-allocation/
├── Paper.pdf # Complete research paper
├── Paper_short.pdf # Shorter version (10 pages + Appendix) of Paper.pdf
├── LICENSE # Apache 2.0 License
├── README.md # This file
└── project/ # Complete Research Pipeline (Code, Data, Results)
├── README.md # Technical Pipeline Documentation
├── environment.yml # Conda environment configuration
├── requirements.txt # Python dependencies
├── 01_signal_formation... # Analysis Notebooks (Sequence 01-12)
├── data/ # Processed datasets (Signals, Portfolios, ML Features)
└── results/ # Output Tables, Figures, and LaTeX exports
This repository intentionally does not include any data files or derived datasets (e.g., project/data/**, data/**) because they originate from proprietary sources licensed via WRDS (Wharton Research Data Services) (CRSP, Compustat, CCM).
To reproduce the full pipeline, users must have their own valid WRDS license and obtain the raw datasets independently. The setup script creates the expected folder structure; users must then place the raw input files in the designated directory (e.g., project/raw_data_processing/**).
No redistribution: Users may not redistribute WRDS-licensed data or any files derived from it through this repository.
git clone https://github.com/jeyllani/adaptive-factor-allocation.git
cd adaptive-factor-allocationWe recommend using Conda to manage the scientific python stack:
cd project
conda env create -f environment.yml
conda activate afactorsNavigate to the project/ directory and execute the notebooks in sequence (or use the provided reproduction scripts).
cd project
jupyter notebookRefer to project/README.md for detailed step-by-step technical instructions.
Special thanks to Ms Maria-Pia Lombardo, Ms Anna Smirnova, Prof. Simon Scheidegger, and Prof. Amit Goyal (HEC Université de Lausanne).
For any questions or issues regarding this codebase, please contact the author.
If you use this repository, please credit the author.
HYPOTHETICAL PERFORMANCE RESULTS HAVE MANY INHERENT LIMITATIONS, SOME OF WHICH ARE DESCRIBED BELOW. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN. IN FACT, THERE ARE FREQUENTLY SHARP DIFFERENCES BETWEEN HYPOTHETICAL PERFORMANCE RESULTS AND THE ACTUAL RESULTS SUBSEQUENTLY ACHIEVED BY ANY PARTICULAR TRADING PROGRAM.
ONE OF THE LIMITATIONS OF HYPOTHETICAL PERFORMANCE RESULTS IS THAT THEY ARE GENERALLY PREPARED WITH THE BENEFIT OF HINDSIGHT. IN ADDITION, HYPOTHETICAL TRADING DOES NOT INVOLVE FINANCIAL RISK, AND NO HYPOTHETICAL TRADING RECORD CAN COMPLETELY ACCOUNT FOR THE IMPACT OF FINANCIAL RISK IN ACTUAL TRADING. FOR EXAMPLE, THE ABILITY TO WITHSTAND LOSSES OR TO ADHERE TO A PARTICULAR TRADING PROGRAM IN SPITE OF TRADING LOSSES ARE MATERIAL POINTS WHICH CAN ALSO ADVERSELY AFFECT ACTUAL TRADING RESULTS. THERE ARE NUMEROUS OTHER FACTORS RELATED TO THE MARKETS IN GENERAL OR TO THE IMPLEMENTATION OF ANY SPECIFIC TRADING PROGRAM WHICH CANNOT BE FULLY ACCOUNTED FOR IN THE PREPARATION OF HYPOTHETICAL PERFORMANCE RESULTS AND ALL OF WHICH CAN ADVERSELY AFFECT ACTUAL TRADING RESULTS.
Educational Purpose: This code is provided solely for academic context and educational purposes. It is not financial advice.
Apache 2.0 (See LICENSE)