Time-based features

Time-based features extract from a date variables a model can use: year, month, day of the week, hour, weekend, public holiday, time elapsed since an event. They capture seasonality and calendar effects that a raw date does not convey.

Example

df['jour_semaine'] = df['date'].dt.dayofweek

Related concepts

The whole glossary