FunctionRacerProblemsRace

Same Scale

Beginnerscikit-learnPython

The columns of X are measured in very different units. Return X with every column standardized: shifted to mean 0 and scaled to standard deviation 1.

Example 1

X [[1,100],[2,200],[3,300]]
returns [[-1.224744871391589,-1.224744871391589],[0.0,0.0],[1.224744871391589,1.224744871391589]]

Both columns become -1.22, 0, 1.22: once standardized they are the same.

Example 2

X [[0,5],[10,5]]
returns [[-1.0,0.0],[1.0,0.0]]

A column that never changes becomes all zeros.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More scikit-learn problems