6
$\begingroup$

I estimated a Partial Least Squares model where the X matrix had normalized columns. Now I want to predict the value for a new instance (which is a frequency vector summing to one.) I assume that if I just use the raw frequency values, the predicted value won't be on the same scale as the scenario where my 'new' instance was taken from the normalized X matrix. (i.e. Comparing the fitted values of the model with predicted value of new instance.)

I was thinking of adding the new instance as the bottom row of the original non-normalized X matrix, normalizing, and then using the values from this new bottom row to predict.

Alternatively, I could standardize by using the column means and standard deviations from the original non-normalized X.

Is one method preferred to the other? Is there a better way?

$\endgroup$
2
$\begingroup$

The normalization takes place with following steps:

  1. The mean of each variable is subtracted from that variable.
  2. Each variable is then divided by the standard deviation(stddev) of that variable

So you have mean and stddev from the unnormalized X. The most common way is to use this mean and stddev to normalize the new data with the same steps but on your new data to be predicted. Thus, your last suggestion is both correct and common.

In addition, you can also add intercept term to the BETA matrix/vector obtained from PLS model that would represent the mean-centering step. Additionally, you can also recalculate the BETA once more to give the division with stddev effect.

Adding new data to the training set (your original X matrix) and then normalizing it, however, is not a correct way. This makes the scaling and more importantly your mean, which acts like an intercept term, dependent to the training data AND your new data combined. It would lead to unreliable results. You can also test and see these two methods produce different results.

$\endgroup$
  • $\begingroup$ +1 (and in general thanks for answering a lot of old PLS questions). But could you please make it more explicit in your answer which alternative suggested by the OP is better: the one in 2nd or in the 3rd paragraph in the question. The 2nd is wrong and the 3rd is correct, so it's good to be very explicit about it. $\endgroup$ – amoeba says Reinstate Monica Jan 26 '17 at 9:08
  • $\begingroup$ Answer updated accordingly. Thanks for the good advice. $\endgroup$ – theGD Jan 26 '17 at 9:23

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.