Description Usage Arguments Value Author(s) Examples
View source: R/knn_preprocess.R
This function applies step functions of recipes package
1 2 3 | knn_preprocess(formula, data, methods = is.character(),
apply_on = c("numeric", "categorical"), role = c("predictor",
"outcome"))
|
formula |
Formula that will be evaluated in knn algorithm (for example: Species ~ .) |
data |
Dataframe that will be modified |
methods |
Steps functions of the recipes package to be applied. For example( c("step_center", "step_scale", "step_range")) |
apply_on |
"Categorical" or "Numeric". The column type in which step functions will be applied. |
role |
"Predictor" or "Outcome". Outcome is the target variable and "Predictor" represent all the rest in "formula". |
Returns a data frame with all the changes applied.
Alberto Almui?a
1 2 | data<-knn_preprocess(Species ~ ., iris, c("step_center", "step_scale", "step_range"), "Numeric", "Predictor")
data<-knn_preprocess(Species ~ ., iris, c("step_dummy"), "Categorical", "Outcome")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.