View source: R/pre_processing.R
coalesce_one_hot | R Documentation |
Helper function to reverse one-hot encoding post-imputation.
coalesce_one_hot(X, var_name, fast = TRUE)
X |
A data.frame, data.table or matrix, for a single variable |
var_name |
A character string, with the original variable label |
fast |
Boolean, indicating whether to choose category with highest predicted probability (TRUE), or use predicted probabilities as weights in draw from random distribution |
A vector of length equal to nrow(X)
, containing categorical labels corresponding to the columns of X
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.