Can arguments be passed dynamically to outer pipeline which can be used by any steps inside it?

Viewed 19

I have the following scenario:

num_cols = [..list of col names]
cat_cols = [..list of col names]

col_transformer = ColumnTransformer([
                           ('num', Scaler(), num_cols),
                           ('cat', OneHotEncoder(), cat_cols)
])

pipeline = Pipeline([
                           ('transformer', ColumnTransformer()),
                           ('regressor', LogisticRegression())
])

Now I would like set values for num_cols and cat_cols dynamically when calling pipeline.fit().

0 Answers
Related