Session Ready
Exercise

Develop and test the best model

In Chapter 3, you found out that the following parameters allow you to get better model:

  • max_depth = 8,
  • min_samples_leaf = 150,
  • class_weight = "balanced"

In this chapter, you discovered that some of the features have a negligible impact. You realized that you could get accurate predictions using just a small number of selected, impactful features and you updated your training and testing set accordingly, creating the variables features_train_selected and features_test_selected.

With all this information at your disposal, you're now going to develop the best model for predicting employee turnover and evaluate it using the appropriate metrics.

The features_train_selected and features_test_selected variables are available in your workspace, and the recall_score and roc_auc_score functions have been imported for you.

Instructions
100 XP
  • Initialize the best model using the parameters provided in the description.
  • Fit the model using only the selected features from the training set.
  • Make a prediction based on the selected features from the test set.
  • Print the accuracy, recall and ROC/AUC scores of the model.