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
2 answers

How to plot a ROC curve for a knn model

I am using ROCR package and i was wondering how can one plot a ROC curve for knn model in R? Is there any way to plot it all with this package? I don't know how to use the prediction function of ROCR for knn. Here's my example, i am using isolet…
spektra
  • 407
  • 2
  • 6
  • 9
2
votes
2 answers

Plot of average AUC from multiclass.roc in R

I want to plot macro average AUC with three classes. My work example is: roc <- multiclass.roc(Claims$CLAIMS2 ~ Claims$PredA) roc #Call: #multiclass.roc.formula(formula = Claims$CLAIMS2 ~ Claims$PredA) #Data: ClaimsA$PredA with 3 levels of…
F74
  • 31
  • 2
2
votes
2 answers

Ho to make the Receiver operating characteristic (ROC) and identifying the Youden index

I would like to make a ROC curve and identify the Youden-Index. I have a subsample as below. Where I need to find cut point for the column "val" based on the reference column "ref". How can I make the ROC plot, identifying the cutoff with…
Lisa
  • 121
  • 4
2
votes
0 answers

plot roc curve without classifier only with specificity and sensitivity values

For a presentation I would need to plot a roc curve for two hypothetical classifiers showcasing two different thresholds of sensitivity and specificity (i.e 1 with 66% specificity and 95% sensitivity and one with another combination). While I…
D.A.
  • 140
  • 1
  • 12
2
votes
2 answers

ROC for Logistic regression in R

I would like to ask for help with my project. My goal is to get ROC curve from existing logistic regression. First of all, here is what I'm analyzing. glm.fit <- glm(Severity_Binary ~ Side + State + Timezone + Temperature.F. + Wind_Chill.F. +…
2
votes
2 answers

Issue computing AUC with pROC package

I'm trying to use a function that calls on the pROC package in R to calculate the area under the curve for a number of different outcomes. # Function used to compute area under the curve proc_auc <- function(outcome_var, predictor_var) { …
2
votes
0 answers

Multiclass Logistic Regression ROC Curves in MATLAB

I have 7 classes within my training examples (labeled 1-7). I'm running logistic regression and I want to create my ROC curve for each of my classes. To train my model and make a prediction, I have the following code: Theta = zeros(k, n+1);…
STEMQs
  • 75
  • 1
  • 10
2
votes
1 answer

How to plot ROC-AUC figures without using scikit-learn

I have the following list containing multiple tuples of (TP, FP, FN): [(12, 0, 0), (5, 2, 2), (10, 0, 1), (7, 1, 1), (13, 0, 0), (7, 2, 2), (11, 0, 2)] each tuple represents the scores for a single image. This means I have 7 images and I have…
RZAMarefat
  • 133
  • 8
2
votes
0 answers

caret package train: LOOCV using ROC metric

I am wondering how the following code does work. > rm(list = ls()) > data(iris) > head(iris) > iris$y <- factor((iris$Sepal.Length > 6), labels = c("no", "yes")) > library(caret) > train.control <- trainControl(method = "LOOCV", summaryFunction =…
M.C. Park
  • 295
  • 1
  • 10
2
votes
1 answer

Why does plot gives wrong score of fits using MLeval package?

I want to plot the AUC-ROC of several fits using the MLeval package. The problem is that the color and lines don't represent the right AUR-ROC score. As you can see in the plot below, it says for the red line (lda) an AUC-ROC of 0.84, but you can…
Quinten
  • 35,235
  • 5
  • 20
  • 53
2
votes
1 answer

Wrong ROC curve for multiclass classification

I have trained a CNN to classify images into 5 classes. But when I try to plot ROC curve for each class versus the rest, all 5 classes have almost a diagonal curve with AUC of around 0.5. I have no idea what has gone wrong. The model should have an…
2
votes
1 answer

What is the threshold for the sklearn roc_auc_score

In my classification problem, I want to check whether my model has performed good, so i did a roc_auc_score to find the accuracy and got the value 0.9856825361839688 my question this is my…
Lijin Durairaj
  • 4,910
  • 15
  • 52
  • 85
2
votes
2 answers

R: how to plot ROC for logistic regression model whit missing values

I have a logistic regression model and I'd like to plot ROC curve. All variables have some missing data. Here's the summary: X<-cbind(outcome, var1, var2) summary(X) # outcome var1 var2 # Min. :0.0000 Min. :…
Elena
  • 23
  • 5
2
votes
0 answers

Inverted ROC/AUC (0.65) when using sklearn SVM

I fit an rbf SVM to training data and then computed the AUC and plotted an ROC on that data. I expect it to overfit and yet instead the AUC seems to be 0.35. The accuracy is 62%. Inverting the ROC yields results of 0.65 (obviously) but I am unsure…
eugenzilio
  • 21
  • 1
2
votes
2 answers

How to find the ROC curve and AUC score of CNN model (keras)

I am new to deep learning. I am trying to generate ROC curve for the following code. I am using keras. The class size is 10 and the image are RGB image of size 100* 100* 3. I went through [This link][1]. My problem is also same but I could not find…
s T
  • 49
  • 1
  • 5