Feature Engineering
Let's engineer some features for the prediction model.
Features are the backbone of any learning system. Let’s think about the main actors or dimensions that will play a key role in our feature engineering process.
- Ad
- Advertiser
- User
- Context
đź“ťContext refers to the engagement history, user interests, current location, time and date, as discussed in the previous lessons.
Features for the model
Now it’s time to generate features based on these actors. The features would fall into the following categories:
-
Ad specific features
-
Advertiser specific features
-
User specific features
-
Context specific features
-
User-ad cross features
-
User-advertiser cross features
A subset of the features is shown below:
Ad specific features
-
ad_id
A unique id is assigned to each ad and can be used as a sparse feature. Utilizing ad_id as a sparse feature allows the model to memorize historical engagement for each ad, and it can also be used in interesting cross features for memorization (such as ad_id * user interests). Additionally, we can also generate embeddings during training time for the ad using its id, as we will discuss in the ad prediction section.
-
ad_content_raw_terms
Ad terms can also be very useful sparse features. They can tell us a lot about the ad, e.g., a good model can learn from the text’s content to identify what the ad is about, such as politics or sports. Raw terms allow the models (especially NN models) to learn such behavior from given raw terms.
-
historical_engagement_rate
This feature specifies the rate of user engagement with the ad. Here we will measure engagement in different windows such as different times of the day or days of the week. For instance, we can have the following features:
-
ad_engagement_history_last_24_hrs
Since ads are short-lived, recent engagement is important. This feature captures the most recent engagement with the ad.
-
ad_engagement_history_last_7_days
This captures the activity on the ad on each day of the week. For example, an ad can get more engagement on weekends rather than on weekdays. ...
-