import torch
from torch import nn,optim

#查阅资料了解init 的作用
from torch.nn import init

#已知1949年-1960年的飞机客流量

#获取客流量
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

data=pd.read_csv('data.csv',usecols=[1])       # usecols表示这里只读取第二列

#print(data)


#定义numpy 转换成Tensor的函数
toTs=lambda x:torch.from_numpy(x)

#数据预处理
data=data.dropna()          # Drop the rows where at least one element is missing.
dataSet=data.values         # 去除行的index，只要values
dataSet=dataSet.astype('float32') 
print("data Shape:",dataSet.shape)

#数据归一化
def MinMaxScaler(X):
    mx,mi=np.max(X),np.min(X)
    X_std=(X-mx)/(mx-mi)
    return X_std

dataSet=MinMaxScaler(dataSet)

#将数据分为训练集合测试集
train=dataSet[:12*10]
real=dataSet

input_size= 3

e1698733ebdb0e7e000c222323ef3a41bb6ddcaf
<mask token>


def MinMaxScaler(X):
    mx, mi = np.max(X), np.min(X)
    X_std = (X - mx) / (mx - mi)
    return X_std


<mask token>

<mask token>
print('data Shape:', dataSet.shape)


def MinMaxScaler(X):
    mx, mi = np.max(X), np.min(X)
    X_std = (X - mx) / (mx - mi)
    return X_std


<mask token>

<mask token>
data = pd.read_csv('data.csv', usecols=[1])
toTs = lambda x: torch.from_numpy(x)
data = data.dropna()
dataSet = data.values
dataSet = dataSet.astype('float32')
print('data Shape:', dataSet.shape)


def MinMaxScaler(X):
    mx, mi = np.max(X), np.min(X)
    X_std = (X - mx) / (mx - mi)
    return X_std


dataSet = MinMaxScaler(dataSet)
train = dataSet[:12 * 10]
real = dataSet
input_size = 3

import torch
from torch import nn, optim
from torch.nn import init
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data = pd.read_csv('data.csv', usecols=[1])
toTs = lambda x: torch.from_numpy(x)
data = data.dropna()
dataSet = data.values
dataSet = dataSet.astype('float32')
print('data Shape:', dataSet.shape)


def MinMaxScaler(X):
    mx, mi = np.max(X), np.min(X)
    X_std = (X - mx) / (mx - mi)
    return X_std


dataSet = MinMaxScaler(dataSet)
train = dataSet[:12 * 10]
real = dataSet
input_size = 3

import torch
from torch import nn,optim

#查阅资料了解init 的作用
from torch.nn import init

#已知1949年-1960年的飞机客流量

#获取客流量
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

data=pd.read_csv('data.csv',usecols=[1])       # usecols表示这里只读取第二列

#print(data)


#定义numpy 转换成Tensor的函数
toTs=lambda x:torch.from_numpy(x)

#数据预处理
data=data.dropna()          # Drop the rows where at least one element is missing.
dataSet=data.values         # 去除行的index，只要values
dataSet=dataSet.astype('float32') 
print("data Shape:",dataSet.shape)

#数据归一化
def MinMaxScaler(X):
    mx,mi=np.max(X),np.min(X)
    X_std=(X-mx)/(mx-mi)
    return X_std

dataSet=MinMaxScaler(dataSet)

#将数据分为训练集合测试集
train=dataSet[:12*10]
real=dataSet

input_size= 3
