Session Ready
Exercise

A first CTR model

In this exercise, you will build a first CTR model on the Avazu dataset using a decision tree and evaluate the accuracy of the model using accuracy_score() from sklearn. Additionally, you will use train_test_split() from sklearn to split training and testing data instead of manually defining a split point as before.

In your workspace, sample data in DataFrame form is loaded as df along with sklearn and pandas as pd.

We will do a basic training and testing split and evaluate our results using accuracy.

Instructions
100 XP
  • Define both X and y to be the features and target respectively based on the click column.
  • Split the data into training and testing sets using train_test_split(X, y).
  • Create a decision tree classifier.
  • Create predictions using the classifier and evaluate the accuracy of its predictions.