HR Analytics: Predicting Employee Churn in R
Anurag Gupta
People Analytics Practitioner
# Final model, you will complete this in the next exercise
final_log <- glm(...)
# Make predictions for training dataset
prediction_train <- predict(final_log, newdata = train_set_final,
type = "response")
prediction_train[c(205, 645)]
205 645
0.06069079 0.99999898
# Look at the predictions range
hist(prediction_train)
# Make predictions for testing dataset
# test_set is the test dataset from chapter 3 exercise 2
prediction_test <- predict(final_log, newdata = test_set,
type = "response")
# Look at the predictions range
hist(prediction_test)
HR Analytics: Predicting Employee Churn in R