Do you apply min max scaling separately on trainin

2019-03-27 09:11发布

问题:

While applying min max scaling to normalize your features, do you apply min max scaling on the entire dataset before splitting it into training, validation and test data?

Or do you split first and then apply min max on each set, using the min and max values from that specific set?

Lastly , when making a prediction on a new input, should the features of that input be normalized using the min, max values from the training data before being fed into the network?

回答1:

Split it, then scale. Imagine it this way: you have no idea what real-world data looks like, so you couldn't scale the training data to it. Your test data is the surrogate for real-world data, so you should treat it the same way.

To reiterate: Split, scale your training data, then use the scaling from your training data on the testing data.