0

I'm starting to use the caret package.

My study is about a prediction of historical financial series. I have a training period of 6 years for the input of a neural network. It is important that the input data follow the historical sequence.

I would like to use the caret package without sampling, but with all the historical information.

I think that by default the function does sampling. I only saw options to change shape of sampling in function trControl().

My tuning would be the number of neurons and what input variables are best. I would like to change an activation function too.

Is it possible?

m  <- train(Sepal.Length~.,
        data = iris, 
        method = 'mlpWeightDecay', 
        metric = 'RMSE',
        maxit=100,
        tuneGrid = expand.grid(size=1:2, decay=1)
)
StupidWolf
  • 45,075
  • 17
  • 40
  • 72
  • You want the `method=timeslice` option to `trControl()`. See `?trainControl` and https://topepo.github.io/caret/data-splitting.html#data-splitting-for-time-series – John Colby Jun 01 '19 at 07:24
  • Possible duplicate of [Time-series - data splitting and model evaluation](https://stackoverflow.com/questions/24758218/time-series-data-splitting-and-model-evaluation) – John Colby Jun 01 '19 at 07:25
  • @JohnColby thanks for the answer. Do you also know if it is possible to change the activation function? – Suellen Teixeira Zavadzki de P Jun 01 '19 at 19:53
  • I tried with example economics (Time-series - data splitting and model evaluation), plsFitTime <- train(unemploy ~ pce + pop + psavert, + data = economics, + method = "mlpWeightDecay", + preProc = c("center", "scale"), + trControl = myTimeControl) the answer: Warning message: In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, : There were missing values in resampled performance measures. – Suellen Teixeira Zavadzki de P Jun 01 '19 at 20:57

0 Answers0