Combining features together and chaining transformations

What's the best way to figure out how FeatureUnion and Pipeline operate? Just recall how the Scikit-learn API works: first, a class is instantiated, then it is fitted to some data, and then the same data (or some different data) is transformed based on the previous fitting. Instead of doing so along with your script, you just instruct a pipeline by providing tuples containing the name of the step and the command to be executed. According to the sequence, the operations will be executed by your Python's thread or distributed to different threads on multiple processors.

In our example, we are trying to replicate our previous example, building a logistic regression classifier by stability ...

Get Python Data Science Essentials - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.