Issue
When you import the library from sklearn.preprocessing import StandardScaler
, there you have three methods: fit
, transform
, and fit_transform
.
When you should apply fit
and transform
individually and when at the same time? Could you explain it through an example to clarify it?
Solution
You
fit
your training data, to generalize a model.Then you can apply that model, to any other data to get the prediction. This is like you
transform
the test data to prediction.if you do
fit_transform
, you are generalizing a model using training data, and get the result of the model over your training data.
Answered By - alift
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.