Huzo
Huzo

Reputation: 1692

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?

Upvotes: 2

Views: 403

Answers (1)

Tim
Tim

Reputation: 10709

As you can see in the docs here you can, because fit_transform performs first a fit(), after that it applies a transform().

Upvotes: 2

Related Questions