Module 3 · step 2 of 4 · Pipelines and preprocessing
Add preprocessing steps
Add, configure, order and validate preprocessing steps such as encoding and scaling.
App8 min
In this step you add preprocessing steps to the pipeline you created, column by column, and check them with Check without running. It matters because the quality of the prepared columns often moves a model more than the choice of algorithm.
The idea
Preprocessing steps prepare the columns before a model sees them. In the Columns part, each row is one column and its chips are the transformations chosen for it. Most algorithms need numbers, so categories get encoded; many care about the scale of a column, so numbers get scaled. Steps run in order, from the first to the last, and a step can only use columns that earlier steps left in place. The seeded churn pipeline already has One-hot for the categorical columns and Standardise for the numeric ones, so you can compare your work with it.
Step by step
- Open the pipeline you created. In Columns, find a numeric column (use Find a column... or the type filter) and press Choose... in its row. The list opens in the row with the transformations that fit that type, grouped in plain words, recommended first.
- To work on several columns at once, tick their boxes: a bar says Choose for N columns. Columns that cannot be transformed, such as the target, show a note saying why and have no box.
- Under Scale numbers, pick Standardise. It is applied at once and a chip appears in the row. If an operation does not fit some of the columns, the list says so, for example For 3 of 4 columns.
- Press the chip. A panel opens with the transformation (which you can change), its settings ("?" explains each one) and Before and after, which runs the step on a real sample of your data. Read it, then press Done.
- For a category column such as
departmentorsalary, press Choose... and, under Turn categories into numbers, pick One-hot. Missing values go under Fill missing values. - Read Steps in order. Press a step to open it with Save step, Cancel and Delete step; the "..." menu moves it earlier or later, duplicates it, turns it off or deletes it (with Undo).
- Look for Suggested: in a column row. Suggestions are fixed rules computed from the data profile, not a trained model. Press "?" to read the reason, then Apply, or use Apply all N suggestions above the table; Undo takes them back.
- Open Review & run and select Check without running. Read "All good" and the number of columns that reach the models, or the steps that need a fix, each with an Open step N link. Then select Save version in the page header.
Choose... only offers transformations compatible with the column's type. Operations that combine several columns, such as Combine columns (PCA), live in Across several columns, with a Use button.
Common mistakes
- Transforming the target. The app says "left is what the models predict, so it cannot be transformed."
- Moving a step after one that already replaced the column. The message reads "Step 2 already replaced income. Move this step before it." Use Move earlier.
- A step with an empty or invalid setting: "A setting is missing or not valid." Check without running lists it with Open step N.
- Applying a numeric step to a text column: "It does not work on this type of column".
As a data scientist
Order is part of the model: fill missing values first, then scale, so that filled values are scaled with the rest. Suggestions are a starting point, not a verdict; read the reason and use Before and after to see what really changes. Every step is fitted on training rows only, so you can add steps freely without leaking test information, which is the main reason to do preparation inside the pipeline.
Checkpoint
You should see two or more transformations as chips in the Columns table, listed in Steps in order, and Check without running reports All good with the number of columns that reach the models.