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