### This repository encapsulates the process of modeling and forecasting of time series based deep learning,making it super easy to use.
### Quick start
```python
train_file_path = r"dataset/pollution.csv"
#data is univariate tite series
data = pd.read_csv(train_file_path, header=0, index_col=0)["pollution"].values
#get train_data and test_data
train_data, test_data = divide_train_test(data)
#initialise model parameters
ts = ts_model()
# fit and predict
preds, reals = ts.fit_transform(train_data, test_data)
# plot prediction result
ts.plot_predict_result(preds, reals)
```
#### 1. model parameters
Some model parameters are diagrammed below:
![model-part-parameters](https://github.com/yyqcs/time-series-model/blob/master/fig/model-part-parameters.jpg)
| The meaning of model parameters |
| ------------------------------------------------------------ |
| wnd_len : int ,default=24 |
| the length of sliding window.The sequence in sliding window is the single input sequence of LSTM. |
| pred_len : int ,default=24 |
| prediction sequence length |
| net : str ,default=LSTM |
| Net to model time series.Choices include 'LSTM' or 'RNN' or "GRU" |
| rnn_input_size : int ,default=8 |
| embedding dimension,used to map input feature(for univariate,feature is one) to a high dimension |
| rnn_hid_size : int ,default=64. |
| the dimension of hidden layer in RNN,LSTM,GRU |
| batch_size : int, default=32 |
| Batch size to use during SGD optimization. |
| lr : float, default=1E-3 |
| Learning rate used for optimization. |
| n_epochs : int, default=299 |
| Number of epochs to use during optimization. |
| optimizer : str, default='Adam' |
| Optimizer to use during SGD optimization. Choices include 'Adam' or 'SGD'. |
| criterion : str, default='MSELoss' |
| Prediction loss function to use. |
| train_proportion : float,default=0.8 |
| the proportion of train data used to train model.The rest part is used for validation |
| not_use_visdom : bool,default=True |
| not use visdom to visualize the loss in training process,when False ensure run"python -m visdom.server" firstly |
| cuda : bool, default=False |
| Whether or not to use CUDA. |
| dropout_rate : float, default=0.5. |
| Dropout rate for hidden layers. |
| verbose : bool, default=True |
| Print out loss information. |
#### 2. model method
| fit_transform(train_data,test_data) | train model on train_data and predict on test_data |
| ----------------------------------- | -------------------------------------------------- |
| fit(train_data) | train model on train_data |
| transform(test_data) | predict on test_data |
| plot_predict_result(preds, real) | plot prediction result |
| save_best_model(save_path): | save file on specified path |
| get_min_loss() | return minimum validation loss |
If you have any questions, please open an issue.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
<项目介绍> 毕业论文代码库合集 包括基于ARIMA,LSTM,GRU进行时间序列预测, 基于DeepTTE进行ETA(estimate time of arrival)计算运输完成时长 基于特征工程和xgboost的运力预测 - 不懂运行,下载完可以私聊问,可远程教学 该资源内项目源码是个人的毕设,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 --------
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计带论文-基于特征工程和xgboost的运力预测,大宗货运场景下的运力供需预测python源码+文档说明+论文+答辩ppt (219个子文件)
run_log_2022-04-23 09:42:43.005528 2.72MB
run_log_7_2022-04-23 17:45:03.013336 2.72MB
run_log_2_2022-04-23 11:32:36.018017 2.72MB
run_log_2022-04-21 14:37:30.036174 2.72MB
run_log_2022-04-23 09:43:53.039270 2.72MB
run_log_2022-04-23 10:12:03.047425 2.72MB
run_log_2022-04-23 09:48:42.050157 2.72MB
run_log_3_2022-04-23 12:15:37.050919 2.73MB
run_log_5_2022-04-23 16:49:33.053048 2.72MB
run_log_1_2022-04-23 11:12:06.053638 2.72MB
run_log_2022-04-23 10:45:19.058578 2.72MB
run_log_2022-04-23 10:48:46.060640 2.72MB
run_log_2022-04-23 10:14:17.073945 2.72MB
run_log_1_2022-04-23 13:10:55.074137 2.72MB
run_log_2_2022-04-23 11:27:31.075407 2.72MB
run_log_4_2022-04-23 14:08:31.081920 2.73MB
run_log_2022-04-23 10:43:07.097850 2.72MB
run_log_2022-04-23 10:18:46.098343 2.72MB
run_log_2022-04-23 10:09:45.100049 2.72MB
run_log_1_2022-04-23 13:19:31.112700 2.72MB
run_log_2022-04-23 10:44:13.116370 2.72MB
run_log_1_2022-04-23 11:03:53.122275 2.72MB
run_log_1_2022-04-23 13:15:11.128876 2.72MB
run_log_2022-04-23 09:22:57.130646 2.72MB
run_log_4_2022-04-23 14:09:53.140264 2.73MB
run_log_6_2022-04-23 17:08:58.141523 2.72MB
run_log_1_2022-04-23 11:14:59.154174 2.72MB
run_log_6_2022-04-23 17:12:02.162266 2.72MB
run_log_2022-04-23 09:49:48.167030 2.72MB
run_log_7_2022-04-23 18:06:39.172602 2.72MB
run_log_3_2022-04-23 12:14:19.179654 2.73MB
run_log_7_2022-04-23 17:38:53.179981 2.72MB
run_log_2022-04-23 10:15:25.181252 2.72MB
run_log_2022-04-23 10:47:39.181390 2.72MB
run_log_4_2022-04-23 14:05:50.183756 2.73MB
run_log_7_2022-04-23 17:35:25.211837 2.72MB
run_log_2_2022-04-23 11:30:34.231807 2.72MB
run_log_6_2022-04-23 17:16:08.232243 2.72MB
run_log_1_2022-04-23 11:16:25.232291 2.72MB
run_log_5_2022-04-23 16:45:19.237687 2.72MB
run_log_1_2022-04-23 11:09:17.246263 2.72MB
run_log_2022-04-23 10:13:10.258736 2.72MB
run_log_4_2022-04-23 13:58:08.268465 2.73MB
run_log_5_2022-04-23 16:46:48.276658 2.72MB
run_log_3_2022-04-23 12:08:22.279456 2.73MB
run_log_2022-04-23 09:19:09.288819 2.72MB
run_log_2_2022-04-23 11:33:37.290221 2.72MB
run_log_2022-04-23 09:33:38.291228 2.72MB
run_log_6_2022-04-23 17:20:31.300520 2.72MB
run_log_4_2022-04-23 14:00:40.300936 2.73MB
run_log_1_2022-04-23 11:10:37.311265 2.72MB
run_log_6_2022-04-23 17:18:52.332008 2.72MB
run_log_7_2022-04-23 17:49:37.342303 2.72MB
run_log_2_2022-04-23 11:22:11.355902 2.72MB
run_log_7_2022-04-23 18:09:41.359691 2.72MB
run_log_4_2022-04-23 14:03:12.360040 2.73MB
run_log_7_2022-04-23 17:37:27.376747 2.72MB
run_log_1_2022-04-23 13:09:25.378247 2.72MB
run_log_7_2022-04-23 17:40:39.379561 2.72MB
run_log_2022-04-23 09:47:34.383515 2.72MB
run_log_2022-04-23 09:50:57.397584 2.72MB
run_log_1_2022-04-23 11:08:02.423346 2.72MB
run_log_7_2022-04-23 18:13:32.425099 2.72MB
run_log_5_2022-04-23 16:56:27.434925 2.72MB
run_log_2022-04-23 09:46:19.452417 2.72MB
run_log_3_2022-04-23 12:04:27.452842 2.73MB
run_log_2022-04-23 10:17:40.464911 2.72MB
run_log_7_2022-04-23 18:08:12.469145 2.72MB
run_log_1_2022-04-23 13:12:19.473357 2.72MB
run_log_1_2022-04-23 13:18:05.482404 2.72MB
run_log_1_2022-04-23 11:06:42.485547 2.72MB
run_log_2022-04-23 09:36:40.506907 2.72MB
run_log_6_2022-04-23 17:07:32.522544 2.72MB
run_log_2022-04-23 10:10:53.524853 2.72MB
run_log_2022-04-23 09:41:28.539642 2.72MB
run_log_2_2022-04-23 11:31:34.552582 2.72MB
run_log_7_2022-04-23 17:48:06.571483 2.72MB
run_log_3_2022-04-23 12:07:08.579359 2.73MB
run_log_3_2022-04-23 12:16:48.579673 2.73MB
run_log_1_2022-04-23 13:20:56.586376 2.72MB
run_log_2022-04-23-09:52:07.586781 2.72MB
run_log_2_2022-04-23 11:29:33.590981 2.72MB
run_log_1_2022-04-23 13:13:46.595021 2.72MB
run_log_7_2022-04-23 17:54:48.621414 2.72MB
run_log_1_2022-04-23 11:05:15.622625 2.72MB
run_log_5_2022-04-23 16:52:10.630976 2.72MB
run_log_2022-04-23 10:52:05.631639 2.72MB
run_log_2022-04-21 14:34:47.643297 2.72MB
run_log_2022-04-23 09:16:26.648935 2.72MB
run_log_2022-04-23 10:16:31.650836 2.72MB
run_log_3_2022-04-23 11:40:12.662346 2.73MB
run_log_7_2022-04-23 18:10:58.663427 2.72MB
run_log_5_2022-04-23 16:54:59.663700 2.72MB
run_log_7_2022-04-23 17:42:05.686364 2.72MB
run_log_6_2022-04-23 17:17:30.686504 2.72MB
run_log_5_2022-04-23 16:48:11.689312 2.72MB
run_log_1_2022-04-23 13:07:56.695107 2.72MB
run_log_7_2022-04-23 18:05:09.698728 2.72MB
run_log_2022-04-21 14:38:48.699848 2.72MB
run_log_6_2022-04-23 17:10:36.702625 2.72MB
共 219 条
- 1
- 2
- 3
资源评论
奋斗奋斗再奋斗的ajie
- 粉丝: 230
- 资源: 2166
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功