Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


DMwR (version 0.4.1)

unscale: Invert the effect of the scale function

Description

This function can be used to un-scale a set of values. This unscaling is done with the scaling information "hidden" on a scaled data set that should also be provided. This information is stored as an attribute by the function scale() when applied to a data frame.

Usage

unscale(vals, norm.data, col.ids)

Arguments

vals
A numeric matrix with the values to un-scale
norm.data
A numeric and scaled matrix. This should be an object to which the function scale() was applied.
col.ids
The columns of the vals matrix that are to be un-scaled (defaults to all of them).

Value

An object with the same dimension as the parameter vals

References

Torgo, L. (2010) Data Mining using R: learning with case studies, CRC Press (ISBN: 9781439810187).

http://www.dcc.fc.up.pt/~ltorgo/DataMiningWithR

See Also

scale

Examples

Run this code
data(algae)
normData <- scale(algae[,4:12])
t <- rpartXse(a1 ~ .,as.data.frame(normData[1:100,]))
normPs <- predict(t,as.data.frame(normData[101:nrow(normData),]))
ps <- unscale(normPs,normData)
## Not run: 
#  plot(algae[101:nrow(algae),'a1'],ps)
# ## End(Not run)

Run the code above in your browser using DataLab