Exercise 3: Why Scaling Is Stricter for K-Means Than for Regression Coefficients — Possible Solution ==================================================================== WHY ml1-3 NEEDED SCALING, PER THAT CHAPTER'S OWN REASONING ------------------------------ Per ml1-3, standardization was needed there so that coefficient SIZES could be fairly COMPARED against each other — without it, mileage's own raw coefficient and year's own raw coefficient would simply be measured in different, incompatible units, making a size comparison meaningless. Crucially, the model would still fit and produce valid predictions even without scaling — scaling in ml1-3's own case existed purely to make the resulting coefficients INTERPRETABLE relative to each other, not to make the underlying predictions themselves valid. WHY K-MEANS NEEDS SCALING FOR A DIFFERENT, STRICTER REASON ------------------------------ Per this chapter, "the algorithm's own 'nearest centroid' step is a literal distance calculation. Left unscaled, salary (tens of thousands) would swamp years_at_company (single digits) in every distance computation, and the resulting clusters would essentially just be salary bands wearing three other features' names." K-means's entire clustering mechanism — deciding which centroid each point is "nearest" to — depends directly on computing an actual numeric distance between points using their raw feature values. If salary's own raw values are in the tens of thousands while years_at_company's own raw values are single digits, the distance calculation is overwhelmingly dominated by salary differences alone, regardless of how similar or different two employees actually are on the other features. WHY THIS MEANS THE RESULT ITSELF, NOT JUST ITS INTERPRETATION, IS AT STAKE ------------------------------ In ml1-3's case, an unscaled model still produces genuinely correct predictions — only the RELATIVE comparison between coefficients is compromised without scaling. In k-means's case, per this chapter, an unscaled clustering would produce clusters that are, for all practical purposes, just salary bands — the algorithm would still run and produce an output, but that output would fail to reflect genuine similarity across all three features at all, effectively ignoring age and years_at_company almost entirely in favor of whichever feature happens to have the largest raw numeric scale. The clustering RESULT itself becomes essentially meaningless without scaling, not merely harder to interpret. WHY THIS JUSTIFIES CALLING IT "A STRICT NECESSITY" RATHER THAN "A NICETY" ------------------------------ Per this chapter, "scaling here isn't a nicety for readability — it determines whether the clustering result means anything at all." Since scaling in ml1-3 only affected how easily a human could compare coefficients (an interpretability convenience), while scaling in this chapter determines whether the algorithm's own core distance-based mechanism actually considers all three features in a balanced way (a correctness requirement), the two cases genuinely differ in stakes — one is about making a correct result easier to read, the other is about whether the result reflects the intended comparison at all. WHY THIS WORKS AS AN ANSWER ------------------------------ It contrasts precisely what scaling accomplishes in ml1-3 (fair comparison of otherwise-valid coefficients) against what it accomplishes here (making the algorithm's own core distance calculation consider all features at all), explaining why the chapter treats the second case as a strict necessity rather than a mere interpretability convenience.