Session Ready
Exercise

Creating new features

Feature engineering includes also the actual creation of new features. Creating new features is important since the model relies on such features for prediction accuracy. In this exercise, you will check on properties of three columns which appear as integers in the data but represent categorical values. These three columns are: search_engine_type, product_type, and advertiser_type. You will create count features for those 3 columns, as well as device_id and site_id. These count features represent the number of clicks for each of those columns and will be used later on for prediction.

The pandas module is available as pd in your workspace and the sample DataFrame is loaded as df.

Instructions
100 XP
  • Print the total number of values and the number of unique values for each feature in the feature_list list.
  • Create new features from the features in new_feature_list by counting the number of clicks for each feature using .transform().