I have a rather basic model that will try to predict the volume of one stock the next day. However, I'd like to predict all three stocks. So instead of one outcome, there's three.
outcomeSymbol <- cbind('AAPL.Volume','ADBE.Volume','ADI.Volume')
Here's what the head of the outcomes looks like (dates in random order):
Here is the training that works fine with one outcome variable ( outcomeSymbol <- 'AAPL.Volume'
):
bst <- train(train[,predictorNames], as.factor(train$outcome),
method='gbm'
)
But when run this with the 3 outcome variables, I get:
Error: nrow(x) == n is not TRUE
Do I have to use different parameters or a different model if there is more than one outcome?
The entire code, so you can see everything and run it yourself: https://gist.github.com/alteredorange/b97481ed7e00b33bab0d28dcdd7d0e4a