Python Forum
Scaler fit with different colums
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scaler fit with different colums
#1
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)
Larz60+ write Jan-10-2021, 10:44 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use code tags on future posts.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Question on pandas.dataframe merging two colums shomikc 4 847 Jun-29-2023, 11:30 AM
Last Post: snippsat
  Running Standard Scaler in Python 3 Led_Zeppelin 1 1,287 Sep-05-2022, 06:35 PM
Last Post: deanhystad
Photo Creating column in python based on the other colums value count Bartek635 2 2,953 Apr-15-2021, 03:47 PM
Last Post: Bartek635
  How to update only two colums in database from csv without touching data in other col Prince_Bhatia 0 2,285 Aug-21-2018, 09:13 AM
Last Post: Prince_Bhatia

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020