transfo_transformback | R Documentation |
transfo
.
Based on the output of transfo
, backtransform the variables to their original shape through the inverse Yeo-Johnson and/or Box-Cox transformations with the previusly estimated parameters and standardization.
transfo_transformback(Ynew, transfo.out)
Ynew |
A data matrix with d columns, which contain the variables to be backtransformed. The number of columns must be the same as the output |
transfo.out |
The output of a call to |
Returns a matrix with backtransformed variables.
J. Raymaekers and P.J. Rousseeuw
J. Raymaekers and P.J. Rousseeuw (2021). Transforming variables to central normality. Machine Learning. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10994-021-05960-5")}(link to open access pdf)
transfo
set.seed(123); x <- matrix(rnorm(2000), ncol = 2)
y <- sqrt(abs(0.3 * x[, 1] + 0.5 * x[, 2] + 4))
ty.out <- transfo(y, type = "BC")
ty.out$lambdahats
ty <- ty.out$Y
lm.out <- lm(ty ~ x)
yhat <- transfo_transformback(lm.out$fitted.values, ty.out)
plot(y, yhat); abline(0, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.