Керас LSTM плохой прогноз - PullRequest
0 голосов
/ 20 мая 2019

У меня есть набор данных с записью метрик и список ошибок с ошибкой метрик Я хочу предсказать время lstm до сбоя и сбоя метрик

я пытаюсь использовать lstm с keras в python 3.5

# metric record by hour, small part of my lstm
data_train = {
    "metric1": [0.66,0.78, 5, 0.45, 0.8, 0.9],
    "metric2": [7.1, 6.8, 8.1, 7.3, 7.5, 2.0],
    "metric3": [0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
    "metric4": [0.74,0.76, 0.73, 0.72, 0.75, 0.72]
}
data_train = pd.DataFrame(data_train)
X_train = np.array(data_train.values)
X_train = np.reshape(X_train, (X_train.shape[0], 1, X_train.shape[1]))

# time before failure in hour
time_before_failure_train = [2, 1, 0, 2 , 1, 0]
# metrics failure cause
failure_cause_train = [["metric1"], ["metric2", "metric3"]]

y_train = np.array(time_before_failure_train)

data_test = {
    "metric1": [0.45, 0.8, 10],
    "metric2": [7.3, 7.5, 7.4],
    "metric3": [0, 0, 1],
    "metric4": [0.72, 0.75, 0.72]
}
X_test = np.array(data_test.values)
# metrics failure cause test
failure_cause_test = [["metric1", "metric3"]]

model = Sequential()
model.add(LSTM(100))
model.add(Dense(1, activation='sigmoid'))

model.compile(loss="mean_squared_error", optimizer = "sgd")


model.fit(X_train, y_train, epochs=50, batch_size=32,  verbose=1, validation_split=0.2)

model.predict(X_train[0])

У меня такой же прогноз в моем истоке, 2,5 часа

...