2

Alright so i have found this really good answer on how to normalize my data.

I implemented @user25658 's code into my own project successfully, trained a linear model and used it to make a prediction.

Say y = 0.4513869 is the predicted normalized value which i would like to de-normalize.

Based on the normalization code below, how can i achieve this?

normalized = (x-min(x))/(max(x)-min(x))

1 Answers1

4
denormalized = (normalized)*(max(x)-min(x))+min(x)

e.g.

x=1:5
x
#[1] 1 2 3 4 5

normalized = (x-min(x))/(max(x)-min(x))
normalized
#[1] 0.00 0.25 0.50 0.75 1.00

denormalized = (normalized)*(max(x)-min(x))+min(x)
denormalized
#[1] 1 2 3 4 5
Csislander
  • 158
  • 1
  • 6