Topics / 🤖 AI & Machine Learning / 🧮 Level 20: NumPy & Maths for ML

Python exercise · about 5 minutes · free

Standardise Features

Credit scores are in hundreds, ratios in fractions. Many models need features on the same scale.

Standardising: z = (x − mean) ÷ std, per column. Afterwards each column has mean 0 and standard deviation 1.

Flow: raw features (score ~700, ratio ~0.4) → (x − mean) / std → same scale (mean 0, std 1)raw featuresscore ~700, ratio ~0.4(x − mean) / stdsame scalemean 0, std 1
Your quest: Set Z to the column-wise standardised version of X.
Try it now Runs in your browser. No sign-in needed. Ctrl+Enter to run.
HintZ = (X - X.mean(axis=0)) / X.std(axis=0)
Output appears here.

Open it in the full course → Free with Google: saves your progress and unlocks 627 lessons.

In this level you'll learn:
More in Level 20: NumPy & Maths for ML

Share on LinkedIn