Session Ready
Exercise

Fit decision tree model

Now you will fit a decision tree on the training set of the telecom dataset, and then predict labels on the unseen testing data, and calculate the accuracy of your model predictions. You will see the difference in the performance compared to the logistic regression.

The accuracy_score function has been imported, also the training and testing datasets that you've built previously have been loaded as train_X and test_X for features, and train_Y and test_Y for target variables.

Instructions
100 XP
  • Initialize a decision tree classifier.
  • Fit the decision tree on the training data.
  • Predict churn labels on the testing data.
  • Calculate and print the accuracy score on the testing data.