FunctionRacerProblemsRace

No Peeking

Mediumscikit-learnPython

Test rows must stay unseen, even by the scaler: if their mean and spread leak into the scaling, the test is no longer honest. Standardize X_test using the mean and standard deviation of each column of X_train only, and return the result.

Example 1

X_train [[0],[10]]
X_test [[5],[20]]
returns [[0.0],[3.0]]

The training column has mean 5 and standard deviation 5, so 5 becomes 0 and 20 becomes 3.

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