# wind_prediction **Repository Path**: guox66/wind_prediction ## Basic Information - **Project Name**: wind_prediction - **Description**: 该项目用于短期风场预测 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 0 - **Created**: 2024-02-28 - **Last Updated**: 2024-04-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 风场短期预测 对风场数据进行预处理,多元线性回归分析,并使用LSTM、CNN+LSTM、Seq2Seq对风场进行短期预测,数据保存在database文件夹的csv文件中 分析和预测结果已经上传至analysis和result中 ## 环境部署 首先需安装 python>=3.10.2,然后安装torch>=2.1.1,torchaudio>=2.1.1 torchvision>=0.16.1 在有nvidia服务的设备上,使用以下命令安装 ```bash pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 ``` 在没有nvidia服务的设备上,使用以下命令安装 ```bash pip3 install torch torchvision torchaudio ``` 安装后可使用以下命令依次查看torch,cuda版本 ```bash python -c "import torch;print(torch.__version__);print(torch.version.cuda)" ``` 安装其他环境依赖 ``` pip install -r requirements.txt ``` ## 数据处理 数据已经保存在database文件夹的csv文件中,数据来源:https://www.industrial-bigdata.com ``` --wind_prediction     --database         --2019-01-01.csv         --2019-01-02.csv         ...         --2019-01-10.csv ``` 运行数据处理程序,处理过程保存在analysis文件夹中,处理后的数据将保存在analysis-data.npz中 ```bash python deal.py ``` ## 多元线性回归分析 经过数据处理步骤,用matlab运行Linear.m文件即可 ## 模型训练 模型可选择 LSTM 、 CNN_LSTM 、 Seq2Seq 输出可选x 、y ,训练得到的模型保存在models文件夹中 ```bash python train.py --model LSTM --output x --epochs 50 --batch_size 128 --val_rate 0.2 --test_rate 0.1 --lr 0.001 --step_size 1 --gamma 0.95 --hidden_size 256 --num_layers 1 ``` ## 模型测试 ```bash python t_model.py --model LSTM --output x ``` 训练过程和测试结果均保存在result文件夹中