I have data csv file with three inputs names temperature, humidity, wind. Here I want to predict temperature value in every 60 minute using LSTM model.
Here I write the code to reshape the train . But I got an error tuple' object is not callable
My code:
data = pd.read_csv('data6.csv' )
data['date'] = pd.to_datetime(data['date'] + " " + data['time'], format='%m/%d/%Y %H:%M:%S')
data.set_index('date', inplace=True)
data = data.values
scaler = MinMaxScaler(feature_range=(0, 1))
data = scaler.fit_transform(data)
train_size = int(len(data) * 0.67)
test_size = len(data) - train_size
train, test = data[0:train_size,:], data[train_size:len(data),:]
X = 1
n_out = 1
x,y=[],[]
start =0
data = train.reshape(train.shape(train.shape[0] ,3, train.shape[1]))
for _ in range(len(data)):
in_end = start+X
out_end= in_end + n_out
if out_end < len(data):
x_input = data[start:in_end]
x.append(x_input)
y.append(data[in_end:out_end,0])
start +=1
x = np.asanyarray(x)
y = np.asanyarray(y)
Error:
data = train.reshape(train.shape(train.shape[0] ,3, train.shape1))
Can anyone help me to solve this problem?
Error:
data = train.reshape(train.shape(train.shape[0] ,3, train.shape[1]))
where you've tried to call shape as a method while it is a tuple and you may want to use indexing operator,[index]
instead of calling shape as a method. $\endgroup$