Unit 5 - sklearn.preprocessing StandardScaler function returns bad values

data_std = data-StandardScaler().fit_transform(data) seems to return values which are not bound within the [0,1] range. is this an error or am i getting something wrong?

i have written a function that seems to solve this:

def normalize_data(data):
    _data=np.array(data)
    n_data=np.zeros(np.shape(_data))
    for i in range(0, np.amin(np.shape(_data))):
        v=_data[:,i]
        n_data[:,i]=(v-np.amin(v))/(np.amax(v)-np.amin(v))
    return n_data

this function normalizes the data and sets x,y,z within [0,1] range.

Hello @lior ,

You are right, this section is a little bit confusing. We have updated the contents of section 5.2 in order to clarify it. Please have a look to the updated section and let us know if it is now more clear.

Many thanks for your feedback.