Styxis
Company
Knowledge

Routing Bagging X_val with the same feature selection as each sub-estimator

Selecting training columns while forwarding validation metadata unchanged gives the two inputs different feature spaces.

The same table must include the same column selection

Validation data must use the same feature identities and order as training data if collaborators are to evaluate the same input space. The table supplied to an ensemble can differ from the table each sub-estimator actually sees. Preparing a complete validation table does not by itself satisfy those narrower input contracts. [1, 2, 3]

Reduced training columns, unchanged metadata

scikit-learn issue 35047 reports Bagging selecting training features while forwarding routed X_val at full width. The reproducer raises a feature-count error in a HistGradientBoosting sub-estimator. It distinguishes sample-aligned metadata handling from feature-aligned handling. This is a reported fit failure, not evidence that every successfully trained ensemble has incorrect scores. [1]

Hand over the sub-estimator's feature selection

Apply each estimator's selected-feature list to validation data and compare identity and order, not only width. If bootstrap_features creates repeated positions, retain both original feature ID and selected position. When converting to a table that cannot hold duplicate column names, use position-specific aliases and preserve their mapping to original names so selection meaning is not lost. [1, 3]

Equal widths do not make age equal to income

If an illustrative sub-estimator's first feature is age, validation data at that position must also represent age. An age entry passes that positional check. An income entry fails even with equal width because it supplies a different variable. Check all selected positions rather than generalizing success at the first one. Obtain the expected list from the training selection record, not by reconstructing it from validation output. [1, 3]

Supply Truthound with the real column contract

ColumnOrderValidator in Truthound Core 3.3.2 checks table columns against expected_order. Prepare each estimator's validation input with accurate names, representing repeated selections with position-specific aliases before comparing order. Preserve the alias-to-source feature mapping separately. Truthound does not repair metadata routing, and column alignment does not establish validation-sample independence or absence of label leakage. [1, 2, 3]

Application conditions

Prepare the actual validation feature table and expected column order for each estimator, alongside estimator_id, train_feature_position, train_feature_id and validation_feature_id. Preserve row identity and use position-specific aliases with a source-feature mapping for repeated selections.

Alternatives

Include the selected-feature list in the estimator artifact and use the same selection function for training and validation.

Limitations

  • Column alignment does not establish validation-sample independence or absence of label leakage.

Evidence

Event checked
Subject checked
Modified