Skip to content

(Modelling) Main Feature Engineering function #19

@GregW04

Description

@GregW04

Orchestrator Function build_features_for_range

Objective:
Create an orchestrator function that chains existing feature engineering functions to produce a complete feature DataFrame for a specified date range.

Function Signature:

def build_features_for_range(
    base_df: pd.DataFrame,
    start_date: str,
    end_date: str,
    lags=(7,14,28,365),
    roll_lags=(7,14,28),
    roll_windows=(7,14),
    roll_stats=("mean", "std")
) -> pd.DataFrame

if you want you can use this ready Helper function:

def required_lookback_days(lags, roll_lags, roll_windows):
    a = max(lags) if lags else 0
    b = max((rl + w - 1 for rl in roll_lags for w in roll_windows), default=0)
    return max(a, b)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions