Exercise

Fitting the tree to employee data

A train/test split provides the opportunity to develop the classifier on the training component and test it on the rest of the dataset. In this exercise, you will start developing an employee turnover prediction model using the decision tree classification algorithm. The algorithm provides a .fit() method, which can be used to fit the features to the model in the training set.

Reminder: both target and features are already split into train and test components (Train: features_train, target_train, Test: features_test, target_test)

Instructions

100 XP
  • Import the classification algorithm called DecisionTreeClassifier.
  • Initialize it as model and set the random state to 42.
  • Apply the decision tree model by fitting the training set features to the model.