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
2
votes
1 answer

How to set the estimate argument correctly for roc_auc() function in yardstick package

I want to compute the AUC for a model. library(yardstick) data(two_class_example) This code works. roc_auc( two_class_example, truth = truth, Class1, options = list(smooth = TRUE) ) I like to specify arguments so that my code is easier…
Anthony
  • 105
  • 7
2
votes
1 answer

Adding pch on ROC curves and labelling AUC values

I want to plot ROC curves for 5 estimated models using R's pROC application. Because I'm using gray scales, which may look indistinguishable visually, so I want to accentuate different line types by assigning different pch to different ROC curves,…
Chris T.
  • 1,699
  • 7
  • 23
  • 45
2
votes
1 answer

ROC Curve and precision recall curve

What are the underlying assumptions of the ROC curve? What part of an ROC curve impacts the PR curve more?
user9432913
2
votes
2 answers

Why do my ROC plots and AUC value look good, when my confusion matrix from Random Forests shows that the model is not good at predicting disease?

I'm using the the package randomForest in R to create a model to classify cases into disease (1) or disease free (0): classify_BV_100t <- randomForest(bv.disease~., data=RF_input_BV_clean, ntree = 100, localImp =…
Alicia
  • 57
  • 1
  • 9
2
votes
2 answers

How does pROC handle multi-level factor labels?

I am calculating the AUC of a model in R. The model has been trained to predict a two-level factor (good/bad). It has been applied to data that have a three-level outcome (good/bad/missing). I am fine with the scoring part. I get a probability based…
DGenchev
  • 327
  • 3
  • 12
2
votes
1 answer

ROC curve with Leave-One-Out Cross validation in sklearn

I want to plot a ROC curve of a classifier using leave-one-out cross validation. It seems that a similar question has been asked here but without any answer. In another question here is was stated: In order to obtain a meaningful ROC AUC with…
seralouk
  • 30,938
  • 9
  • 118
  • 133
2
votes
1 answer

Plotting the ROC curve of K-fold Cross Validation

I am working with an imbalanced dataset. I have applied SMOTE Algorithm to balance the dataset after splitting the dataset into test and training set before applying ML models. I want to apply cross-validation and plot the ROC curves of each folds…
Dipto
  • 23
  • 1
  • 1
  • 4
2
votes
2 answers

Sensitivity and specificity values differ using two different R package( Caret and pROC)

I am trying to calculate sensitivity and specificity. I used the caret package and the pROC package . However, why do I get different results using two different packages? I have converted the data into binary form(whenever there is a correct call…
2
votes
1 answer

pROC package with pre-specified cutoff values with two decimals

In the roc function of pROC package I would like to print my specific cutoff values (print.thres parameter) with two decimal digits, because one cutoff is 0.05 and in the plot appears as 0.0 Any suggestion?
user2310909
  • 116
  • 8
2
votes
3 answers

h2o Flow UI: Build Model but no ROC CURVE or AUC for multiclass?

Reference to https://dzone.com/articles/machine-learning-with-h2o-hands-on-guide-for-data I was able to follow the example and plotted the ROC and AUC curve but when I did the same thing with my data, I have "SCORING HISTORY - DEVIANCE" instead of…
user1342124
  • 601
  • 1
  • 7
  • 15
2
votes
1 answer

How I can plot multiple roc together?

I want to find some good predictors (genes). This is my data, log transformed RNA-seq: TRG CDK6 EGFR KIF2C CDC20 Sample 1 TRG12 11.39 10.62 9.75 10.34 Sample 2 TRG12 10.16 8.63 8.68 9.08 Sample 3 TRG12 9.29 10.24 9.89…
fi1d18
  • 95
  • 12
2
votes
2 answers

R: pROC package: plot ROC curve across specific range?

I would like to plot a segment of an ROC curve over a specific range of x values, instead of plotting the entire curve. I don't want to change the range of the x axis itself. I just want to plot only part of the ROC curve, within a range of x…
2
votes
1 answer

ROC object with pROC in R returns error (no valid data)

I am trying to compute roc for a certain problem with R. The input I have is: true_values: a list of 100 1s and 0s: true_values Class 1 0 2 1 3 1 4 0 5 0 6 0 7 …
Panda
  • 69
  • 2
  • 8
2
votes
1 answer

What's the rationale behind this optimization to ROC plotting?

I am reading this Rnews document from June 2004, and the article Programmers’ Niche from page 33 presented a way to draw the Receiver Operating Characteristic curves and optimization to it. The first code snippet is trivial and consistent with the…
nalzok
  • 14,965
  • 21
  • 72
  • 139
2
votes
2 answers

Area under the ROC curve using Sklearn?

I can't figure out why the Sklearn function roc_auc_score returns 1 in the following case: y_true = [0, 0, 1, 0, 0, 0, 0, 1] y_scores = [0.18101096153259277, 0.15506085753440857, 0.9940806031227112, 0.05024950951337814, …
Dr. John
  • 273
  • 3
  • 13