I'm searching for an algorythm from the classification trees algorythm familiy, that can provide a number (more than 1) of predicitions (in some ranked order) per observation. To be more specific - I have 10 binary target models to predict a target variable with 10 levels. How can I combine the models in such way to fetch a predefine number of prediction with a confidence level. For instance, I want my "combined" model to fetch 2 predictions for each obeservation. Once possible approach is to take the 2 binary models with the highest accuracy for that specific observation and fetch them. How do I calculate the "averaged" accuracy of this set of 2 predictions ? If anyone can provide literature and R code examples from rpart package, that would be more helpful. thanks
Asked
Active
Viewed 196 times
0
-
Most trees I know will return the posterior probability for each class. Will that do? – Gavin Simpson Apr 29 '14 at 17:24
1 Answers
0
in the rpart documentation of predict.rpart: type = c("vector", "prob", "class", "matrix")
use like:
predict(${some r part model}, type="prob")
it will give you a vector of the probability of each class
Andrew Cassidy
- 2,532
- 16
- 36
-
@user3424107 you can edit your question... you shouldn't post updates in the comments section – Andrew Cassidy Apr 29 '14 at 17:55