0

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

user3424107
  • 117
  • 1
  • 5

1 Answers1

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