AUSTINGINA commited on
Commit
3552a61
·
verified ·
1 Parent(s): efe3030

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +61 -0
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Austin.S---Forecasting
2
+ Forecasting
3
+ Adaptive Transformer–RL Framework for Sentiment-Driven Financial Forecasting
4
+ <img width="148" height="20" alt="image" src="https://github.com/user-attachments/assets/48e2c19c-441c-457c-869e-34da182f08d0" />
5
+ <img width="82" height="20" alt="image" src="https://github.com/user-attachments/assets/d2b57bb9-5ca6-4ceb-9966-bcc66dfa0832" />
6
+ <img width="86" height="20" alt="image" src="https://github.com/user-attachments/assets/39574e74-3569-4668-8a9f-a47c444f1b68" />
7
+
8
+ ## Overview
9
+
10
+ This repository contains the official implementation of the hybrid framework proposed in our MDPI Forecasting 2025 paper:
11
+ ## "From Market Volatility to Predictive Insight: An Adaptive Transformer–RL Framework for Sentiment-Driven Financial Time-Series Forecasting"
12
+ URL:https://www.mdpi.com/2571-9394/7/4/55
13
+
14
+ The framework integrates domain-specific sentiment analysis, heterogeneous prediction models (SVR + Transformer variants), and Deep Q-Network (DQN)-driven dynamic ensembling to address the challenges of financial time-series forecasting (e.g., market volatility, nonlinear regimes, and sentiment-quant data fusion).
15
+
16
+ ## Paper Abstract
17
+
18
+ Financial time-series prediction remains challenging due to market volatility, nonlinear dynamics, and the complex interplay between quantitative indicators and investor sentiment. Traditional models (e.g., ARIMA, GARCH) fail to capture textual sentiment, while static deep learning methods cannot adapt to market regime shifts (bull/bear/consolidation).
19
+
20
+ ## Our proposed framework:
21
+
22
+ 1. Constructs a domain-specific financial sentiment dictionary (16,673 entries) with up to 97.35% forum title classification accuracy.
23
+ 2. Fuses historical price data and investor sentiment into a hybrid model stack (SVR + 3 Transformer variants).
24
+ 3. Uses a DQN agent to dynamically ensemble predictions, adapting to real-time market conditions.
25
+
26
+ Experiments on diverse assets (China Unicom, CSI 100, Corn Futures, Amazon) show the framework outperforms benchmark and state-of-the-art models, achieving the lowest RMSE across volatile and stable markets.
27
+ ## Key Contributions
28
+ 1. Domain-Specific Sentiment Dictionary: Built via SnowNLP and Word2Vec, tailored for financial investor forums (16,673 entries, 97.35% classification accuracy).
29
+ 2. Heterogeneous Model Stack: Combines SVR (linear trends) with 3 Transformer variants (nonlinear dependencies):
30
+ * Base-Transformer (single-layer encoder for moderate markets)
31
+ * Multi-Transformer (3-layer encoder for volatile markets)
32
+ * Bi-Transformer (bidirectional encoder for contextual feature extraction)
33
+ 3. DQN-Driven Dynamic Ensembling: Adaptively weights model outputs based on market volatility (reward = -MSE), outperforming static ensembles (arithmetic mean, weighted average).
34
+ 4. Multi-Market Generalization: Validated on equities, indices, and commodities (RMB/USD-denominated assets) across global events (Russia–Ukraine war, COVID-19).
35
+ ## Repository Structure
36
+ ## 仓库结构
37
+ ```plaintext
38
+ .
39
+ ├── data/ # 数据处理脚本和样本数据
40
+ │ ├── raw/ # 原始数据(金融价格 + 论坛文本)
41
+ │ ├── processed/ # 预处理数据(归一化价格 + 情感分数)
42
+ │ ├── dictionary/ # 金融情感词典(16k 条目)
43
+ │ └── data_loader.py # 数据加载和预处理管道
44
+ ├── models/ # 核心模型实现
45
+ │ ├── sentiment/ # 情感分析(SnowNLP + Word2Vec)
46
+ │ ├── predictors/ # 基础预测模型(SVR + Transformer 变体)
47
+ │ │ ├── svr.py
48
+ │ │ ├── base_transformer.py
49
+ │ │ ├── multi_transformer.py
50
+ │ │ └── bi_transformer.py
51
+ │ └── dqn_ensemble.py # 基于 DQN 的动态集成
52
+ ├── experiments/ # 实验脚本
53
+ │ ├── train.py # 模型训练管道
54
+ │ ├── evaluate.py # 评估(RMSE/MAE/MAPE)
55
+ │ └── visualize.py # 结果可视化(时间序列图、SHAP 分析)
56
+ ├── utils/ # 辅助函数
57
+ │ ├── metrics.py # 评估指标(MSE, RMSE, MAE, MAPE)
58
+ │ └── preprocessing.py # 文本清洗(正则、停用词移除、结巴分词)
59
+ ├── requirements.txt # 依赖项
60
+ ├── LICENSE # MIT 许可证
61
+ └── README.md # 项目文档