Monday, March 30, 2020

Answer for Question about Scaler.fit(x) and Scaler.transform()

https://365datascience.com/dwqa-answer/answer-for-question-about-scaler-fitx-and-scaler-transform/ -

Hi Kam, 

to answer your question, when you have new data you’ll just need to use transform on it.


  1. We fit the data, so we determine the mean and standard deviation for the variables.

  2. We transform our data, that is we substract the mean and divide by the standard deviation. So we ‘standardize’ our data.

  3. When new data comes in, we transform it (or ‘standardize’ it) with the standard scaler we’ve already got. 

You can think of it similarly to fitting a new model. We have train data where we fit the model and determine the coefficients. Then, we transform our data. (There a few additional steps here, like testing, cross-validation, etc.)

Now, whenever we obtain new data, we won’t fit the model again, as we’ve already trained it. All we need is to use our already trained model and use it to transform the new data. 

Hope this makes things a bit clearer! And this is a confusing topic, especially if you’re seeing it for the first time. So, don’t worry if takes a little time to settle in. 🙂 

 

Best, 

Eli




#365datascience #DataScience #data #science #365datascience #BigData #tutorial #infographic #career #salary #education #howto #scientist #engineer #course #engineer #MachineLearning #machine #learning #certificate #udemy

No comments:

Post a Comment