1
$\begingroup$

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))

$\endgroup$
2
$\begingroup$
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
$\endgroup$

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.