Feature scaling - only in x training?

Should I apply feature scaling only to x training or both: x and y training?
In a linear regression where for example, the prices are huge.

Thanks.
Regards.
Gus

Apply feature normalization before training.

Then to make predictions, you have to apply the same normalization, since the weights were trained on normalized data.

1 Like

But my question is: you normalize to improve the performance of the model during the training (gradient descendent and cost function calculus). During those calculus you use y values. Should y values be normalized too? Or only the features x1, x2, etc.

Suppose the price of houses is expressed in Argentinian pesos and not dollars, so a house costs 100,000,000 million pesos.

Thanks.
Gus.

Generally there is no advantage in normalizing the ‘y’ values. But it doesn’t hurt (may be helpful in Argentina!) - due to the magnitude of the currency values.

1 Like

Hello,

One more point to consider is that, when we train model with gradient decent, our errors are proportional to the scale of y, and if that is large, then errors are large, and then gradients are large. If you notice any sign of numeric overflow (like seeing some non-finite values in the updated weights or in the loss values), then normalizing y would be a good thing to try!

Cheers,
Raymond

2 Likes

This is great, thanks @rmwkwok.
Regards.
Gus

1 Like