-
-
Save rvndbalaji/58e306cb329b8295b8d0952c4c0cbb9c 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
model = glm(Occupancy~.,train,family= binomial(link = "logit") | |
pred = predict(model,test[,-6]) | |
#All values with probability less than 0.7 are considered occupied. | |
pred[pred>=0.7] = 1 | |
pred[pred<0.7] = 0 | |
pred = factor(pred) | |
plot(pred) | |
#Calculate R-sqaured value | |
perf(pred,test$Occupancy) | |
#Output | |
#[1] 0.9386446 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment