# 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.

937
questions

**0**

votes

**1**answer

29 views

### avoid x is neither increasing nor decreasing : {}.".format(x) when calculate auc score

So i have a list of false positive rates and a list of true positive rates obtained by varying a certain threshold. I'm trying to calculate the auc score but unfortunately i can't use roc_auc_score ...

**0**

votes

**1**answer

25 views

### How to draw ROC curve for a multi-class dataset?

I have a multi-class confusion matrix as below and would like to draw its associated ROC curve for one of its classes (e.g. class 1). I know the "one-VS-all others" theory should be used in ...

**1**

vote

**0**answers

20 views

### How to make a plot and ROC graph for a Naive Bayes model in R?

I'm attempting to make my first Naive Bayes model, my issue is that I'm not sure if my ROC graphs or plots work right, here's the code so far, at the very end is the error: stat_bin() using bins = 30. ...

**0**

votes

**0**answers

14 views

### P-Value of Partial ROC Curve with PYTHON

I have two AUC curves that I would like to calculate the P-Value over the partial AUC (fpr range 0.0 to 0.3). I have fprs and tprs correspond to these two ROC curves in the image.
fpr1=fpr2 = [0.0, 0....

**0**

votes

**0**answers

13 views

### How to interpret auc score

I am working on a ML project which is a binary classification problem having the target variable with two categories : Retention and NotRetention
I am separately calculating the auc score for ...

**1**

vote

**0**answers

21 views

### Plot ROC Curve for a prediction set of one class

I built a neural network to perform anomaly detection on a time series that has all anomaly values. This means, that the y_test is an array with all 1's inside it. Since the neural network classified ...

**-3**

votes

**0**answers

47 views

### Cox regression model with very irregular auc curve in R

When I evaluate the performance of a cox regression model in a test set in R, the auc curve is very irregular.
I used a test set of 100 samples to detect，thanks for any help!
enter image description ...

**0**

votes

**1**answer

755 views

### Error message with sklearn function " 'RocCurveDisplay' has no attribute 'from_predictions' "

I am trying to use the sklearn function RocCurveDisplay.from_predictions as presented in https://scikit-learn.org/stable/modules/generated/sklearn.metrics.RocCurveDisplay.html#sklearn.metrics....

**1**

vote

**0**answers

38 views

### Make roc curves like roc.glmnet in R

I am plotting several ROC curves in R to compare various models. In particular, I am checking LASSO, Logistic and Random Forests. However, while LASSO has a dedicated function for that, namely:
plot(...

**1**

vote

**1**answer

39 views

### Set the number of thresholds for ROC curve R ROCR

I am using the roc.curve of the ROCR package which provides a beautiful plot that is colorized according to the used threshold
using this code
library(ROCR)
pred <- prediction(predicted, response)
...

**0**

votes

**1**answer

43 views

### How to calculate a difference in AUC (with 95% CI) between two ROC curves?

I am using the roc.test function from the pROC package (version 1.17.0.1) to compare two ROC curves. The data is paired, hence using DeLong's test. However, the function does not output a confidence ...

**1**

vote

**0**answers

55 views

### Which performance metrics (F1 Score, ROC AUC, PRC, MCC Score) can help me assess my model's performance on an imbalanced dataset?

I am working on a text classification problem with a highly imbalanced dataset. I'm in a dilemma of choosing between performance metrics. I cannot figure out which matrix would be wise to choose ...

**0**

votes

**1**answer

27 views

### Calculating ROC for panel data and Linear Probability Model

I have panel data from external assets of 102 countries over ~ 20-40 years, depending on the country.
I tried predicting the probability for a financial crisis, depending on log(total_liabilities to ...

**0**

votes

**0**answers

5 views

### Better ROC AUC Baseline for 2 class problem

For a 2 class problem the minimum accuracy, which should be reached by your model is 50%.
However, a better baseline for your model is the accuracy you obtain by predicting the majority class.
For ROC ...

**1**

vote

**1**answer

23 views

### Plot ROC from multi-class from Weka prediction

I am trying to plot ROC curve from the prediction which was obtained from Weka command prompt. It contains Actual, predicted, error and prediction column. How to plot from this in Python (or other ...

**3**

votes

**2**answers

67 views

### Create ROC curve manually from data frame

I have the below conceptual problem which I can't get my head around.
Below is an example for survey data where I have a time column that indicates how long someone needs to respond to a certain ...

**0**

votes

**2**answers

47 views

### ROC curves using pROC on R: Calculating lab value a threshold equates to

I am using pROC to provide the ROC analysis of blood tests. I have calculated the ROC curve, AUC and am using the ci.coords function to provide the spec, sens, PPV and NPV at a provided specificity (...

**0**

votes

**0**answers

12 views

### Is Three-Dimensional Receiver Operating Characteristics (3D ROC) function available in any python library?

I want to use 3D ROC curve as evaluation matrix. But I am unable to find any pre-built implementation on GitHub. If anyone has idea about that, kindly share it.

**0**

votes

**1**answer

29 views

### Issue using "pred_yes" column as the estimate argument to roc_curve()

When I run the below data it shows an incorrect roc_curve.
Prep
The below code should be run-able for anyone using r-studio. The dataframe contains characteristics of different employees regarding: ...

**0**

votes

**1**answer

30 views

### Unable to find Accuracy and the ROC curve of my CNN model

My sample CNN code looks below:
classifier = Sequential()
#1st Conv layer
classifier.add(Convolution2D(64, (9, 9), input_shape=(64, 64, 3), activation='relu'))
classifier.add(MaxPooling2D(pool_size=(4,...

**1**

vote

**0**answers

23 views

### Why is the estimated result of AUC in roc.test() inconsistent with the original result?

I made two ROC curves and one of the results is as follows:
> roc1 <- roc(cData$`<60`$resule, cData$`<60`$SOFA1)
Setting levels: control = survival, case = death
Setting direction: ...

**0**

votes

**0**answers

8 views

### 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 ...

**0**

votes

**0**answers

44 views

### random forest classifier- rocplot gives a diagonal line

I am working with a small dataset (57 rows), and i am trying to make a prediction on disease activity i.e. active vs healthy. When I want to asses the performance of my classifier by looking at the ...

**0**

votes

**0**answers

29 views

### Nested loop results in same values for every column. Why?

The question is about nested for-loops. I know this is not always looked upon favorably always, but since this is a good way for me to learn how to use them I do use them for my project.
for (r in 1:R)...

**0**

votes

**0**answers

20 views

### Attempting to create an ROC Curve

So i have a set of dataset of red and white wines, fitting a binomial regression in R. I was able to calculated a confusion matrix and from this i am trying to create an ROC Curve.
i am attempting to ...

**0**

votes

**0**answers

26 views

### Plot ROC from confidence ratings

In my experiment participants rate their confidence concerning the distance between two stimuli previously presented on a 5 step scale (1 = sure they are near, 3 = don't know, 5 = sure they are far). ...

**0**

votes

**1**answer

20 views

### gridsearch.predict_proba results in list rather than array

I followed example and tried to use gridsearch with a random forest classifier to generate roc_auc_score, however, the y_prob=model.predict_proba(X_test)
I generated was in list (two arrays) rather ...

**0**

votes

**1**answer

81 views

### fasttext ROC and AUC issue for binary classifications

I tried to calculate ROC and AUC for fasttext trained model but I always get the error ValueError: Found input variables with inconsistent numbers of samples: [40, 200]
My testing code as follow:
def ...

**0**

votes

**1**answer

23 views

### Getting ROC curve with one point

I'm trying to build ROC curve for XGB model outputs.
I'm getting tpr & fpr arrays with 3 values only, which eventually outputs ROC curve with one point only:
X = data_db.copy().drop(columns=['Y'])
...

**0**

votes

**0**answers

55 views

### Random forest classifier and ROC and AUC curves Error

I have two dataframe df_Lib (5 rows × 97 columns) and df_Entre (5 rows × 97 columns) of same label data. df_Lib have target variable named Liberal while df_Entre have Entrepreneurship. I used random ...

**0**

votes

**0**answers

22 views

### ROC curves under diagonal with benchmark mlr3

May i ask stupid question. Why roc curves are under diagonal in benchmark case, and above diagonal in another.
library(mlr3verse)
library(mlr3viz)
task = tsk("german_credit")
design = ...

**0**

votes

**0**answers

21 views

### How to get a smooth ROC curve from CNN with keras functional API?

I use the following code:
fpr, tpr, t = roc_curve(true_categories, predicted_categories)
I know the predicted_categories should be probability or confidence.
But as predict_proba() seems not working ...

**0**

votes

**0**answers

13 views

### Try to plot roc_curve but the area=0.00 in CNN LSTM keras

I am trying to plot the roc_curve for a CNN LSTM in Keras but the plot is a zero area. Here is an image
I have put lst which is the labels. Also, I have lista15[0] and lista15[1] which is the ...

**0**

votes

**0**answers

37 views

### Can we calculate Roc_auc_score and display as monthly

Currently I'm calculating Roc Auc score and displaying the Auc curve. But now I want to calculate Roc Auc score on a month to month basis and display month on month performance. How can we achieve ...

**1**

vote

**0**answers

21 views

### Error: multiclass format is not supported, AUROC

I want to calculate ROC scores but an error was flagged out "multiclass format is not supported" I'm not too sure why there is an error as I have already changed my y to binary.
y = dat['...

**0**

votes

**0**answers

20 views

### ROC Curves for multiple classification techniques

I have plotted 3 different separate ROC curves in R, for models Logistic Regression, Decision Tree, and Random Forest. How can I combine these curves to show all these techniques in one chart?
To plot ...

**0**

votes

**0**answers

140 views

### Measure ROC and AUC of PyTorch Transfer Learning Tutorial

I want to measure and plot the ROC and AUC of a multi-class image classier. I followed the transfer learning tutorial to build and train my model. My attempt to attain the ROC value is done through ...

**0**

votes

**1**answer

78 views

### How to plot the ROC Curve and Accuracy using Python?

From a dataframe consisting of va1, val1 and weight I created a training set and a test set. I used some metrics and compared them to the test set. The corresponding (true) values are saved inside the ...

**0**

votes

**0**answers

30 views

### ROC curve interpretation

I have a question regarding the ROC curve. The question is: Order the points A, B, C w.r.t the accuracy of the classifier (from good to weak).
I know the ROC curve shows the relation of true positive ...

**0**

votes

**0**answers

19 views

### Why when I show ROC, it shows my first class ROC is nan?

I made a classification and used multi-labels in this classification:
The labels are as follows:
0 =>10000
1 =>11000
2 =>11100
My question is why when I plot ROC, ROC becomes 'nan' in the ...

**0**

votes

**1**answer

257 views

### How to remove horizontal grid lines and get plain white background on ROC graph

I am conducting a ROC curve analysis in Stata. However, I am having trouble with the commands needed to get a plain white background plot.
I would like to:
remove the faint horizontal grid lines in ...

**3**

votes

**1**answer

84 views

### Efficient ROC/AUC calculation & time complexity

Receiver Operating Characteristic (ROC) and Area Under Curve (AUC) are very known concepts. I have used them repeatedly (using libraries like scikit-learn), but never actually learned how to implement ...

**0**

votes

**0**answers

31 views

### How to set roc curve pos_label !=0

I'm using sklearn roc_curve to plot for various class output values (0 to 5).
Its not a multiclass classification however.
Each time I compare class=0 with either class=1,2,3,4 or 5.
I want to retain ...

**0**

votes

**1**answer

46 views

### ROCAUC legend and x/y-axis font size using Yellowbrick

I am using Yellowbrick ROCAUC. The plot font size (legend and x/y axis) is very small. Is there a way to increase the font size of the ROCAUC plot?
model = clf
visualizer = ROCAUC(model)
visualizer....

**0**

votes

**0**answers

17 views

### How to calculate a measure of diagnostic accuracy and plot summary ROC curve using HSROC package in r

I am working on a diagnostic accuracy systematic review and meta-analysis. I was planning to use the HSROC package to perform the hierarchial receiver operating characteristics curve plot and obtain ...

**0**

votes

**0**answers

34 views

### Plotting ROC curve using Support vector machine's scores

I have scores from SVM. I didn't run the SVM model myself instead downloaded the SVM raw score. I understand SVM score doesn't give probabilities but negative and positive values. Positive values ...

**0**

votes

**0**answers

18 views

### How to calculate ROC AUC with signed ground truth values and no-signed predict values

I have ground truth values like [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4], which shows how close a moving point on a line is close to a fixed point. The value is signed to indicate left and right.
My ...

**1**

vote

**0**answers

58 views

### 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"))
...

**0**

votes

**2**answers

55 views

### How do I loop a code over all columns in R?

Package:
install.packages("pROC")
library(pROC)
The dataset looks like this: Dataset #Apologies for not including the actual dataset
I am trying to apply the roc() code across all columns ...

**0**

votes

**0**answers

22 views

### How to start for-loop with function from third column?

Package:
install.packages("pROC")
library(pROC)
The dataset looks like this:
Dataset
#Apologies for not including the actual dataset
I am trying to apply the roc() code across all columns ...