0
$\begingroup$

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

$\endgroup$
0
$\begingroup$

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
$\endgroup$

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.