Created
July 30, 2019 07:54
-
-
Save mfmakahiya/d176a80a9e618bfe329043d91a2cfb6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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