Code Room
Code reviewMedium
Question
Review this Python feature-normalization function.
Downstream models trained on this perform worse than on raw features. What's the bug?
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
import numpy as np def normalize_features(X): # X shape: (n_samples, n_features); scale each FEATURE to mean 0, std 1 mean = X.mean(axis=1, keepdims=True) std = X.std(axis=1, keepdims=True) return (X - mean) / stdRun or narrate your approach, then ask the coach.