In Kernel Principal Component Analysis (KPCA), data comes in as a $n\times d$ matrix $X$ where $n$ is the number of observations and $d$ is the number of features. The process has been explained in this answer.

After the kernel matrix is developed, an scaling process is taken place as explained by this post. Based on this, no scaling is placed until we apply the kernel and then we scale the kernel matrix.

However, don't we lose some the data this way? For example, imagine $d=3$ where we have three features. A normal data for example is $[1000, 1000000, 0.001]$. We train our KPCA model with 1000 of these normal points. When an abnormal data comes in such as $[998, 1000002, 0.009]$, the first two elements are within the acceptable range, though, the third element is 800% higher than our normal range (0.001). If we calculate the distance between this new point and our 1000 normal points, this information will be lost. For example, the distance between this new abnormal point and one of our training points is:


This distance will not be very different from a new normal point because the abnormality of the third element will become irrelevant in our distance calculation since it is so small compare to other two elements.


Now, considering all this, why shouldn't we scale our raw data before calculating the kernel matrix? Reading KPCA papers, it seems that nobody does scaling before apply the kernel matrix and I wanted to know why this is not necessary. Thanks.

  • $\begingroup$ Sure, scaling can make sense. The same considerations as in here stats.stackexchange.com/questions/53 apply. $\endgroup$ – amoeba Oct 16 '17 at 7:02
  • $\begingroup$ Then I am wondering why non of the papers I have read on KPCA don't scale the data until after using kernels. So would you recommend scaling one time before applying the kernel and another time afterwards? $\endgroup$ – ahoosh Oct 16 '17 at 12:25

Your Answer

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

Browse other questions tagged or ask your own question.