I'm working off my first independent project for some pattern classification. I'm utilizing some datasets from UCI machine learning, but am not sure on how to start with data normalization. The data isn't that large (feature vector around 15-20 dimensions), but I'm thinking there still needs to be some type of normalization done in order for my classifiers down the line (SVM + KNN) performs properly

I guess my main question is regarding when to normalize. I currently don't have my data split between testing and training data. Thus, should I normalize all data now?

Thanks ahead of time


1 Answer 1


You should normalize your data before passing it to your SVM.

For SVM it is recommended to linearly scale each attribute to the range $[-1, +1]$ or $[0,1]$

However, it is very important that you use the same scaling factors for training and testing sets.

Suppose you scaled the training data from the range $[-10, +10]$ to $[-1, +1]$.

If a testing data attribute lies in the range $[-11, +8]$ you must scale it to $[-1.1, +0.8]$

So to answer your question:

  1. normalize your training set
  2. perform training
  3. normalize your test set using the same scaling factor as the training set
  4. perform predictions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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