Questions tagged [roc]

ROC (Receiver Operating Characteristic) curve is a graphical plot comparing the true positive and false positive rates of a classifier as its discrimination threshold is varied.

Receiver Operating Characteristic curve, or ROC curve, is a graphical depiction of classifier performance that shows the trade-off between increasing true positive rates (on the vertical axis) and increasing false positive rates (on the horizontal axis) as the discrimination threshold of the classifier is varied.

The true positive rate, defined as is the the fraction of true positives out of the positives, is also called the sensitivity or recall. The false positive rate, defined as the fraction of false positives out of the negatives, is equivalent to 1 - sensitivity.

In its original form, the ROC curve was used to summarize performance of a binary classification task, although it can be extended for use in multi-class problems.

A classifier performing at chance is expected to have true positive and false positive rates that are equal, producing a diagonal line. Classifiers that exceed chance produce a curve above this diagonal. The area under the curve (or AUC) is commonly used as a summary of the ROC curve and as a measure of classifier performance. The AUC is equal to the probability that a classifier will rank a randomly chosen positive case higher than a randomly chosen negative one. This is equivalent to the Wilcoxon test of ranks.

ROC curves enable visualizing and organizing classifier performance without regard to class distributions or error costs. This can be helpful when investigating learning with skewed distributions or cost-sensitive learning.

Helpful reading includes:

Fawcett, Tom. "ROC graphs: Notes and practical considerations for researchers." Machine Learning 31 (2004): 1-38.

Swets, John A., Robyn M. Dawes, and John Monahan. "Better decisions through Science." Scientific American (2000): 83.

1076 questions
3
votes
0 answers

ROC Curve Ranger

I am trying to calculate ROC Curve and AUC using ranger for a binomial classification problem (0 and 1), where the response variable is defined as BiClass. Suppose I cast a data frame to Train_Set and Test_Set (75% and 25 % respectively) and compute…
Ray
  • 321
  • 2
  • 12
3
votes
1 answer

How do I get the values of x-axis(FPR) and y-axis(TPR) in ROC curve

I'm trying to make a ROC curve using plotly.js with the values obtained in R. In plotly, I have to fill out the values(x-axis, y-axis) to make a plot. But, I don't know how to get the values when I use Logistic Regression function glm or multinom(in…
ynjo
  • 97
  • 6
3
votes
2 answers

Calculating multiple ROC curves in R using a for loop and pROC package. What variable to use in the predictor field?

I am using the pROC package and I want to calculate multiple ROC curve plots using a for loop. My variables are specific column names that are included as string in a vector and I want pROC to read sequentially that vector and use the strings in the…
Garrus
  • 43
  • 4
3
votes
2 answers

Is it fine to have a threshold greater than 1 in roc_curve metrics?

Predicting the probability of class assignment for each chosen sample from the Train_features: probs = classifier.predict_proba(Train_features)` Choosing the class for which the AUC has to be determined. preds = probs[:,1] Calculating false…
3
votes
1 answer

Cross_val_score is not working with roc_auc and multiclass

What I want to do: I wish to compute a cross_val_score using roc_auc on a multiclass problem What I tried to do: Here is a reproducible example made with iris data set. from sklearn.datasets import load_iris from sklearn.preprocessing import…
Emmanuel-Lin
  • 1,848
  • 1
  • 16
  • 31
3
votes
1 answer

ROC curves for Random Forest fit objects using pROC in R, to use positve or negative "votes" as predictor

Obese is a binary response var with 1 indicating obese and 0 not obese. Weight is a continuous predictor. using a RF to classify obese: library(randomFores) rf <- randomForest(factor(obese)~weight) gives us a fit object containing: > summary(rf) …
Forevertrip
  • 33
  • 1
  • 1
  • 4
3
votes
0 answers

How to do a vertical averaging of multiple ROC plots in R?

I have 10 ROC separately in 10 individual excels. Each excels looks like the following cut fpr tpr Inf 0 0 -0.054137294 0.037037037 0.382352941 -0.148727463 0.074074074 0.382352941 -0.230797569 …
sp2
  • 509
  • 1
  • 5
  • 13
3
votes
1 answer

Code to find the hull of a list of ROC curves (upper and lower limits of the set of curves)

I have made code that computes the two lines I am asking for in the question, as shown in the image below (desired lines are in red). EDIT : This is the expected graph using my snippet to generate the ROC curves (atleast I'm pretty sure this is…
Joel H
  • 173
  • 15
3
votes
2 answers

Is it possible to insert a line of no discrimination in ROC plot using ggroc?

I have created a ROC plot with multiple ROC-curves using ggroc based on pROC. How can I insert a line of no discrimination? I would like to have a line of no discrimination from 0,0 to 1,1 in my plot, so that I can better visually evaluate my…
rica
  • 67
  • 1
  • 9
3
votes
1 answer

Specificity/Sensitivity vs cut-off points using pROC package

I need to plot the following graph so I can choose the optimal threshold for a logistic regression model. However I can't use the packages (epi and roc) which are used in many of the research I have done. I do have the package pROC. Is there anyway…
3
votes
1 answer

How to relevel in ROC curve in R/plotROC?

I have just started learning roc curves. I am trying to produce a ROC plot but it seems that the curve is bending the wrong direction than usual - please see attached Can you help reverse the curve so that it bends in the "usual" direction? My data…
cmirian
  • 2,572
  • 3
  • 19
  • 59
3
votes
0 answers

Average ROC curve across folds for multi-class classification case in sklearn

I have a multi-class classification problem with 3 classes in total. I am using LinearDiscriminantAnalysis for the classification and I want to plot the average ROC across KFolds (k = 5). I am able to do this for a binary classification case but I…
seralouk
  • 30,938
  • 9
  • 118
  • 133
3
votes
3 answers

roc() function in pROC package: usage of controls and cases with its context

Can someone explain what the controls and cases arguments mean in the roc() function from the pROC package in R, and how to use them? How to check the number of controls and cases available in the dataset?
Teja Bandaru
  • 47
  • 1
  • 7
3
votes
1 answer

scoring "roc_auc" value is not working with gridsearchCV appling RandomForestclassifer

I keep getting this error when perform this with gridsearchCV with scoring value is 'roc_auc'('f1', 'precision','recall' work fine) # Construct a pipeline pipe =…
3
votes
3 answers

Create many ROC curves in R?

I have 150 columns of scores against 1 column of label (1/0). My goal is to create 150 AUC scores. Here is a manual example: auc(roc(df$label, df$col1)), auc(roc(df$label, df$col2)), ... I can use here Map/sapply/lapply but is there any other…
steves
  • 331
  • 3
  • 16