I ran cv.glmnet
using a Poisson distribution for a binary outcome. The predict
function returns predicted probabilities, but not predicted classes. How do I convert the probabilities into classes so I might generate a confusionMatrix
to determine AUC, etc.? NB. At least one predicted probability is > 1.
cv <- cv.glmnet(deriv.x, deriv.y, foldid = foldid, weights = wts, family = "poisson")
pred <- predict.cv.glmnet(cv, newx = valid.x, s = "lambda.min", "response")
confusionMatrix(pred, valid.y)
Error in confusionMatrix.default(pred, valid.y) :
the data cannot have more levels than the reference