Creating a scikit-learn pipeline
If there is one thing that you may have noticed by now in this book, it's that there are many common steps for every problem we have looked at. We're now going to ensure that we can more easily iterate on the data and model creation steps by leveraging the scikit-learn
pipeline to put together an easy, repeatable process. In this section, we are going to take a previous workflow that would ordinarily need to be repeated many times and turn it into a single unit, which will allow you much greater flexibility and save time compared to the previous process. If you are starting with this chapter or jumping to it before going through the others, you need to know that the underlying concepts covered previously are still incredibly important to understand.
To visualize what the process is going to look like, you can refer to the following diagram. On the left, you will see normal data input being passed into the pipeline object. In that pipeline...