asadoughi/stat-learning

Chapter 10 Question 7

Opened this issue · 1 comments

s17k commented

The solution is obviously wrong because the check at the end fails (there should be no variability in this ratio).
The reason is that "scale" in R standardizes columns, not rows (which is counter-intuitive, but they do tell us to make sure that the sd of each observation, not variable is 1).
This can be solved by running dsc = t(scale(t(USArrests))) instead of dsc = scale(USArrests)

agreed