Python Forum

Full Version: Scaler fit with different colums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi, i just want to learn differences between scalar.fit command with differant coulumns
becuse in general programmers use just fit with 1 column and transform it all the others. i dont understand the point. thank you
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
scaler2 = MinMaxScaler()
scaler3 = MinMaxScaler()
#programmers use this, why transform x_test to x_test2 with "scaler.fit(x_train)"
scaler.fit(x_train)
x_train = scaler.transform(x_train)
x_test2 = scaler.transform (x_test)

#i think this one better but i dont know why pros didnt use it?
scaler2.fit(x_test)
x_test3=scaler2.transform(x_test)