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

Generating the ROC chart

Using the preceding probabilities, we can generate the ROC chart. For details, refer to the Generating ROC charts earlier in this chapter:

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

The following output is the result of the preceding command:

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