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
9
votes
6 answers

sklearn ImportError: cannot import name plot_roc_curve

I am trying to plot a Receiver Operating Characteristics (ROC) curve with cross validation, following the example provided in sklearn's documentation. However, the following import gives an ImportError, in both python2 and python3. from…
Achintha Ihalage
  • 2,310
  • 4
  • 20
  • 33
9
votes
1 answer

How to calculate AUC with tensorflow?

I've built a binary classifier using Tensorflow and now I would like to evaluate the classifier using AUC and accuracy. As far as accuracy is concerned, I can easily do like this: X = tf.placeholder('float', [None, n_input]) y =…
mickkk
  • 1,172
  • 2
  • 17
  • 38
9
votes
2 answers

Plot ROC curve from Cross-Validation (training) data in R

I would like to know if there is a way to plot the average ROC Curve from the cross-validation data of a SVM-RFE model generated with the caret package. My results are: Recursive feature selection Outer resampling method: Cross-Validated (10 fold,…
Rafa OR
  • 339
  • 2
  • 3
  • 8
9
votes
1 answer

roc curve with sklearn [python]

I have an understanding problem by using the roc libraries. I want to plot a roc curve with a python http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_auc_score.html I am writing a program which evalutes detectors (haarcascade,…
petbottle
  • 91
  • 1
  • 1
  • 2
9
votes
1 answer

How can I get The optimal cutoff point of the ROC in logistic regression as a number

I would like to get the optimal cut off point of the ROC in logistic regression as a number and not as two crossing curves. Using the code below I can get the plot that will show the optimal point but in some cases I just need the point as a number…
mql4beginner
  • 2,193
  • 5
  • 34
  • 73
8
votes
1 answer

Roc_curve pos_label confusion

I have a question related to the roc_curve from scikit-learn for a deep learning exercise, I have noticed that my data has 1 as the positive label. After my training the testing accuracy is coming around 74% but the roc area under curve(AUC) score…
Arka Mallick
  • 1,206
  • 3
  • 15
  • 28
8
votes
1 answer

R get AUC and plot multiple ROC curves together at the same time

I have tried 2 methods to plot ROC curve and get AUC for each ROC curve. Method 1 - The first method is simple but I don't know how to plot multiple ROC curves together. I am simply using roc.curve(hacide.test$cls, pred_rose[,2]), the output will…
Cherry Wu
  • 3,844
  • 9
  • 43
  • 63
8
votes
2 answers

how to calculate roc curves?

I write a classifier (Gaussian Mixture Model) to classify five human actions. For every observation the classifier compute the posterior probability to belong to a cluster. I want to valutate the performance of my system parameterized with a…
Mario Lepore
  • 307
  • 2
  • 8
  • 18
7
votes
1 answer

Python Matplotlib: Find the corresponding x value of a given y value on a basic plot

I have a plot generated using Matplotlib (it is a precision-recall curve of a histogram originally) and I need to compute the correct x value which corresponds to the y value with y = 0.9. The data are loaded from text files which are present in…
sussko
  • 101
  • 1
  • 1
  • 4
7
votes
2 answers

Using ROC AUC score with Logistic Regression and Iris Dataset

What I need is to: Apply a logistic regression classifier Report the per-class ROC using the AUC. Use the estimated probabilities of the logistic regression to guide the construction of the ROC. 5fold cross validation for the training your…
FFLS
  • 565
  • 1
  • 4
  • 19
7
votes
2 answers

Changing scale of the ROC chart

I am using the following code to plot the ROC curve after having run the logistic regression. fit1 <- glm(formula=GB160M3~Behvscore, data=eflscr,family="binomial", na.action = na.exclude) prob1=predict(fit1, type=c("response")) eflscr$prob1 =…
Manfred
  • 147
  • 2
  • 10
7
votes
2 answers

How to plot a ROC curve with Tensorflow and scikit-learn?

I'm trying to plot the ROC curve from a modified version of the CIFAR-10 example provided by tensorflow. It's now for 2 classes instead of 10. The output of the network are called logits and take the form: [[-2.57313061 2.57966399] [ 0.04221377…
jwsmithers
  • 276
  • 2
  • 5
  • 15
7
votes
1 answer

How to extract average ROC curve predictions using ROCR?

The ROCR library in R offer the ability to plot an average ROC curve (right from the ROCR reference manual): library(ROCR) library(ROCR) data(ROCR.xval) # plot ROC curves for several cross-validation runs (dotted # in grey), overlaid by the vertical…
Prophet60091
  • 589
  • 9
  • 23
7
votes
1 answer

Computing AUC and ROC curve from multi-class data in scikit-learn (sklearn)?

I am trying to use the scikit-learn module to compute AUC and plot ROC curves for the output of three different classifiers to compare their performance. I am very new to this topic, and I am struggling to understand how the data I have should…
Suriname0
  • 527
  • 1
  • 8
  • 21
7
votes
2 answers

Get optimal threshold with at least 75% sensitivity with pROC in R

I have a dataframe with two columns : score1 which is numeric and truth1 which is boolean. I want to predict truth1 using score1. To do that, I want a simple linear model, and then ask for a good threshold, i.e., a threshold which gives me 75% of…
sweeeeeet
  • 1,769
  • 4
  • 26
  • 50
1 2
3
71 72