First, the key terms.
- Join key
- A field or set of fields used to connect records.
- Feature
- An input representation available to the model at prediction time.
- Imputation
- Replacing missing values under an explicit method and assumptions.
The idea, explained
The data-to-insight pipeline includes definitions, joining, cleaning, transformation, exploration, modeling and communication. A spreadsheet or visual analytics tool can make transformations easy to apply, but it can also hide incorrect joins or implicit conversions. Missingness, duplicates, units and outliers need explicit policies. Feature selection should respect prediction time and be performed within a proper evaluation pipeline. A highly predictive variable may be a leak, a proxy for a protected characteristic or a consequence rather than a cause.
Establish provenance and row meaning
Record where each field came from, its units and update timing. A join from one customer to many transactions changes row count; an unintended many-to-many join can multiply observations. Check counts and totals before and after every major transformation.
Transform with a rationale
Choose missing-value treatments, scaling, encoding and derived features to match the task. Do not interpret a missing purchase amount as zero by default. Fit learned preprocessing on training data, then apply it consistently to evaluation data.
Use tools transparently
In Excel, keep raw inputs distinct from calculated columns, document formulas and check filters. Analytic Solver can fit models and compare results; Power Query can record preparation steps. Version features and verify their availability in the deployed workflow.
Follow a worked example.
A fictional churn table joins customer records with support tickets. Customer A has three tickets, so the join creates three rows for that person. A naïve model split can then place the same customer in training and testing.
Walk it through, one step at a time
- Confirm whether the intended prediction unit is a customer or a ticket. If customer-level, aggregate ticket features at an appropriate cutoff date.
- Create features such as ticket count before the prediction date, not a later cancellation flag.
- Split by customer and time where appropriate. Compare the resulting honest score with the earlier inflated result, explaining why a lower number can be more credible.
Where people get stuck
Automated feature selection cannot determine whether data use is lawful, fair or available at the moment an operational decision must be made.
Now try it yourself.
1. Check the core idea
Why should you inspect row counts after a join?
Reveal the answer & reasoning
A join can duplicate, omit or multiply records depending on key uniqueness. Those changes can distort summaries, targets and model evaluation.
2. Apply what you learned
Should an outlier always be capped before training?
Reveal the answer & reasoning
No. Check whether it is an error, a legitimate rare case or an important risk. The treatment should be justified and tested rather than chosen to improve a headline score.