Sklearn components in pipeline is not fitted even if the whole pipeline is?

后端 未结 1 705
無奈伤痛
無奈伤痛 2021-01-03 06:09

I\'m trying to single out a component/transformer from a fitted pipeline to inspect it\'s behavior. However, when I retrieved the component, the component is showed as unfit

相关标签:
1条回答
  • 2021-01-03 06:51

    The ColumnTransformer attribute transformers is the input unfitted transformers. To access the fitted transformers, use the attribute transformers_ or named_transformers_. I suppose get_params()['preprocessor__cat__imputer'] is also getting the unfitted input transformer.

    (You'll still get an error, because the imputer will try to work on the string data as well, and strategy='median' will fail.)

    0 讨论(0)
提交回复
热议问题