# Scaling and Normalization of Predicted Data

Can someone help?

I am trying to mimic the Rossmann data approach but my sales data has negative numbers and zeros.

so I first tried adding the minimum + 1 to the prediction eg sales

Although the training loss, validation loss and exp_rmspe is great < 1 the prediction results after trying to rescale are awful.

For example The prediction gives me x and y of x=999360.5 Y=1051301 a x/y of 0.94
but when I rescale. eg

(abs(MIN_SALES) + 1) = 1032401

x = x - (abs(MAX_SALES)+1) and y = y - (abs(MAX_SALES)+1)
The x, y results become x= -33040.5 and y=18900.
The y is the correct sales but the x predictions is nowhere close

I then tried pre normalizing the Sales data and then denormalizing the predictions but similar awful results.
Note that initially it would even run the learning rate but when I used y_range=None it got seemingly fantastic results of 0.03.
Eg
np.exp(x) and np.exp(y) are 0.28602 and 0.27884 and looks closebut after denomarlized
denormalize(np.exp(x[0]),-1032400, 2737800) = 45957.13881 which is an awful prediction
denormalize(np.exp(y[0]),-1032400, 2737800) = 18900.00426 which is the correct sales

my normalize and denormalize functions are below.

Any suggestions? Unfortunately my Math is quite weak.

def normalize(value, min, max):
normalized = (value - min) / (max - min);
return normalized;

def denormalize(normalized, min, max):
denormalized = (normalized * (max - min) + min);
return denormalized;