Standardize features to zero mean and unit variance.
z=σx−μwith μ mean and σ standard deviation.
Input: X = np.array([[1,2],[3,6],[5,10]])
Output: Standardized columns (mean≈0, std≈1)
Use np.mean() and np.std() with the appropriate axis and keepdims=True.
Use std + eps in the denominator to avoid division by zero when standard deviation is 0.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number
Standardize features to zero mean and unit variance.
z=σx−μwith μ mean and σ standard deviation.
Input: X = np.array([[1,2],[3,6],[5,10]])
Output: Standardized columns (mean≈0, std≈1)
Use np.mean() and np.std() with the appropriate axis and keepdims=True.
Use std + eps in the denominator to avoid division by zero when standard deviation is 0.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number