pytorch实现LSTM多输入多输出预测

部分代码:

def data_load():
    column_length = 24*6
    data = pd.read_csv('data/a.csv').values
    row = data.shape[0]

    #num_train = int(row * 0.8)
    num_train = int(row)-8  #训练集的数目

    x_train = data[:num_train, :column_length]
    y_train = data[:num_train, -out_size:]
    x_test = data[num_train:, :column_length]
    y_test = data[num_train:, -out_size:]

    ss_X = StandardScaler().fit(x_train)
    ss_Y = StandardScaler().fit(y_train)

    x_train = ss_X.transform(x_train).reshape(x_train.shape[0], column_length, -1)
    y_train = ss_Y.transform(y_train)
    x_test = ss_X.transform(x_test).reshape(x_test.shape[0], column_length, -1)
    y_test = ss_Y.transform(y_test)

    return x_train, y_train, x_test, y_test, ss_Y
#完整代码,见同名公众号

损失:

预测对比

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-31 22:58:08       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-31 22:58:08       101 阅读
  3. 在Django里面运行非项目文件

    2024-03-31 22:58:08       82 阅读
  4. Python语言-面向对象

    2024-03-31 22:58:08       91 阅读

热门阅读

  1. 输入 wo xiang he ni jao peng you.,倒着打。

    2024-03-31 22:58:08       44 阅读
  2. NC20128 不重复数字

    2024-03-31 22:58:08       39 阅读
  3. ES6:Map()与WeakMap()

    2024-03-31 22:58:08       39 阅读
  4. 探索Vue脚手架:构建现代化Web应用的利器

    2024-03-31 22:58:08       38 阅读
  5. 网页的皮肤——css

    2024-03-31 22:58:08       36 阅读
  6. 【对图书的ISBN 号码进行识别处理】

    2024-03-31 22:58:08       43 阅读
  7. 达梦数据库 创建外部表 [-7082]:外部表数据错误.

    2024-03-31 22:58:08       41 阅读
  8. Linux-基础环境搭建

    2024-03-31 22:58:08       39 阅读