1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/inverse.R
3\name{step_inverse}
4\alias{step_inverse}
5\title{Inverse Transformation}
6\usage{
7step_inverse(
8  recipe,
9  ...,
10  role = NA,
11  offset = 0,
12  trained = FALSE,
13  columns = NULL,
14  skip = FALSE,
15  id = rand_id("inverse")
16)
17}
18\arguments{
19\item{recipe}{A recipe object. The step will be added to the
20sequence of operations for this recipe.}
21
22\item{...}{One or more selector functions to choose variables
23for this step. See \code{\link[=selections]{selections()}} for more details.}
24
25\item{role}{Not used by this step since no new variables are
26created.}
27
28\item{offset}{An optional value to add to the data prior to
29logging (to avoid \code{1/0}).}
30
31\item{trained}{A logical to indicate if the quantities for
32preprocessing have been estimated.}
33
34\item{columns}{A character string of variable names that will
35be populated (eventually) by the \code{terms} argument.}
36
37\item{skip}{A logical. Should the step be skipped when the
38recipe is baked by \code{\link[=bake.recipe]{bake.recipe()}}? While all operations are baked
39when \code{\link[=prep.recipe]{prep.recipe()}} is run, some operations may not be able to be
40conducted on new data (e.g. processing the outcome variable(s)).
41Care should be taken when using \code{skip = TRUE} as it may affect
42the computations for subsequent operations.}
43
44\item{id}{A character string that is unique to this step to identify it.}
45}
46\value{
47An updated version of \code{recipe} with the new step added to the
48sequence of any existing operations.
49}
50\description{
51\code{step_inverse} creates a \emph{specification} of a recipe
52step that will inverse transform the data.
53}
54\details{
55When you \code{\link[=tidy]{tidy()}} this step, a tibble with columns \code{terms}
56(the columns that will be affected) is returned.
57}
58\examples{
59set.seed(313)
60examples <- matrix(runif(40), ncol = 2)
61examples <- data.frame(examples)
62
63rec <- recipe(~ X1 + X2, data = examples)
64
65inverse_trans <- rec  \%>\%
66  step_inverse(all_numeric_predictors())
67
68inverse_obj <- prep(inverse_trans, training = examples)
69
70transformed_te <- bake(inverse_obj, examples)
71plot(examples$X1, transformed_te$X1)
72
73tidy(inverse_trans, number = 1)
74tidy(inverse_obj, number = 1)
75}
76\seealso{
77Other individual transformation steps:
78\code{\link{step_BoxCox}()},
79\code{\link{step_YeoJohnson}()},
80\code{\link{step_bs}()},
81\code{\link{step_harmonic}()},
82\code{\link{step_hyperbolic}()},
83\code{\link{step_invlogit}()},
84\code{\link{step_logit}()},
85\code{\link{step_log}()},
86\code{\link{step_mutate}()},
87\code{\link{step_ns}()},
88\code{\link{step_poly}()},
89\code{\link{step_relu}()},
90\code{\link{step_sqrt}()}
91}
92\concept{individual transformation steps}
93