I'm trying to test out Keras 1DConv CNNs to help predict time series/ stock data. Something like N stocks would have OHLCV data for n time-steps. As an example, for N=1 stock, I am trying to predict only the next period's close price. Say, using one stock, I have 100 periods with OHLCV values, so X.shape = (100, 5), while y.shape = (100, 1).
I'm trying to add the layer as an input:
model.add(Conv1D(filters=50, kernel_size=7,activation='relu', data_format='channels_last',input_shape=(100,5)))
but I keep getting errors with regards to input shape (when I try to fit the data) either not being the right dimensions or passing the shape in the wrong order. I've tried reshaping the arrays to add the extra dimension but so far nothing has worked. How should I format the data, and please let me know if you have any suggestions for anything else around this task re: scaling, parameters (loss, optimizer, activation, data_format). How do channels play into this?
Cheers!
model.fit(X_train, y_train, epochs=nb_epoch, validation_data=(X_test, y_test), batch_size=16)
ValueError: Error when checking target: expected conv1d_1 to have 3 dimensions, but got array with shape (100, 5)