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

Python ROC curve from 2 discrete histogram distributions

I'm using Python (NumPy) and I want to plot a ROC curve given a 1D noise histogram and another 1D histogram for the signal+noise distribution. I am aware that various libraries like scikit-learn can generate ROC curves, but they use a supervised…
dektorpan
  • 51
  • 3
3
votes
1 answer

R: logistic regression using frequency table, cannot find correct Pearson Chi Square statistics

I was implement logistic regression to the following data frame and got a reasonable (the same as using STATA) results. But the Pearson chi square and degree of freedom I got from R is very different from STATA, which in turn gave me an very small…
J.Liu
  • 51
  • 1
  • 3
3
votes
1 answer

CI of PPV and NPV using pROC

I've been using the pROC package in R to generate bootstrapped confidence intervals for SP and SN values corresponding to specific thresholds. However, I've been unable to find a way to generate CI's for PPV and NPV values. Does such a function…
ahj
  • 125
  • 6
3
votes
2 answers

Making ROC curve using python for multiclassification

Following up from here: Converting a 1D array into a 2D class-based matrix in python I want to draw ROC curves for each of my 46 classes. I have 300 test samples for which I've run my classifier to make a prediction. y_test is the true classes, and…
user961627
  • 12,379
  • 42
  • 136
  • 210
3
votes
2 answers

pROC R package with customized cutoff values?

Can I use some pre-specified cutoff values (thresholds) to plot a ROC curve with the pROC package? For example, can I input control/case values and my own threshold points where to calculate corresponding sensitivities and specificities?
Vish
  • 31
  • 1
  • 2
3
votes
2 answers

What are the MATLAB 'perfcurve' Roc Curve Parameters?

I have been using the LibSVM classifier to classify between 3 different classes - labeled 2, 1, -1 I'm trying to use MATLAB to generate Roc Curve graphs for some data produced using LibSVM but am having trouble understanding the parameters it needs…
Gwenji
  • 117
  • 2
  • 11
3
votes
2 answers

ROC score in gbm package

I am having trouble calculating ROC score (AUC) using gbm package. I am working with boosted regression trees. The script I am running is: testing.tc5.lr005 <- gbm.step(data=ModelData, gbm.x = 3:4, gbm.y = 2, family = "gaussian", tree.complexity =…
Learner
  • 73
  • 3
  • 8
3
votes
2 answers

Torch/Lua, how to compute Area Under the Curve (AUC)?

I'm new to Torch, and I am working on a problem where I have to depict the Receiver Operating Characteristic (ROC) curves and their Areas Under the Curve (AUC). I have to arrays: TPrate on the y axis and FPrate on the x axis, having both size n How…
DavideChicco.it
  • 3,318
  • 13
  • 56
  • 84
3
votes
1 answer

How can I get the standard error of an AUC in ROCR?

I'm using ROCR to obtain the AUC indices. I want to have also the standard errors of the AUC but in the default outputs they are not shown. Is there any way of obtaining…
Gonzalo SB
  • 51
  • 2
  • 3
3
votes
2 answers

Combining ROC estimates from multiple imputation data

I have used the following R packages: mice, mitools, and pROC. Basic design: 3 predictor measures with missing data rates between 5% and 70% on n~1,000. 1 binary target outcome variable. Analytic Goal: Determine the AUROC of each of the 3…
user3228372
  • 41
  • 1
  • 4
3
votes
1 answer

Calculate Accuracy using ROCR Package in R

I am trying to calculate accuracy using ROCR package in R but the result is different than what I expected: Assume I have prediction of a model (p) and label (l) as following: p <- c(0.61, 0.36, 0.43, 0.14, 0.38, 0.24, 0.97, 0.89, 0.78, 0.86) l <-…
Soroosh
  • 477
  • 2
  • 7
  • 18
3
votes
1 answer

Plotting a ROC curve from a random forest classification

I'm trying to plot ROC curve of a random forest classification. Plotting works, but I think I'm plotting the wrong data since the resulting plot only has one point (the accuracy). This is the code I use: set.seed(55) data.controls <-…
user34798
3
votes
2 answers

Plotting an ROC curve in glmnet

EDIT: As Dwin pointed out in the comments, the code below is not for an ROC curve. An ROC curve must be indexed in variation in t and not in lambda (as I do below). I will edit the code below when I get the chance. Below is my attempt to create an…
Dr. Beeblebrox
  • 838
  • 2
  • 13
  • 30
3
votes
1 answer

KNN classifier with ROC Analysis

I wrote following codes to get a plot of ROC for my KNN classifier: load fisheriris; features = meas; featureSelcted = features; numFeatures = size(meas,1); %%…
Samo Jerom
  • 2,361
  • 7
  • 32
  • 38
3
votes
2 answers

how to draw ROC curve in computer vision algorithm?

I used a detection algorithm to detect the object in 100 images, with each image containing exactly 2 truth, i.e., each image contains 2 objects. then I added noise and find the best one. I calculated the intersection area between detection result…
Flan
  • 31
  • 1
  • 6