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

Getting perfect ROC-AUC score for Linear SVC

I am evaluating different classifiers for my sentiment analysis model. I am looking at all available metrics, and whilst most achieve a similar precision, recall, F1-scores and ROC-AUC scores, Linear SVM appears to get a perfect ROC-AUC score. Look…
turnip
  • 2,246
  • 5
  • 30
  • 58
-1
votes
1 answer

ROC curve error

I have dataset like this train <- sample(1:nrow(df), nrow(df)*0.80) train <- df[train, ] test <- df[-train, ] NaiveBayes1 <-naiveBayes(purchased ~ .,data=train) pre1 <- predict(NaiveBayes1,test,probability = TRUE) library(pROC) roc1 <-…
joerna
  • 435
  • 1
  • 6
  • 13
-1
votes
1 answer

ROC curve from train/test set in caret R package

I am working to plot a ROC curve of a model that uses a test/train set created with the caret R package. I either am not putting in the right data to plot or am missing something about the creation of my test/train set. Any insight?? *Edited with…
A. Kather
  • 47
  • 2
  • 3
  • 8
-1
votes
1 answer

How to build a roc curve and do statistical analysis?

I have 5 data sets with different sizes, for each dataset, I have selected 10 bootstrap samples of the same size as the database and for each sample, I have the values of true positives, true negatives, false positives, false negatives And the…
Denise
  • 69
  • 7
-1
votes
1 answer

Unable to produce ROC curve in RCommander

I have written the following code to plot ROC curve: pred1 <- prediction(predict(modelID), LS_01RR$Payment_Ind) perf1 <- performance(pred1,"tpr","fpr") plot(perf1) plot(perf1,main="hivpr - ROC Curves",col="blue") abline(0,1,col="grey") But It…
-1
votes
1 answer

error in calculating AUC ROC in python

I am implementing linear regression in python using sklearn. I have successfully trained model using linear_model.LinearRregression() function. Now, I want to measure goodnessoffit of the model using AUC ROC method. I am using following code for…
KrunalParmar
  • 1,062
  • 2
  • 18
  • 31
-1
votes
1 answer

roc_curve: indices must be integers, not tuple

I am trying to plot ROC and thus calculate false positive and negative rate using the sklearn.metrics.roc_curve function. roc_data = *somedataframeimport* X_train, X_test, y_train, y_test = split_vect_trans(roc_data) After vectorizing and…
Lyyoness
  • 33
  • 6
-1
votes
1 answer

How to plot per tree ROC curves from randomForest in R?

I know that randomForest is supposed to be a black box, and that most people are interested in the ROC curve of the classifier as a whole, but I'm working on a problem in which I need to inspect individual trees of RF. I'm not very experienced with…
MaYa
  • 180
  • 7
-1
votes
1 answer

How to classify true negative from a video?

For a performance measuring purpose I am trying to draw ROC curve. In ROC curve I have to plot False Positive Rate (FPR) in x-axis and True Positive Rate (TPR) in y-axis. As we know, FPR = FP/(FP+TN) So in the following picture how can i detect…
-1
votes
1 answer

Issue with adding abline in ggplot and adjusting labels

I am building and customizing an ROC curve using ggplot in R. I am almost done except 2 challenges. The abline I am adding for some reason extends beyond 0 and 1. How to restrict this? The line should start from origin and go to (1,1) How do I show…
dsauce
  • 592
  • 2
  • 14
  • 36
-1
votes
1 answer

ROC Curve reduces when model is applied to a validation dataset

I am working on a logistic regression model and will appreciate if anyone can help me on this. I built a logistic regression model on a training data set and got AUC of 0.87 , however when I score the the validation data set using the model the AUC…
-1
votes
1 answer

How to plot a curved line in MATLAB using a set of points

I'm trying to draw ROC curves using an existing set of values using the following command plot(X1,Y1,'--rs',X2,Y2,'-*g'); Where X1,Y1,X2 and Y2 are matrices that have the same size However, the lines produced by this command are straight ones. How…
-2
votes
1 answer

Roc_curve over number of nearest-neighbors

I'm struggling to re-implement and catch the results of one of the unsupervised anomaly detections, which are shown below: The credit of picture to this paper Histogram-based Outlier Score (HBOS): A fast Unsupervised Anomaly Detection Algorithm by…
Mario
  • 1,631
  • 2
  • 21
  • 51
-2
votes
1 answer

sklearn.metrics.roc_curve only shows 5 fprs, tprs, thresholds

i have length 520 of array and metrics.roc_curve shows only a few fpr,tpr,threshold these are some values of my score array [... 4.6719894 5.3444934 2.575739 3.5660675 3.4357991 4.195427 4.120169 5.021058 5.308503 5.3124313 4.8253884 …
leila_7im
  • 19
  • 2
-2
votes
1 answer

I am not able to understand the meaning(intuition) of FPR, TPR, Threshold, ROC values calculated in my code?

I wanted to plot ROC curve for my classification model. As I am new to this, I read about it, saw few posts and referring this SO answer I created a roc curve. My data is this…
1 2 3
71
72