Difficulty: Medium Tags: Data Science, Preprocessing, Statistics
A pricing model standardizes numeric features using training-set statistics. A bug recomputes the mean and variance from the test batch, leaking evaluation information. For this task, training statistics are supplied and must be applied unchanged to the test values.
Given training mean mu, population standard deviation sigma, and
test feature values x_i:
z_i = (x_i - mu) / sigma
If sigma == 0, every output is 0. Statistics are never estimated
from the test values.
values (list of floats), mu (float), sigma (float, >= 0).
List of standardized values (6 decimal places).
1 <= n <= 10^5, all magnitudes at most 10^9, sigma >= 0.Input
values = [8, 10, 14], mu = 10, sigma = 2
Output
[-1.000000, 0.000000, 2.000000]
Explanation: Use the fixed training mean 10 and standard deviation 2 for every test value.
No results yet
Run your code to check it against the examples, or submit to run every test.