sklearn/column-transformer-removed
| Rule | column-transformer-removed |
|---|---|
| Pack | scikit-learn |
| Severity | error |
| Fix | unsafe, with xpd check --fix --unsafe-fixes |
| Library versions | every version |
ColumnTransformer no longer takes force_int_remainder_cols, so the call raises TypeError on scikit-learn 1.9. Drop the keyword.
ColumnTransformer(transformers, remainder="passthrough", force_int_remainder_cols=False)ColumnTransformer(transformers, remainder="passthrough")What the rule reports
Section titled “What the rule reports”The rule reports force_int_remainder_cols= on ColumnTransformer and make_column_transformer.
How to fix it
Section titled “How to fix it”xpd check --fix --unsafe-fixes applies the fixes of this rule. Check the result, because an unsafe fix can change what the code does.
The unsafe fix drops force_int_remainder_cols, because the old form raises.
xpd applies the replacement with --fix --unsafe-fixes.
The keyword raises TypeError on scikit-learn 1.9.1, with either value. The remainder columns now come back in the form the other columns were given in. Neither reader called one of the 3 held-back reports wrong. Recall was 30 of 30.
Message
Section titled “Message”xpd prints this message with the issue. A name that starts with $ stands for code from your file.
$C no longer takes force_int_remainder_cols and raises TypeError on scikit-learn 1.9. Drop the keyword.Browse the other rules of the scikit-learn pack.