@@ -101,7 +101,7 @@ slather.layer_epi_YeoJohnson <- function(object, components, workflow, new_data,
101101 object $ by <- object $ by %|| %
102102 intersect(
103103 epipredict ::: epi_keys_only(components $ predictions ),
104- colnames(select(lambdas , - starts_with(" lambda_" )))
104+ colnames(select(lambdas , - starts_with(" . lambda_" )))
105105 )
106106 joinby <- list (x = names(object $ by ) %|| % object $ by , y = object $ by )
107107 hardhat :: validate_column_names(components $ predictions , joinby $ x )
@@ -133,7 +133,7 @@ slather.layer_epi_YeoJohnson <- function(object, components, workflow, new_data,
133133 col_names <- names(pos )
134134
135135 # For every column, we need to use the appropriate lambda column, which differs per row.
136- # Note that yj_inverse() is vectorized.
136+ # Note that yj_inverse() is vectorized in x, but not in lambda .
137137 if (identical(col_names , " .pred" )) {
138138 # In this case, we don't get a hint for the outcome column name, so we need to
139139 # infer it from the mold. `outcomes` is a vector of objects like
@@ -144,7 +144,7 @@ slather.layer_epi_YeoJohnson <- function(object, components, workflow, new_data,
144144
145145 components $ predictions <- components $ predictions %> %
146146 rowwise() %> %
147- mutate(.pred : = yj_inverse(.pred , !! sym(paste0(" lambda_" , outcome_cols ))))
147+ mutate(.pred : = yj_inverse(.pred , !! sym(paste0(" . lambda_" , outcome_cols ))))
148148 } else if (identical(col_names , character (0 ))) {
149149 # In this case, we should assume the user wants to transform all outcomes.
150150 cli :: cli_abort(" Not specifying columns to layer Yeo-Johnson is not implemented yet." , call = rlang :: caller_env())
@@ -161,7 +161,7 @@ slather.layer_epi_YeoJohnson <- function(object, components, workflow, new_data,
161161
162162 for (i in seq_along(col_names )) {
163163 col <- col_names [i ]
164- lambda_col <- paste0(" lambda_" , original_outcome_cols [i ])
164+ lambda_col <- paste0(" . lambda_" , original_outcome_cols [i ])
165165 components $ predictions <- components $ predictions %> %
166166 rowwise() %> %
167167 mutate(!! sym(col ) : = yj_inverse(!! sym(col ), !! sym(lambda_col )))
@@ -170,7 +170,7 @@ slather.layer_epi_YeoJohnson <- function(object, components, workflow, new_data,
170170
171171 # Remove the lambda columns.
172172 components $ predictions <- components $ predictions %> %
173- select(- any_of(starts_with(" lambda_" ))) %> %
173+ select(- any_of(starts_with(" . lambda_" ))) %> %
174174 ungroup()
175175 components
176176}
0 commit comments