Skip to content

Bug: EventFeatures minmax-standardizes constant columns — produces all-NaN in 3 of 48 input dims #51

Description

@bradsmithmba

Summary

EventFeatures.calculate sets all three output columns (days_to_earnings, days_to_fomc, days_to_opex) to single scalar constants across the entire date range. The final standardization loop then calls minmax on each constant column: (x - min) / (max - min) = 0 / 0 = NaN. All three event feature columns become all-NaN, infecting 3 of the 48 dimensions fed to RegimeDetector.

Evidence

src/features/regime_features.py lines 574-580: constants 30.0, 21.0, 10.0 assigned to all rows.
src/features/regime_features.py lines 583-584:

for col in features.columns:
    features[col] = self.standardize(features[col], method='minmax')

minmax on constant series → division by zero → NaN for every row.

Fix

Skip standardization for constant columns (check series.nunique() <= 1), or return the raw values without standardizing. The real fix is to implement actual event detection (earnings calendar, FOMC dates) so the columns are not constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions