# 期末報告
###### tags: `報告`
- 報告需包含 data preprocessing、 model architecture、performance analysis
- 10 分鐘
- PPT: https://reurl.cc/Gob4OG
- PPT(01_13): https://reurl.cc/Vj52RA
# Outline
1. Data Pre-processing
2. Model Architecture
3. Performance Analysis
4. Conclusion
# Data Pre-processing
### Missing value
- 添補 Timestamp 的空缺
- 60 秒一個 Timestamp
- 用前後Timestamp填補
- Ex: 1632122520 ~ 16321225640,中間缺 1 個 Timestamp
- 添補 Features 的空缺
- 先用前值添補
- 若還有空缺,則用後值補
### Generate More Features
有些模型有額外生成更多特徵,生成的特徵有
- spread : $High - Low$
- mean_trade : $Volume / Count$
- log_price_change : $\log(Close-Open)$
- upper_Shadow : $High - max(Close,Open)$
- lower_Shadow : $min(Close,Open) - Low$
- high_div_low : $High / Low$
- trade : $Close - Open$
### Generate Training Data
- Model's input/output format:
- X: All features except `Target`
- Y: two types
- Only `Target` feature
- All features
- Two scalers will be used in different model:
- StanderScaler: value`-1`~`1`
- MinMaxScaler: value`0`~`1`
### Generate Time Series Data
- Time range
- 2021.06 ~
- Time series size(step)
- 3,10,15
# Model Architecture
- Single Model
- Many to Many
- Many to One
- 2 layers LSTM (600)
- Dropout : 0.2
- Early stopping
- Multi-Model
- Many to Many
- 2 layers LSTM (8)
- Dropout : 0.2
# Performance Analysis
| Model | Training Time | Testing Time | Kaggle Score |
| -------------------------------- | ------------- | ------------ | ------------ |
| Single model </br> (Many to One, 10 steps) | 313.8s | < 9hr | 0.1131 |
| Single model </br> (Many to Many, 3 steps)| 337.5s | < 9hr | 0.0495 |
| Multi-model </br> (Many to Many, 15 steps)| 255.0s | > 9hr | Timeout |
# Conclusion
### Bottleneck
- Time Limit
- 將預測的筆數(3個月): 3x30x24x60 = 129,600
- 時間限制(9個小時) : 9*60 = 540(分鐘)
- (540/129600) * 60 = 0.25秒(預測每筆資料的時間限制)
- Single model (P100) 約 0.1 秒
- Multi-model (P100) 約 0.6 秒 -> Timeout
- Memory Limit
- Training data Timestamp range : last half year
- Time series : 3 ~ 15 steps
- Features : add 7 columns
### Q & A
### 報告負責
1. 1-6
2. 7-13
3. 14-16
4. QA
{"metaMigratedAt":"2023-06-16T17:47:33.423Z","metaMigratedFrom":"Content","title":"期末報告","breaks":true,"contributors":"[{\"id\":\"4caecdc7-e27d-4e66-961b-5918122d494e\",\"add\":1943,\"del\":345},{\"id\":\"b05f1414-eed3-493a-a48b-afb7b91abb4b\",\"add\":308,\"del\":13},{\"id\":\"cd4cae60-4ee0-48cb-8e2a-e8838c3207f4\",\"add\":310,\"del\":6},{\"id\":\"6abfecec-53a3-4a39-bafa-19550a89f2ed\",\"add\":41,\"del\":3}]"}