Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Predict the test set using the model
pred_ols = predict(lmmod, test[,3:32], type="response")
pred_ols
# Apply a threshold
new_pred_ols = ifelse(pred_ols >= 0.5, 1, 0)
new_pred_ols = data.frame(new_pred_ols)
data_ols = cbind(test[,2], new_pred_ols)
names(data_ols) = c("actual", "pred")
xtab_ols = table(data_ols$actual, data_ols$pred)
cm_ols = confusionMatrix(xtab_ols)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment