I created my dummy variables, trained my model and tested it as below:
dummy <- dummyVars(formula = CLASS_INV ~ ., data = campaign_spending_final_imputed) campaign_spending_final_dummy <- predict(dummy, newdata = campaign_spending_final_imputed) %>% as.data.frame() %>% mutate(CLASS_INV = campaign_spending_final$CLASS_INV)
I now want to test my process on an unseen real world data. How can I do it? How can I encode the category class to its respective dummy encoding?