Invert the effect of the scale function

Share:

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

1
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

Author(s)

Luis Torgo ltorgo@dcc.fc.up.pt

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

1
2
3
4
5
6
7
8
9
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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.