Feature engineering creates or transforms variables so a dataset better represents the processes relevant to a model. It combines domain knowledge, mathematical insight, and analytical intuition with exploratory analysis. section 9.2.1 section 9.4
Common techniques include:
- Extract components from existing columns, such as month numbers or day-of-week values from dates. section 9.2.1 section 9.4
- Encode categories as binary or dummy variables so categorical patterns can enter a model. section 9.2.1
- Transform numerical variables with operations such as square roots or squares when relationships or model assumptions call for them. section 9.2.1 section 9.4
- Combine datasets and aggregate observations at a useful grain, such as daily complaint counts joined with weather measurements. section 9.2.1
Forecasting rat complaints
A city dataset aggregates rat sightings by day and combines them with daily temperature and other weather measures. Month, weekday, and transformed wind-speed variables then represent seasonality, weekly patterns, and nonlinear relationships relevant to staffing forecasts. section 9.2.1 section 9.4
Figure 9.19 Preview of the combined rats and weather dataset
Preview the combined rats-and-weather dataset used to connect engineered predictors with an operational forecasting question. section 9.2.1















