How to change parameters in LSTM for multivariate binary classification time series?
https://machinelearningmastery.com/multivariate-time-series-forecasting-lstms-keras/
I am trying to follow this tutorial's code with a slightly different dataset, where the predictor is a 0 or 1: presence or absence of something. My data is continuous time series data, and I have other continuous variables that are inputs. For the most part, sans column numbers and names, my code is almost identical to the one in that tutorial. However, my predicted values show up like this on the plot:
And upon changing the Dense line from this:
model.add(Dense(1))
into:
model.add(Dense(1, activation='sigmoid'))
and the compile line from:
model.compile(loss='mae', optimizer='adam')
to:
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
I thought this was all I needed to change to make the predictions binary, but my predictions plot still keeps giving decimals and nonbinaries, as the plot above shows. What else do I need to account for in a classification problem in LSTM?
Topic keras neural-network classification time-series python
Category Data Science