I am doing a prediction for time series data using lstm keras. The train does not contain any negative numbers.
The issue is, when the predicting test data, the outputted prediction sometimes is negative, which does not make sense in my application. The negetive outputs are 10 or 20 in 2500 data.
Below is my RNN:
# define model1
model1 = Sequential()
model1.add(LSTM(100, recurrent_activation='sigmoid',return_sequences=True, input_shape=(n_in, n_features)))
model1.add(LSTM(80))
model1.add(Dense(n_out))
model1.compile(optimizer='adam', loss='mean_squared_error' )