Reputation: 309
I am fairly new to data modelling and R, I wonder if anyone could give me some advice.
I am using R to replicate a model I have built in SPSS modeller with the view of then trying to improve it. Currently I am building a basic linear model using the caret package.
I have used preProcess() to scale and centre my numeric fields, including the numeric variable which the model is predicting.
preProcValues <- preProcess(Data_Numeric, method = c("center", "scale"))
Data_PreProc <- predict(preProcValues, Data_Numeric)
When I produce the model I find that this pre-processing results in a more accurate model, however, I am unsure how to take the scaled and centred result and get a 'result'. The model is used as a pricing tool so I need to unscale and centre it if that makes sense?
Upvotes: 3
Views: 4046
Reputation: 1417
For centering
, the sample mean is subtracted while the centered values are divided by the standard deviation for scaling
.
It'd be easily recovered from the following relationships.
Upvotes: 5