2

I am building a sklearn Pipeline including a FeatureUnion

MyPip= Pipeline([
    # other steps 


    ('myunion', FeatureUnion(
        transformer_list=[

            # Pipeline for pulling features from the post's subject line
            ('my_transform1', my_transform()),
            ('my_transform2', my_transform_alt())
            ]))
    )),

])

Normally, I could inject parameters into my pipeline using:

Params={}

Params.update({'my_step__my_param_name':'my_param_value'})
MyPip.set_params(**Params)

But how do I set the parametrs of the feature union transformer_list?

I have tried

Params.update({'transform1__my_param_name':'my_param_value'})
Params.update({'myunion__my_transform1__my_param_name':'my_param_value'})
Params.update({'myunion__transformer_list__my_transform1__my_param_name':'my_param_value'})
MyPip.set_params(**Params)

but none of them worked.

00__00__00
  • 4,834
  • 9
  • 41
  • 89

0 Answers0