Analytics & ML · Study deck
Feature Scaling and Leakage Controls
A feature-scaling model sees battery voltage near 3.7 and packet count near 20,000, even though both columns describe the same device leakage-control window.
Data Dora is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Explain why large-magnitude sensor units distort distance and gradient-based models.
- Choose min-max, z-score, or robust scaling based on feature shape and model needs.
- Store scaler parameters as part of a reproducible training and inference artifact.
- Prevent train/test leakage by fitting scalers on training data only.
Major section
Fit the Scaling Rule Without Seeing Tomorrow
The fit arrow must use training data only.
- Validation, test, and production records pass through the stored transformation; they do not change its mean, spread, minimum, or maximum.
- Min-max scaling uses (x'=(x-3.4)/(3.8-3.4)).
- The 3.6 V value becomes (0.2/0.4=0.5).
Major section
Fit the Scaling Rule Without Seeing Tomorrow (continued)
The method must match the feature and feature-scaling model; “normalized” is not a complete recipe.
- A later test reading of 4.0 V becomes (0.6/0.4=1.5), which is outside the training range but honest.
- Z-score scaling uses a training mean and standard deviation.
- Leakage can enter before scaling.
Major section
Fit the Scaling Rule Without Seeing Tomorrow (continued)
Robust scaling instead uses a median and interquartile range, which can reduce the influence of extreme values.
- A rolling average that includes samples after the prediction time gives the feature-scaling model knowledge of the future.
- A random split can place windows from the same device session on both sides.
- A maintenance label copied into a feature is direct answer leakage.
Major section
Fit the Scaling Rule Without Seeing Tomorrow (continued)
If a production feature falls far beyond the training range, log it as a monitoring fact rather than clipping it silently unless clipping was an explicit, tested rule.
- A scaled value helps the feature-scaling model, but an operator needs the original unit and range when investigating an alert.
- A correct feature-scaling model paired with another training run's parameters can produce wrong scores while every file loads successfully.
- Refitting with 4.0 V would pull that test point to 1.0 and allow test information to alter evaluation.
Major section
Start With the Story
One column holds small decimals and another holds large counts.
- The data owner must make their scales fair without learning from the cases reserved to judge the model.
- A remote review can compare fleets, but the released local rule needs its own version and safe fallback.
- This opening does not choose every scaling method or prove model quality.
Major section
Feature Scales Distort Models
The numbered pipeline separates raw observations, window construction, feature extraction, and normalization, so parameters fitted at the wrong boundary are easier to spot.
- Windowing fixes which samples contribute to a training example; extraction gives each feature a physical meaning and unit; normalization changes scale but should not change that meaning.
Deck summary
Key takeaways
The fit arrow must use training data only.
- The method must match the feature and feature-scaling model; “normalized” is not a complete recipe.
- Robust scaling instead uses a median and interquartile range, which can reduce the influence of extreme values.
- If a production feature falls far beyond the training range, log it as a monitoring fact rather than clipping it silently unless clipping was an explicit, tested rule.
- One column holds small decimals and another holds large counts.
Retrieval practice
Recall check 1 of 3

Data Dora says: answer from memory, then check your reasoning.
Q1Why do many ML algorithms need features scaled to comparable ranges?
Show answer
Answer: C Without scaling, unit magnitude, not importance, drives many algorithms.
Retrieval practice
Recall check 2 of 3

Data Dora says: answer from memory, then check your reasoning.
Q2With mean = 30 and std = 8, what is the z-score standardised value of a raw reading of 46?
Show answer
Answer: A Subtract the mean, then divide by the standard deviation; the reading is two standard deviations above the mean.
Retrieval practice
Recall check 3 of 3

Data Dora says: answer from memory, then check your reasoning.
Q3Why must a scaler's parameters (e.g. mean and std) be computed from the training set only, not the full dataset?
Show answer
Answer: A Train-only fitting prevents leakage and keeps evaluation representative of deployment, where future data statistics are unknown.
Print reference
Answers
Answer key.
- C · Without scaling, unit magnitude, not importance, drives many algorithms.
- A · Subtract the mean, then divide by the standard deviation; the reading is two standard deviations above the mean.
- A · Train-only fitting prevents leakage and keeps evaluation representative of deployment, where future data statistics are unknown.