MATLAB: Time series forecasting using deep learning with 2 numFeatures

forecasttime series

How to use two input features to get 1 output using this example?
This example use 1 numFeatures, for example if i have time series data with 2 features, wind speed and temperature, how can i use this example to forecast weather?

Best Answer

Hi Israt,
It is my understanding that you have two features as input and want to train the network with this input.
You could change numFeatures = 2 while defining sequenceInputLayer function as shown:
numFeatures = 2; %take 2 features as input
numResponses = 1; %give 1 output
layers = [ ...
sequenceInputLayer(numFeatures)
lstmLayer(numHiddenUnits)
fullyConnectedLayer(numResponses)
regressionLayer];
Related Question