O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the ROC chart

Using the preceding raw probabilities and class labels, we can generate an ROC chart. See the Generating ROC charts recipe earlier in this chapter for more details:

> pred <- prediction(pred.pruned[,2], bn[-train.idx,"class"]) 
> perf <- performance(pred, "tpr", "fpr") 
> plot(perf)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required