davegas100
davegas100

Reputation: 3

Issues with ROC curves of logistic regression model in R

I did some analysis with my data but I found that all the ROC plots have the threshold points consolidated at the base of the graphs. Is the issue from the data itself or from the package used?

library(ROCR)
ROCRPred = prediction(res2, test_set$WRF)
ROCRPref <- performance(ROCRPred,"tpr","fpr")
plot(ROCRPref, colorize=TRUE, print.cutoffs.at=seq(0.1,by = 0.1))

ROC curve

Upvotes: 0

Views: 233

Answers (2)

Shikha
Shikha

Reputation: 237

I think "the threshold points are consolidated at the base of the graphs" due to the parameter 'print.cutoffs.at' in plot.

According to the documentation print.cutoffs.at:-This vector specifies the cutoffs which should be printed as text along the curve at the corresponding curve positions.

As mentioned by @Calimo in his answer to adapt the threshold according to the data.

Upvotes: 0

Calimo
Calimo

Reputation: 7949

Why did you choose cutoffs between 0.1 and 1?

print.cutoffs.at=seq(0.1,by = 0.1)

You need to adapt them to your data. For instance you could use the quantiles:

plot(ROCRPref, colorize=TRUE, print.cutoffs.at=quantile(res2))

Upvotes: 1

Related Questions