I need to predict the response that has values in {0,20}. Should it be used as a factor or as a numeric value? How does it influence on the prediction error?
I am using GBM with the Gaussian distribution to predict this variable, and the accuracy is very low.
gbm_model <- gbm(target~., data=traindf, distribution = "gaussian", n.trees = 500,
bag.fraction = 0.75, cv.folds = 5, interaction.depth = 3)
For predicting I am using this code:
response_column <- which(colnames(testdf) == "target")
predictions_gbm <- predict(gbm_model, newdata = testdf[, -response_colum],
n.trees = 500, type = "response")