Extracting features from date and time
In Chapter 6, Extracting Features from Date and Time Variables, we discussed how we can enrich our datasets by extracting features from the date and time parts of datetime variables, such as the year, the month, the day of the week, the hour, and much more. We can extract those features automatically utilizing featuretools
.
The featuretools
library supports the creation of various features from datetime variables using its datetime transform primitives. These primitives include common variables such as year, month, and day, and other features such as is it lunch time or is it weekday. In addition, we can extract features indicating if the date was a federal or bank holiday (as they call it in the UK) or features that determine the distance in time to a certain date. For a retail company, the proximity to dates such as Boxing Day, Black Fridays, or Christmas normally signals an increase in sales, and if they are forecasting demand, these will...