Say I've got a predictive classification model based on a random forest (using the randomForest package in R). I'd like to set it up so that end-users can specify an item to generate a prediction for, and it'll output a classification likelihood. So far, no problem.
But it would be useful/cool to be able to output something like a variable importance graph, but for the specific item being predicted, not for the training set. Something like:
Item X is predicted to be a Dog (73% likely)
Because:
Legs=4
Breath=bad
Fur=short
Food=nasty
You get the point. Is there a standard, or at least justifiable, way of extracting this information from a trained random forest? If so, does anyone have code that will do this for the randomForest package?
mpredictors one by one and looking to see how the forest predicts differently seems sorta expensive. There's gotta be a better way. – Harlan Apr 8 '11 at 1:03