# Stock Price Prediction
Programs for stock price prediction. The results have been compiled into a blog post [here](https://towardsdatascience.com/machine-learning-techniques-applied-to-stock-price-prediction-6c1994da8001).
* **StockPricePrediction_v1_xgboost.ipynb**:
* Predict stock price in next day using XGBoost
* Given prices and other features for the last N days, we do prediction for day N+1
* Here we split 3 years of data into train(60%), dev(20%) and test(20%)
* Doesn't work well, likely because data is not normalized
* **StockPricePrediction_v1a_xgboost.ipynb**:
* Predict stock price in next day using XGBoost
* Given prices and other features for the last N days, we do prediction for day N+1
* Here we split 3 years of data into train(60%), dev(20%) and test(20%)
* Here we scale the train set to have mean 0 and variance 1, and apply the same transformation to dev and test sets
* Doesn't work well, likely because the model was trained on prices below ~1.7 and so when it saw prices above 1.7 for the dev set, it could not generalize well
* **StockPricePrediction_v1b_xgboost.ipynb**:
* Predict stock price in next day using XGBoost
* Given prices and other features for the last N days, we do prediction for day N+1
* Here we split 3 years of data into train(60%), dev(20%) and test(20%)
* Here for the past N values for the dev set, we scale them to have mean 0 and variance 1, and do prediction on them
* Doesn't work well, likely because the model was trained on prices below ~1.7 and so when it saw prices above 1.7 for the dev set, it could not generalize well
* **StockPricePrediction_v1c_xgboost.ipynb**:
* Predict stock price in next day using XGBoost
* Given prices and other features for the last N days, we do prediction for day N+1
* Here we split 3 years of data into train(60%), dev(20%) and test(20%)
* Whenever we do prediction on dev or test set we scale the previous N values to also have mean 0 and var 1
* Works well. On the test set, the **RMSE is 1.162 and MAPE is 0.58%** after hyperparamter tuning and using N_opt=3
* **StockPricePrediction_v2_lin_reg.ipynb**:
* Predict stock price in next day using linear regression
* Given prices for the last N days, we train a model, and predict for day N+1
* Works well. On the test set, the **RMSE is 1.42 and MAPE is 0.707%** using N_opt=5
* **StockPricePrediction_v3_mov_avg.ipynb**:
* Predict stock price in next day using simple moving average
* Given prices for the last N days, we do prediction for day N+1
* Works well. On the test set, the **RMSE is 1.27 and MAPE is 0.64%** using N_opt=2
* **StockPricePrediction_v4_lstm.ipynb**:
* Predict stock price in next day using long short term memory(LSTM)
* Given prices for the last N days, we do prediction for day N+1
* Here we split 3 years of data into train(60%), dev(20%) and test(20%)
* Here we use MinMaxScalar to fit_transform the train set, which we then use to transform the test set
* Works well. On the test set, the **RMSE is 2.988 and MAPE is 1.886%** using N_opt=5
* **StockPricePrediction_v4a_lstm.ipynb**:
* Predict stock price in next day using long short term memory(LSTM)
* Given prices for the last N days, we do prediction for day N+1
* Here we split 3 years of data into train(60%), dev(20%) and test(20%)
* Instead of MinMaxScaler, here we use StandardScaler
* Whenever we do prediction on dev or test set we scale the previous N values to also have mean 0 and var 1
* Works well. On the test set, the **RMSE is 1.164 and MAPE is 0.583%** using N_opt=3
* **StockPricePrediction_v5_last_value.ipynb**:
* Predict stock price in next day using last value method ie. use price on day t-1 to predict price on day t
* Works well. On the test set, the RMSE is 1.127 and MAPE is 0.565% using last value prediction
<img src="./data/vti_predictions_xgboost.png">
没有合适的资源?快使用搜索试试~ 我知道了~
库存预测和评估程序_Jupyter Notebook_下载.zip
共861个文件
pickle:766个
ipynb:31个
txt:16个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 19 浏览量
2023-04-27
10:54:04
上传
评论
收藏 22.73MB ZIP 举报
温馨提示
库存预测和评估程序_Jupyter Notebook_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
库存预测和评估程序_Jupyter Notebook_下载.zip (861个子文件)
VTI_20130102_20181231.csv 107KB
VTI_20130102_20181231.csv 107KB
VTI.csv 54KB
GOOG.csv 19KB
test_last_value.csv 15KB
test_mov_avg.csv 15KB
test_lin_reg.csv 15KB
test_xgboost.csv 7KB
VTI_20130102_20181231_monthly.csv 5KB
test_lstm.csv 5KB
holidays.csv 2KB
.gitignore 1KB
StockReturnsPrediction_v7_xgboost.ipynb 11.53MB
StockReturnsPrediction_v6_xgboost.ipynb 10.97MB
StockReturnsPrediction_v8_xgboost.ipynb 10.96MB
StockReturnsPrediction_v4_xgboost.ipynb 5.13MB
StockPricePrediction_v6c_xgboost.ipynb 4.79MB
StockReturnsPrediction_v5_xgboost.ipynb 4.75MB
StockReturnsPrediction_v3_xgboost.ipynb 4.32MB
StockPricePrediction_v6a_xgboost.ipynb 3.56MB
StockPricePrediction_v6b_xgboost.ipynb 1.13MB
StockPricePrediction_v6d_xgboost.ipynb 1.06MB
StockPricePrediction_v1c_xgboost.ipynb 1.02MB
StockPricePrediction_v2a_prophet.ipynb 787KB
StockPricePrediction_v2_prophet.ipynb 737KB
StockPricePrediction_v5a_TExpSmoothing_finetune.ipynb 592KB
StockPricePrediction_v5_last_value.ipynb 590KB
StockPricePrediction_v2_lin_reg.ipynb 560KB
StockPricePrediction_v4a_lstm.ipynb 541KB
StockPricePrediction_v5_TExpSmoothing.ipynb 531KB
StockPricePrediction_v4a_DExpSmoothing_finetune.ipynb 522KB
StockPricePrediction_v4_lstm.ipynb 491KB
StockPricePrediction_v3_mov_avg.ipynb 470KB
StockReturnsPrediction_v2_DExpSmoothing.ipynb 412KB
StockPricePrediction_v4_DExpSmoothing.ipynb 410KB
StockReturnsPrediction_v1_SExpSmoothing.ipynb 406KB
StockPricePrediction_v3_SExpSmoothing.ipynb 279KB
StockPricePrediction_v1_last_value.ipynb 236KB
StockPricePrediction_v1b_xgboost.ipynb 206KB
StockPricePrediction_v1a_xgboost.ipynb 206KB
StockPricePrediction_v1_xgboost.ipynb 195KB
weiner_filter_v1.ipynb 172KB
StockPricePrediction_v6_xgboost.ipynb 164KB
LICENSE 11KB
README.md 4KB
README.md 3KB
README.md 3KB
README.md 933B
README.md 59B
README.md 54B
results_1302_v2a.pickle 7KB
results_588_v2a.pickle 7KB
results_1176_v2a.pickle 7KB
results_1386_v2a.pickle 7KB
results_1260_v2a.pickle 7KB
results_630_v2a.pickle 7KB
results_1470_v2a.pickle 7KB
results_546_v2a.pickle 7KB
results_1344_v2a.pickle 7KB
results_1134.pickle 7KB
results_1218_v2a.pickle 7KB
results_1050.pickle 7KB
results_1008_v2a.pickle 7KB
results_798_v2a.pickle 7KB
results_1470.pickle 7KB
results_714_v2a.pickle 7KB
results_966_v2a.pickle 7KB
results_756_v2a.pickle 7KB
results_504_v2a.pickle 7KB
results_1218.pickle 7KB
results_924_v2a.pickle 7KB
results_1428_v2a.pickle 7KB
results_1302.pickle 7KB
results_1386.pickle 7KB
results_1134_v2a.pickle 7KB
results_840_v2a.pickle 7KB
results_1092_v2a.pickle 7KB
results_672_v2a.pickle 7KB
results_1050_v2a.pickle 7KB
results_882_v2a.pickle 7KB
results_final_v5a_756_252.pickle 2KB
results_final_756_21.pickle 2KB
results_final_v5a_756_63.pickle 2KB
results_final_756_252.pickle 2KB
results_final_v5a_756_21.pickle 2KB
v6d_tuned_params_2017-07-05.pickle 1KB
v6d_tuned_params_2017-09-01.pickle 1KB
v6d_tuned_params_2018-09-04.pickle 1KB
v6d_tuned_params_2017-05-04.pickle 1KB
v6d_tuned_params_2017-11-01.pickle 1KB
v6d_tuned_params_2017-03-06.pickle 1KB
v6d_tuned_params_2018-05-04.pickle 1KB
v6d_tuned_params_2018-11-01.pickle 1KB
v6d_tuned_params_2018-07-05.pickle 1KB
v6d_tuned_params_2018-03-06.pickle 1KB
v6d_tuned_params_2018-01-03.pickle 1KB
v6d_tuned_params_2017-01-03.pickle 1KB
v3_tuned_params_2017-03-06.pickle 1KB
v3_tuned_params_2017-07-05.pickle 1KB
v3_tuned_params_2018-03-06.pickle 1KB
共 861 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9152
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功