The Objective: Stable → Encoded → ML-Ready
The Encoding Phase follows a strict linear progression. WOE-ML steps depend on the previous ones.1. Numerical Discretization (num_encoder)
The Binning Engine. Continuous features are transformed into discrete bins using the selected fitting strategy. This creates the foundation for WOE encoding and enables interpretable bin-level analysis.
- Bin boundaries are learned from the training distribution.
- Each bin is validated for minimum population share and target separation.
- The resulting encoding is locked — the same boundaries apply at inference time.
2. Categorical Encoding (cat_encoder)
Category Normalization. Object and categorical features are mapped into a consistent encoded representation.
- Low-frequency categories are handled (merged).
- The category → code mapping is stored as an immutable artifact.
- Ensures the model sees a stable representation regardless of original category order.
3. Interaction Discovery (ixn_encoder)
Pattern Amplifier. Generates new interaction variables by combining stable numerical and categorical features. Captures relationships that individual features cannot express alone.
- Uses a tree-based search to identify high-signal feature pairs.
- Interactions are screened for target relevance before inclusion.
- Optional — skip if your features already capture the relevant relationships.
4. WOE Encoding (woe_encoder)
The Core Transformation. Converts all encoded features (numerical bins, categorical codes, interactions) into Weight of Evidence values relative to the binary target.
- Each bin’s WOE = ln(Bad Rate / Good Rate) for that segment.
- The result is a feature that is approximately linear in log-odds space — ideal for GLM agents.
- WOE values are locked at training time. New observations map to the same WOE values at inference.
5. WOE Stability Filter (woe_stabilizer)
The Second Guardrail. Screens WOE-encoded features for temporal stability. A feature whose WOE distribution shifts significantly across time folds is flagged as unstable and pruned.
- Complements the Data Phase stability check (which operates on raw features distribution).
- This operates on the encoded representation — verifies time stability of target variable across feature bins.
- Result: The final feature set is stable both in its distribution AND in its target behavior.
6. ML Sample Synchronization (data_encoder)
The Handoff Point. Applies all previously trained encodings to produce the final train.ml and test.ml datasets. This is the exact input that agents will train on.
- Ensures the same encoding pipeline is applied consistently to both train and test.
- Prevents the “train on one version, test on another” class of errors.
- The
train.ml/test.mldatasets are registered into the context — agents consume them directly.
