视频讲解:LSTM lstm用工业用电量预测 时间序列预测 完整代码数据_哔哩哔哩_bilibili
代码:
'''导包'''
import pandas as pd
import numpy as np
import tqdm
import datetime
import os
import argparse
import random
import creat_data as Data
from def_function import *
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.utils.data
import logging
import sys
from config import Config
''' 主函数 args: 超参定义器,param logger: 日志句柄'''
def main(args, logger):
device = torch.device(args.device) # 指定运行设备
data_x, data_y, scalar = get_dataset(args.data_path, args.dataset_name, args.city_name, args.look_back)
'''
划分训练集和测试集的方法,但这么做会影响时序,最好还是利用新的测试集
'&#