6
Extracting Features from Date and Time Variables
Date and time variables are those that contain information about dates, times, or both. In programming, we refer to these variables as datetime variables. Examples of datetime variables include date of birth, the time of an event, and date of last payment. The cardinality of datetime variables is usually very high. This means they contain a multitude of unique values, each corresponding to a specific combination of date and/or time. Therefore, we do not utilize datetime variables in their raw format in machine learning models. Instead, we enrich the dataset by extracting multiple features from these variables. In this chapter, we will learn how to extract new features from date and time by utilizing ...
Get Python Feature Engineering Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.