简体   繁体   中英

Classification tree that can fetch more than 1 prediction per observation

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM