0

i'm doing a logistic regression classifier and i want to plot ROC curve. My code at the end, when doing prediction and trying to plot Roc is this:

library('ROCR')
pred <- predict(logMod, testing, type = "prob")
pred <- prediction(pred, testing$RainTomorrow)
evalL <- performance(pred, "acc")
plot(evalL)

My classifier is: logistic regression code:

logMod <- glm(RainTomorrow ~ ., data = training, family = 'binomial')
summary(logMod)

i want to set type = 'prob' in order to plot ROC but when i do so i get the error: Error in match.arg(type): 'arg' should be one of "link", "response", "terms"

Can someone help me? Thanks in advance

bek99
  • 1
  • 3
  • It's impossible to answer without knowing what your classifier is. Please see https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Calimo Jan 03 '21 at 10:41
  • @Calimo i edited the code and added code of the logistic regression classifier – bek99 Jan 03 '21 at 10:45
  • There is no `type = 'prob'` in `?predict.glm`. To get predictions on the probability scale use `predict(logMod, type="response")`. – user20650 Jan 06 '21 at 23:53

0 Answers0