training <- sample(c(1:2000), 0.6*2000)
trainData = cbind(label = label[training], words.df[training,])
reg <- glm(label ~ ., data = trainData, family = 'binomial')
validData = cbind(label = label[-training], words.df[-training,])
pred <- predict(reg, newdata = validData, type = "response")
confusionMatrix(ifelse(pred>0.5, 1, 0), label[-training])
However, it doesn't produce confusion matrix.
Therefore, I tried with
But, nothing is working. I will appreciate if you can point out the issue and/or suggestion.