最終ステップ

HRアナリティクス:Rで社員離職を予測する

Anurag Gupta

People Analytics Practitioner

最終モデルの構築

# Final model, you will complete this in the next exercise
final_log <- glm(...)
HRアナリティクス:Rで社員離職を予測する

離職確率の予測

# 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
HRアナリティクス:Rで社員離職を予測する

確率の分布:訓練データ

# Look at the predictions range
hist(prediction_train)

HRアナリティクス:Rで社員離職を予測する

確率の予測:テストデータ

# 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")
HRアナリティクス:Rで社員離職を予測する

確率の分布:テストデータ

# Look at the predictions range
hist(prediction_test)

HRアナリティクス:Rで社員離職を予測する

練習しましょう!

HRアナリティクス:Rで社員離職を予測する

Preparing Video For Download...