koaning / tokenwiser

Bag of, not words, but tricks!
https://koaning.github.io/tokenwiser/
Apache License 2.0
68 stars 7 forks source link

Allow slicing the PartialPipeline #47

Closed MBrouns closed 3 years ago

MBrouns commented 3 years ago

Normal sklearn pipelines allow getting out sub-pipelines by using the sequence slicing notation. I use this frequently to check and debug the data right before it goes into the model. This doesn't work for PartialPipeline because some arguments are missing in the constructor.

This PR currently only contains a test case illustrating the behaviour. Do you want to support slicing for partial pipelines as well? Then I'll update the PR with the required changes.

koaning commented 3 years ago

The slicing feels like a solid trick. Especially when you consider that the alternative might be a PartialDebugPipeline 😅 .

MBrouns commented 3 years ago

Right, that was a simple fix. Getting rid of the __init__ that did nothing else than call super fixes it

koaning commented 3 years ago

I just also allowed to slice the feature union here. Pushed a new version to pypi too.