Solved – Denormalize value after prediction

normalization

I don't know how to denormalize (0-1 normalized) data after prediction. I have 1 output and several input values. It's clear for 1 input I must use min and max value previously used for normalization.

But what should I do if for normalizing, each input was normalized separately, using its own min and max value?

Does anyone have any ideas?

Best Answer

You have n inputs and 1 output. What you need is comparing the predicted results $\hat y$ (a vector as long as the number of your test rows) with the real results $y$ (a vector as long as $\hat y$). Originally you had normalized the original data set using the min-max normalization through $\min Y$ and $\max Y$ (the min and max numbers assumed by the data output).

In order to evaluate your model you need to denormalize only the outputs. Since $\hat y_\text{norm}$ is the normalized test output you can do:

$$ \hat y = \hat y_\text{norm} \times (\max Y - \min Y) + \min Y $$

Then you'll compare $\hat y$ with $y$.

Related Question