From ab2cf5a8ee7981707dbcf78ad1ce9da7e0ae88c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20B=C4=85ka=C5=82a?= <32573962+ErdaradunGaztea@users.noreply.github.com> Date: Tue, 9 May 2023 09:40:52 +0200 Subject: [PATCH] apply one-hot to nominal predictions only --- R/define_target.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/define_target.R b/R/define_target.R index 2d8bff9..dbb9fd7 100644 --- a/R/define_target.R +++ b/R/define_target.R @@ -72,7 +72,7 @@ prepare_data_for_modelling <- function(data, target){ mydata <- mydata %>% recipes::recipe( ~ .) %>% - recipes::step_dummy(recipes::all_predictors(), -recipes::all_numeric(), -target$id_variable, -target$target_variable, one_hot = T) %>% + recipes::step_dummy(recipes::all_nominal_predictors(), -target$id_variable, -target$target_variable, one_hot = T) %>% recipes::prep() %>% recipes::bake(mydata) %>% mutate_if(is.logical, as.integer)