I'm new to ML and learning LSTM with this tutorial https://machinelearningmastery.com/time-series-prediction-lstm-recurrent-neural-networks-python-keras/. Scroll down to part "LSTM Network for Regression", the model is defined as this code:
# create and fit the LSTM network
model = Sequential()
model.add(LSTM(4, input_shape=(1, look_back)))
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer='adam')
model.fit(trainX, trainY, epochs=100, batch_size=1, verbose=2)
My questions are:
- The input_shape is wrong, isn't it? According to my understanding, the number 1 is the time step, the look_back must be the number of feature?
- If time step is 1, why this model still works (I tried to model myself, the result is decent)? As my understanding, LSTM must look back some time steps to predict the next number, if look_back == 1 then this LSTM is just a vanilla neuron, how does it still work?