# Stacked LightGBM Ensemble for Detecting Market Reversal Points 1. Problem Overview The objective of this competition is to detect reversal points in U.S. equities using historical and engineered market features. The task is formulated as a multi-class classification problem , where each observation represents a market state that may indicate a potential trend reversal. Given the noisy nature of financial time-series data and the presence of class imbalance, the proposed solution focuses on robust target engineering, strong tree-based models, and ensemble learning . 2. Target Engineering The original target labels contain several closely related categories. To reduce label noise and improve class separability, the labels were consolidated into three semantically meaningful classes : H (High-type reversal) → {HH, LH, H} L (Low-type reversal) → {HL, LL, L} None → all remaining cases This simplification leads to: Improved model stability Higher Macro F1 performance Better generalization on unseen data 3. Data Preparation Training data from both the original and newly released datasets were merged to increase data coverage. Non-informative identifiers and time-related columns were removed. Missing values were handled using zero imputation . Feature alignment between training and test sets was strictly enforced to ensure consistency. 4. Handling Class Imbalance The dataset exhibits significant class imbalance. To mitigate this issue, balanced class weights were computed and converted into sample weights , which were passed directly to the learning algorithms during training. This approach ensures that minority classes contribute proportionally to the loss function and leads to improved Macro F1 performance. 5. Cross-Validation Strategy A 5-fold Stratified K-Fold Cross-Validation strategy was employed to: Preserve class distribution across folds Provide reliable out-of-fold (OOF) performance estimates Reduce overfitting and variance 6. Base Models (Level-0 Learners) To maximize ensemble diversity, three different LightGBM models were trained: Model 1: LightGBM (GBDT – Default) Strong baseline model Balanced bias–variance tradeoff Model 2: LightGBM (GBDT – Tuned) Larger tree capacity L1/L2 regularization Optimized feature and bagging fractions Model 3: LightGBM (DART) Dropout-based boosting strategy Reduces correlation between trees Improves ensemble robustness All base models: Used the multiclassova objective Applied early stopping Were evaluated using Macro F1 Score 7. Evaluation Metric Macro F1 Score was selected as the primary evaluation metric because: It treats all classes equally It is robust to class imbalance It better reflects real-world classification performance than accuracy 8. Ensemble Method: Stacking Instead of simple averaging, a stacking ensemble approach was implemented. Level-0 Output Out-of-fold probability predictions from all three LightGBM base models Level-1 Meta Learner Multinomial Logistic Regression Chosen for its simplicity, stability, and effectiveness in combining probabilistic outputs Regularization helps prevent overfitting 9. Meta-Model Validation The meta-learner was evaluated using cross-validated OOF predictions and achieved a higher Macro F1 score than any individual base model . This confirms that the stacking framework successfully captures the complementary strengths of the base learners and improves overall performance.