| Title: | Various Preprocessing Transformations of Numeric Data Matrices |
|---|---|
| Description: | Preprocess numeric data matrices into desired transformed representations. Standardization, Unitization, Cubitization and adaptive intervals are offered. |
| Authors: | Swamiji Pravedson |
| Maintainer: | Swamiji Pravedson <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-06-02 10:00:58 UTC |
| Source: | https://github.com/cran/PreProcessing |
Cubitizes the matrix given as input
cubitize(xx)cubitize(xx)
xx |
Matrix or a data frame of numeric entries |
Matrix with columns that have minimum zero and maximum one
## Not run: # I don't want you to run this ## End(Not run) n<-450; x <- data.frame(cbind(rnorm(n, 162, 4), rnorm(n, 108, 2), rnorm(n, 117, 3), rnorm(n, 36, 2), rnorm(n, 45, 2))) p <- ncol(x) x.cube <- cubitize(x) round(head(x),2) round(head(x.cube),2) round(rbind(apply(x, 2, min), apply(x.cube, 2, min)),2) round(rbind(apply(x, 2, max),apply(x.cube, 2, max)),2) oldpar<-par(mfrow=c(1,2)) boxplot(x[,1:min(5,p)], main='Original Data', col=rainbow(9)) boxplot(x.cube[,1:min(5,p)], main='PreProcessed Data', col=rainbow(7)) par(oldpar)## Not run: # I don't want you to run this ## End(Not run) n<-450; x <- data.frame(cbind(rnorm(n, 162, 4), rnorm(n, 108, 2), rnorm(n, 117, 3), rnorm(n, 36, 2), rnorm(n, 45, 2))) p <- ncol(x) x.cube <- cubitize(x) round(head(x),2) round(head(x.cube),2) round(rbind(apply(x, 2, min), apply(x.cube, 2, min)),2) round(rbind(apply(x, 2, max),apply(x.cube, 2, max)),2) oldpar<-par(mfrow=c(1,2)) boxplot(x[,1:min(5,p)], main='Original Data', col=rainbow(9)) boxplot(x.cube[,1:min(5,p)], main='PreProcessed Data', col=rainbow(7)) par(oldpar)
Intervalizes the matrix given as input
intervalize(xx, a = -1, b = 1)intervalize(xx, a = -1, b = 1)
xx |
Matrix or a data frame of numeric entries |
a |
lower bound of the target interval |
b |
upper bound of the target interval |
Matrix with columns that have minimum zero and maximum one
## Not run: # I don't want you to run this ## End(Not run) n<-450; x <- data.frame(cbind(rnorm(n, 162, 4), rnorm(n, 108, 2), rnorm(n, 117, 3), rnorm(n, 36, 2), rnorm(n, 45, 2))) p <- ncol(x) x.inter <- intervalize(x,a=-1,b=1) round(head(x),2) round(head(x.inter),2) round(rbind(apply(x, 2, min), apply(x.inter, 2, min)),2) round(rbind(apply(x, 2, max),apply(x.inter, 2, max)),2) oldpar<-par(mfrow=c(1,2)) boxplot(x[,1:min(5,p)], main='Original Data', col=rainbow(9)) boxplot(x.inter[,1:min(5,p)], main='PreProcessed Data', col=rainbow(7)) par(oldpar)## Not run: # I don't want you to run this ## End(Not run) n<-450; x <- data.frame(cbind(rnorm(n, 162, 4), rnorm(n, 108, 2), rnorm(n, 117, 3), rnorm(n, 36, 2), rnorm(n, 45, 2))) p <- ncol(x) x.inter <- intervalize(x,a=-1,b=1) round(head(x),2) round(head(x.inter),2) round(rbind(apply(x, 2, min), apply(x.inter, 2, min)),2) round(rbind(apply(x, 2, max),apply(x.inter, 2, max)),2) oldpar<-par(mfrow=c(1,2)) boxplot(x[,1:min(5,p)], main='Original Data', col=rainbow(9)) boxplot(x.inter[,1:min(5,p)], main='PreProcessed Data', col=rainbow(7)) par(oldpar)
This function takes as input a matrix of numeric values and then transforms it so that each column has a mean of zero and a variance of one
standardize(xx)standardize(xx)
xx |
Matrix or a data frame of numeric entries |
Matrix with columns that have mean zero and variance one
## Not run: # I don't want you to run this ## End(Not run) n<-450; x <- data.frame(cbind(rnorm(n, 162, 4), rnorm(n, 108, 2), rnorm(n, 117, 3), rnorm(n, 36, 2), rnorm(n, 45, 2))) p <- ncol(x) x.stan <- standardize(x) round(head(x),2) round(head(x.stan),2) round(rbind(apply(x, 2, mean), apply(x.stan, 2, mean)),2) round(rbind(apply(x, 2, sd),apply(x.stan, 2, sd)),2) oldpar <- par(mfrow=c(1,2)) boxplot(x[,1:min(5,p)], main='Original Data', col=rainbow(9)) boxplot(x.stan[,1:min(5,p)], main='PreProcessed Data', col=rainbow(7)) par(oldpar)## Not run: # I don't want you to run this ## End(Not run) n<-450; x <- data.frame(cbind(rnorm(n, 162, 4), rnorm(n, 108, 2), rnorm(n, 117, 3), rnorm(n, 36, 2), rnorm(n, 45, 2))) p <- ncol(x) x.stan <- standardize(x) round(head(x),2) round(head(x.stan),2) round(rbind(apply(x, 2, mean), apply(x.stan, 2, mean)),2) round(rbind(apply(x, 2, sd),apply(x.stan, 2, sd)),2) oldpar <- par(mfrow=c(1,2)) boxplot(x[,1:min(5,p)], main='Original Data', col=rainbow(9)) boxplot(x.stan[,1:min(5,p)], main='PreProcessed Data', col=rainbow(7)) par(oldpar)
Unitizes the matrix given as input
unitize(xx)unitize(xx)
xx |
Matrix or a data frame of numeric entries |
Matrix with columns that have mean zero and length one
## Not run: # I don't want you to run this ## End(Not run) n<-450; x <- data.frame(cbind(rnorm(n, 162, 4), rnorm(n, 108, 2), rnorm(n, 117, 3), rnorm(n, 36, 2), rnorm(n, 45, 2))) p <- ncol(x) x.unit <- unitize(x) round(head(x),2) round(head(x.unit),2) round(rbind(apply(x, 2, mean), apply(x.unit, 2, mean)),2) round(rbind(apply(x, 2, sd),apply(x.unit, 2, sd)),2) oldpar<-par(mfrow=c(1,2)) boxplot(x[,1:min(5,p)], main='Original Data', col=rainbow(9)) boxplot(x.unit[,1:min(5,p)], main='PreProcessed Data', col=rainbow(7)) par(oldpar)## Not run: # I don't want you to run this ## End(Not run) n<-450; x <- data.frame(cbind(rnorm(n, 162, 4), rnorm(n, 108, 2), rnorm(n, 117, 3), rnorm(n, 36, 2), rnorm(n, 45, 2))) p <- ncol(x) x.unit <- unitize(x) round(head(x),2) round(head(x.unit),2) round(rbind(apply(x, 2, mean), apply(x.unit, 2, mean)),2) round(rbind(apply(x, 2, sd),apply(x.unit, 2, sd)),2) oldpar<-par(mfrow=c(1,2)) boxplot(x[,1:min(5,p)], main='Original Data', col=rainbow(9)) boxplot(x.unit[,1:min(5,p)], main='PreProcessed Data', col=rainbow(7)) par(oldpar)