-1

Absolute beginner here. I'm trying to use a neural network to predict price of a product that's being shipped while using temperature, deaths during a pandemic, rain volume, and a column of 0 and 1's (dummy variable).

So imagine that I have a dataset given those values as well as column giving me time in a year/week format.

I started reading Rob Hyndman's forecasting book but I haven't yet seen anything that can help me. One idea that I have is to make a variable that's going to take out each column of the dataframe and make it into a time series. For example, for rain, I can do something like

rain <- df$rain_inches cost<-mainset3 %>% select(approx_cost) raintimeseries <-ts(rain, frequency=52, start=c(2015,1), end=c(2021,5))

I would the same for the other regressors.

I want to use neural networks on each of the regressors to predict cost and then put them all together.

Ideally I'm thinking it would be a good idea to train on say, 3/4 ths of the time series data and test on the remain 1/4 and then possibly make predictions.

I'm now seeing that even if I am using one regressor I'm still left with a multivariate time series and I've only found examples online for univariate models.

I'd appreciate if someone could give me ideas on how to model my problem using neural networks

I saw this link Keras RNN with LSTM cells for predicting multiple output time series based on multiple intput time series but I just see a bunch of functions and nowhere where I can actually insert my function

Jama
  • 113
  • 5

1 Answers1

0

The solution to your problem is the same as for the univariate case you found online except for the fact that you just need to work differently with your feature/independent set. your y variable or cost variable remains as is but your X variables will have to be in 3 dimensions which is (Number of observations, time steps, number of independent variables)

Muhammad Rasel
  • 704
  • 4
  • 9
  • https://rdrr.io/cran/forecast/man/nnetar.html is what I found online. Can you elaborate a bit more? – Jama Jul 25 '21 at 04:48