### 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.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
毕业论文代码库合集《有开题报告,技术方案,答辩ppt,论文》 1.包括基于ARIMA,LSTM,GRU进行时间序列预测, 2.基于DeepTTE进行ETA(estimate time of arrival)计算运输完成时长 3.基于特征工程和xgboost的运力预测 LSTM (Long Short-Term Memory) 是一种特殊的循环神经网络(RNN)架构,用于处理具有长期依赖关系的序列数据。传统的RNN在处理长序列时往往会遇到梯度消失或梯度爆炸的问题,导致无法有效地捕捉长期依赖。LSTM通过引入门控机制(Gating Mechanism)和记忆单元(Memory Cell)来克服这些问题。 LSTM的计算过程可以大致描述为: 通过遗忘门决定从记忆单元中丢弃哪些信息。 通过输入门决定哪些新的信息会被加入到记忆单元中。 更新记忆单元的状态。 通过输出门决定哪些信息会从记忆单元中输出到当前时刻的隐藏状态中。 由于LSTM能够有效地处理长期依赖关系,它在许多序列建模任务中都取得了很好的效果,如语音识别、文本生成、机器翻译、时序预测等。
资源推荐
资源详情
资源评论
收起资源包目录
《毕业论文代码库合集》
1.基于ARIMA,LSTM,GRU时间序列预测;
2.基于DeepTTE进行ETA计算运输完成时长;3 (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
资源评论
生瓜蛋子
- 粉丝: 3829
- 资源: 6140
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 堆排序(Heap Sort)是一种基于比较的排序算法
- ebatis 是一个简单方便上手的声明式 Elasticsearch ORM 框架
- 威纶通触摸屏编程软件Easy builder pro V6.09.02安装包(2024.06).txt
- ES查询客户端,elasticsearch可视化工具 elasticsearch查询客户端
- html css js网页制作实例 dldtdd实现列表功能
- 用python制作的tts语音小工具
- 三菱PLC编程参考手册
- 吃豆人代码源码全套.cpp
- 快速了解学习「编译原理」都需要掌握哪些基础知识.pdf
- Verilog示例代码,以SMIC 12nm工艺库为例给出Tessent TCL脚本示例
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功