Datasets

Learn how to build the dataset module.

Let’s first review the architecture of the pipeline.

Press + to interact
ML pipeline architecture
ML pipeline architecture

Let’s also revisit the diagram depicting encapsulation.

Press + to interact
Diagram of the Dataset class
Diagram of the Dataset class

From these diagrams, we see that the first step in the development of the pipeline is to create an abstract base class called Dataset from which all other dataset classes derive. This base class should have four abstract methods—load, preprocess, feature_engineer, and save—corresponding to the blocks shown above. Note that each of these methods, with the exception of save, also corresponds to a task in the pipeline. The save method is a utility method that we’ll examine later.

The ML project we’re working on is iris classification, so we need a dataset for ...