educative.io

Scaling makes columns the same?

In the Scaling section for ‘Data Analysis and Visualization’ course, we start with a matrix of data as such:
data = [[-1, 2],
[-0.5, 6],
[0, 10],
[1, 18]]

After the program runs
standard = StandardScaler()
standard_data = standard.fit_transform(data)

The new standard_data matrix is
[[-1.18321596 -1.18321596]
[-0.50709255 -0.50709255]
[ 0.16903085 0.16903085]
[ 1.52127766 1.52127766]]

The two columns of data are now the same - but shouldn’t column b remain different from column a since the original data columns are different as well? Or am I misunderstanding the purpose of the standard scaling method.

I didn’t change any code in the exercise area except adding a print line to show what standard_data is after the transformation.


Type your question above this line.

Course: https://www.educative.io/collection/5757739470946304/5476264494235648
Lesson: https://www.educative.io/collection/page/5757739470946304/5476264494235648/6614589761388544

Hi @will_c,

Yeah, you’re right, but not in all cases. For this specific data, it will return the same values, but if you’ve any other data value, i.e., data = [[-1, 2],
[-0.5, 6],
[0, 18],
[1, 18]]
it will give the different column values.

1 Like

Ah I see now. Playing with that and actually doing a couple of the calculations makes that much clearer. Thank you!

1 Like