简体   繁体   中英

Can we use .fit_transform() directly?

from sklearn.preprocessing import MinMaxScaler()
scaler = MinMaxScaler()

can I directly do:

scaled_data = scaler.fit_transform(mymatrix)

without doing scaler.fit(mymatrix) first?

If not, why so? What is the difference? Doesnt scaler.fit_transform() function already compute the variance and mean values too before transforming?

正如您在此处的文档中所见,您可以,因为fit_transform首先执行fit(),然后再应用transform()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM