1
$\begingroup$

My question is regarding the normalization or standarization of a dataset that currently has a specific Min and Max value but it is previously known that it might vary and have a lower Min and/or a higher Max. I am not sure what is the best practising here.

More precisely:

I have a dataset which contains values (features that come from a time series problem rephrased as a supervised problem) that currently vary from 18-22 more or less. I normalize the values with a standard MinMaxScaler BUT to the min and max values I say they are 0 and 100, because I know that for future trainings of the model, these values might appear. Now, here is the thing, I am not sure if the predictions of my model are corrent regarding this normalization.

Should I perform the normalization on the current values or should I keep training with a normalization for future values?

Thanks and regards!

$\endgroup$
1
$\begingroup$

Whether this makes a difference, and how, will depend on the classifier you are using. For example, using a decision tree based model, or a simple linear model, scaling doesn't make any difference. If you are using some kind of regularized model, such as Ridge, some form of a bayesian model or a neural network, then scaling may affect your performance.

Now in general, your model predictions are never "correct". They may be reasonable, based on your model and the assumption that model makes, but also based on the expectation that your training data will be representative of the data you will encounter later.

Those are general remarkts, but I think they are important to keep in mind here. Now, more specifically, it is a bit unclear what you mean when you say

"because I know that for future trainings of the model, these values might appear"

If you are retraining the model, you should also refit the MinMaxScaler and it will adapt to new values. Then the above doesn't really apply and the best practice is to refit the feature processing with the new data. scikit-learn has a great system for this called the pipeline, and the documentation may be helpful in any case, see https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html.

If you are not retraining the model, then you are saying that new data may not look like your testing data at all, and how bad that's going to affect your performance, as said before, will depend on a lot of things and may be hard to assess anyway. Maybe the feature that you are scaling is not important, and then it makes almost no difference. Maybe it's the only really important feature and you are using some nonlinear transformation of it (a squared feature that was in the range 0-1 now has a value 1000) and it will completely 0mess up the results of your classifier.

I think what you should do, in the face of changing data, is retrain the model on a regular basis, including the scaling part, and monitor it's performance.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for the answer! I am actually retraining the model when new data arrives, and this data might have new min and max values than the data I have to first train the model. But It will always be in the range 0,100 and that's why i decided to scale this way instead of normal MinMax. I am using in fact keras-tensorflow so i guess this scaling is affecting my performance in a hard way, based on your answer. $\endgroup$ – Adrián Arroyo Perez Nov 22 '18 at 10:24
  • $\begingroup$ Then I think anticipating the new min and max values makes sense, allthough it is more customary to let the training data decide the min and max and scale based on that. Perhaps switch to that system when you have more data. $\endgroup$ – Gijs Nov 22 '18 at 10:26
  • $\begingroup$ Having more data is not a guarantee now, so I will try to let the training decide min and max. Thank you! $\endgroup$ – Adrián Arroyo Perez Nov 22 '18 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.