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

ggplot2: use of scale_x_reverse on ROC plot

I tried to reproduce ROC curve from the plot.roc function from pRoc package with ggplot2. library(mlbench) library(caret) data(Sonar) set.seed(998) fitControl <- trainControl(method = "repeatedcv", number = 10, …
Mesmer
  • 319
  • 1
  • 4
  • 17
3
votes
1 answer

Change default arguments of ROC computation (pROC) in the RFE process (caret) - R

I am computing a SVM-RFE model using "ROC" as the metric, with the rfe function (caret package). To my knowledge, the rfe algorithm optimizes the AUC values using the roc function of the pROC package, with its predefined arguments. However, I would…
Rafa OR
  • 339
  • 2
  • 3
  • 8
3
votes
1 answer

Difference in average AUC computation using ROCR and pROC (R)

I am working with cross-validation data (10-fold repeated 5 times) from a SVM-RFE model generated with the caret package. I know that caret package works with pROC package when computing metrics but I need to use ROCR package in order to obtain the…
Rafa OR
  • 339
  • 2
  • 3
  • 8
3
votes
1 answer

Sum of previous rows in a column R

I have table as following id State 1 True 2 False 3 True 4 False 5 False 6 True 7 True 8 False I need to count true and false until showed row . So the result should be as the following table id State Yes No 1 True 1 0 2 False 1 1 3…
Etibar - a tea bar
  • 1,912
  • 3
  • 17
  • 30
3
votes
1 answer

Difference in ROC-AUC scores in sklearn RandomForestClassifier vs. auc methods

I am receiving different ROC-AUC scores from sklearn's RandomForestClassifier and roc_curve, auc methods, respectively. The following code got me an ROC-AUC (i.e. gs.best_score_) of 0.878: def train_model(mod = None, params = None, features = None,…
Chris
  • 425
  • 3
  • 12
3
votes
2 answers

glmnet & caret: ROC, Sensitivity, Specificity of training model

I would like to use GLMNET to fit a binomial logistic regression model. I could use either caret or the glmnet-package directly. Lets take the data(BinomialExample) as an example to execute the following code where I´ve implemented both: #rm(list =…
user86533
  • 323
  • 1
  • 7
  • 18
3
votes
1 answer

WEKA ROC CURVE - colour interpretations

When we generate ROC curves from Weka, curve is displayed in a color scale. I understand what is a ROC curve. But what is the meaning of the color scale in this ROC curve?
manu
  • 107
  • 3
  • 10
3
votes
1 answer

Calculating ROC and AUC in Caffe?

I have trained imagenet in Caffe. Now i am trying to calculate ROC/AUC for my model and the trained model provided by caffe. I have two questions: 1) ROC/AUC is mainly used for binary classes, but i also found that in some cases people used it for…
khan
  • 531
  • 6
  • 29
3
votes
1 answer

Overfitting and ROC curves

Is it possible to understand if a classifier is overfitted just by looking at its ROC curve? I see that if its AUC it's too high (example 98%) is likely to be overfitted, but it can also mean that the classifier is just really good. Is there a way…
badnack
  • 737
  • 1
  • 11
  • 20
3
votes
1 answer

How to compute area under ROC curve from predicted class probabilities, in R using pROC or ROCR package?

I have used caret library to compute class probabilities and predictions for a binary classification problem, using 10-fold cross validation and 5 times repetition. Now I have TRUE (observed values for each data point) values, PREDICTED (by an…
exAres
  • 4,806
  • 16
  • 53
  • 95
3
votes
2 answers

Adding arbitrary curve with AUC 0.8 to ROC plot

I have a simple ROC plot that I am creating using pROC package: plot.roc(response, predictor) It is working fine, as expected, but I would like to add an "ideally" shaped reference curve with AUC 0.8 for comparison (the AUC of my ROC plot is…
Oposum
  • 1,155
  • 3
  • 22
  • 38
3
votes
2 answers

Find class probabilities in matlab PNN and make ROC plot

I have a Probablistic Neural Network classification experiment set up in MATLAB. I can get the classes for unseen data using the sim command. Is there any way I can get the probabilities for the classes that the classifier calculates? Also, is there…
Midhat
  • 17,454
  • 22
  • 87
  • 114
3
votes
1 answer

R coding for ROC

I am having a hard time translating the example command for an ROC to my dataset. This is for the pROC package This is the example using data (aSAH) roc(aSAH$outcome, aSAH$s100b) roc(outcome ~ s100b, aSAH) So... aSAH should be replaced with the…
DMD
3
votes
1 answer

R multiclass/multinomial classification ROC using multiclass.roc (Package ‘pROC’)

I am having difficulties understanding how the multiclass.roc parameters should look like. Here a snapshot of my data: > head(testing.logist$cut.rank) [1] 3 3 3 3 1 3 Levels: 1 2 3 > head(mnm.predict.test.probs) 1 2 …
user3628777
  • 529
  • 3
  • 10
  • 20
3
votes
1 answer

SVM in R: "Predictor must be numeric or ordered."

I'm new to R and I've ran into this problem: I want to compare two prediction techniques (Support Vector Machines and Neural Networks) applying them to some data and I would like to compare their performance. To do this, I use ROC curves. The code…
user2925739