Skip to main content
Data Science
What this does: Transforms raw ride data into meaningful patterns — such as demand trends from past hours and time-of-day effects — that the model can learn from, directly improving forecast accuracy.
Feature engineering focuses on capturing temporal dependencies in the time-series data using lag features, temporal extractions, and feature interactions.

Pipeline Overview

The feature_engineering pipeline transforms clean data into a supervised learning dataset through 4 chained nodes.

Key Transformations

1. Target Variable

We forecast the next hour’s demand.
  • Feature: target
  • Logic: df['cnt'].shift(-1)
  • Impact: The model predicts t+1t+1 using data available at tt.

2. Lag Features

We create “lags” to provide historical context for the model.

Visualizing Temporal Dependencies

How the model “looks back” in time to predict the future:

Lag Configuration

All lag values are defined in conf/base/parameters.yml:

Transformation Example

Visualizing how Lag 1 shifts data to provide historical context for the model.

3. Data Splitting

The dataset is split chronologically (not randomly) to preserve temporal order:
feature_engineering/nodes.py

4. Data Cleaning

NaN Handling: We first apply Backward Fill (bfill) to preserve initial rows, then drop any remaining NaN values to ensure clean input for the model.

Data Catalog

All engineered datasets registered in the catalog with schemas and paths.

Training & Optimization

How engineered features are used to train CatBoost with Optuna optimization.