如何解决如何在RNN LSTM网络中使用评估指标?
我无法生成用于评估模型的指标。我已经完成了所有测试,甚至重新制定了重塑形式。有人能帮我吗? 数据标准化
print(x_train.shape)
print(y_train.shape)
print(x_test.shape)
print(y_test.shape)
(233634,15) (233634,) (100129,15) (100129,)
from sklearn.preprocessing import MinMaxScaler
normalizador = MinMaxScaler()
x_train= normalizador.fit_transform(x_train)
x_test = normalizador.fit_transform(x_test)
y_train = y_train.values.reshape(-1,1)
y_test = y_test.values.reshape(-1,1)
x_train= x_train.reshape(1,233634,15)
y_train= y_train.reshape(1,1)
x_test = x_test.reshape(1,100129,15)
y_test = y_test.reshape(1,1)
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dense,Dropout,LSTM
model1 = Sequential()
model1.add(LSTM(units = 100,return_sequences = True))
model1.add(Dropout(0.3))
model1.add(LSTM(units = 50,return_sequences = True))
model1.add(Dropout(0.3))
# Camada Final
model1.add(Dense(1,activation='sigmoid'))
# Compile model
model1.compile(optimizer = 'Adam',loss = 'mean_squared_error',metrics=['accuracy'])
# Fit the model
model1.fit(x_train,y_train,epochs=10,batch_size=10,validation_data=(x_test,y_test))
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。