Answered step by step
Verified Expert Solution
Question
1 Approved Answer
**Write simple code from scratch to standardize data (feature scaling) in Python** **library sklearn cannot be used for this problem** Given a an ndarray: X
**Write simple code from scratch to standardize data (feature scaling) in Python**
Givena X X2 50 20 30 30 90 50 column means = [ 33.33 56.66 2. column standard deviation - (15.27 30.55 ] X 50-33.33 15.27 30-56.66 30.55 1.09 -0.87 -0.87 1.09 L-0.21 0.21 20-333 15.27 90-56.66 30.55 30 - 33.33 15.29 50 - 56.66 30.55 **library sklearn cannot be used for this problem**
Given a an ndarray:
X = np.array([[50, 30], [20, 90], [30, 50]])
1. Calculate the means for each column. The output should be an array with the shape of (2, 1).
2. Calculate the standard deviation for each column. The output should be an array with the shape of (2, 1).
3. For each value, subtract it from the corresponding mean and divide by the corresponding standard deviation. The output should return the 3x3 matrix as shown in the image.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started