File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 63
63
# means that the final logistic regression step contains the feature names of the input.
64
64
clf [- 1 ].feature_names_in_
65
65
66
+ # %%
67
+ # .. note:: If one uses the method `set_params`, the transformer will be
68
+ # replaced by a new one with the default output format.
69
+ clf .set_params (standardscaler = StandardScaler ())
70
+ clf .fit (X_train , y_train )
71
+ clf [- 1 ].feature_names_in_
72
+
73
+ # %%
74
+ # To keep the intended behavior, use `set_output` on the new transformer
75
+ # beforehand
76
+ scaler = StandardScaler ().set_output (transform = "pandas" )
77
+ clf .set_params (standardscaler = scaler )
78
+ clf .fit (X_train , y_train )
79
+ clf [- 1 ].feature_names_in_
80
+
66
81
# %%
67
82
# Next we load the titanic dataset to demonstrate `set_output` with
68
83
# :class:`compose.ColumnTransformer` and heterogeneous data.
You can’t perform that action at this time.
0 commit comments