Styxis
Company
Knowledge

Interpreting RFECV support: selected count is not the original feature axis

A support result for one subset is still a vector over all original input features. Do not use an incorrect shape annotation as an aggregation contract.

Feature stability needs the same identities across folds

A feature-selection stability table must preserve the original feature axis rather than shrink to the selected count. Unselected features need their original positions to align with selection decisions in other folds. Compressing each result to only selected features can make the same column position refer to different variables. [1, 2, 3]

A documentation issue, not demonstrated incorrect predictions

scikit-learn issue 35033 points out that per-split RFECV ranking and support have subset and original-feature axes, while the reference describes one axis. It distinguishes test_score, which is scalar for each subset. The reporter separates observations on runtime 1.9.0 from documentation labeled 1.9.1 and explicitly does not claim incorrect selection, scores or predictions or request a change to returned arrays. [1]

Preserve the original axis in long-form data

Convert results into a long table keyed by fold, subset and original feature ID. Check that each subset represents all original features. Count true support entries separately as the number selected rather than confusing that count with vector length. Define the meanings and axes of ranking and support before handing them over or averaging them as though they were interchangeable scores. [1, 3]

Selecting 1 feature can still require length 3

Suppose the original input has 3 features and one evaluated subset selects only 1. Expected support-vector length remains 3. Keeping all 3 positions satisfies the axis condition. Compressing it to length 1 loses unselected positions and fails. Matching length still requires separate checks that feature identities have not been duplicated or changed. [1, 3]

Prepare the right table for a Truthound group check

QueryGroupAggregateValidator in Truthound Core 3.3.2 accepts an SQL query over prepared data along with group and aggregate columns. Check that each fold-and-subset group accounts for the original feature count, combining this with key checks so duplicates cannot merely fill the count. Use the result to improve handoff and interpretation without inflating a documentation mismatch into a model-accuracy defect. [1, 2, 3]

Application conditions

Prepare fold_id, subset_size, original_feature_id, selected and ranking from raw data and approved references, preserving row identity.

Alternatives

Preserve actual array shapes and fitted feature names, distinguishing the documentation version from the runtime version.

Limitations

  • Do not inflate a documentation shape mismatch into an actual RFECV scoring or prediction error.

Evidence

Event checked
Subject checked
Modified