How to plot ROC curve for naive Bayes classifier?

How to plot ROC curve for naive Bayes classifier?

R – Plotting a ROC curve for a Naive Bayes classifier using ROCR. Not sure if I’m plotting it correctly I have a Naive Bayes classifiers that I’m using to try to predict whether a game is going to win or lose based on historical data.

How to find FPR and TPR for ROC curves?

Now we want to evaluate how good our model is using ROC curves. To do this, we need to find FPR and TPR for various threshold values. We can do this pretty easily by using the function roc_curve from sklearn.metrics, which provides us with FPR and TPR for various threshold values as shown below:

Why is it important to know ROC curves and AUC?

These properties make AUC pretty valuable for evaluating binary classifiers as it provides us with a way to compare them without caring about the classification threshold. That’s why it’s important for data scientists to have a fuller understanding of both ROC curves and AUC. So, what need do ROC Curves/AUC fulfil?

When to use ROC curves for threshold value?

We can generally use ROC curves to decide on a threshold value. The choice of threshold value will also depend on how the classifier is intended to be used.

Do you need to plot ROC for binary classification?

For binary classification with probability (not A) = 1 – probability (A), you don’t need to plot the second ROC as it does not contain any information that is not readily accessible from the first one. In your 3 class set up you can plot a ROC for each class.

What is the decision threshold for the ROC curve?

In order to generate points for plotting the ROC curves, I am increasing a decision threshold th from 0.1 to 1.0 and computing FPR,TPR for each one of the 3 classes (using a one-vs-rest approach, since ROC curve is used for binary classification).

Do you plot the ROC for Class A?

So for constucting the ROC for class A (you’d say: the patient is A positive), you look at class A posterior probabilities only. For binary classification with probability (not A) = 1 – probability (A), you don’t need to plot the second ROC as it does not contain any information that is not readily accessible from the first one.