I have a dataset with four inputs named X1, X2, X3, X4. Here I created the lstm model to predict next X1 value with the previous values of four inputs.
Here I changed the time into minutes and then I set the time as index.
Then I created the x_train, x_test , y_test and y_train. Then I wanted to drop the time in x_train and x_test.
I used the code:
data= pd.DataFrame(data,columns=['X1','X2','X3','X4'])
pd.options.display.float_format = '{:,.0f}'.format
print(data)
data:
y=data['X1'].astype(int)
cols=['X1', 'X2', 'X3','X4']
x=data[cols].astype(int)
data=data.values
scaler_x = preprocessing.MinMaxScaler(feature_range =(0, 1))
x = np.array(x).reshape ((len(x),4 ))
x = scaler_x.fit_transform(x)
scaler_y = preprocessing.MinMaxScaler(feature_range =(0, 1))
y = np.array(y).reshape ((len(y), 1))
y = scaler_y.fit_transform(y)
train_end = 80
x_train=x[0: train_end ,]
x_test=x[train_end +1: ,]
y_train=y[0: train_end]
y_test=y[train_end +1:]
x_train=x_train.reshape(x_train.shape +(1,))
x_test=x_test.reshape(x_test.shape + (1,))
x_train = x_train.drop('time', axis=1)
x_test = x_test.drop('time', axis=1)
Then error :'numpy.ndarray' object has no attribute 'drop'
Can any one help me to solve this error?
