View source: R/boilerplate-knn.R
| hai_auto_knn | R Documentation | 
This is a boilerplate function to create automatically the following:
recipe
model specification
workflow
tuned model (grid ect)
hai_auto_knn(
  .data,
  .rec_obj,
  .splits_obj = NULL,
  .rsamp_obj = NULL,
  .tune = TRUE,
  .grid_size = 10,
  .num_cores = 1,
  .best_metric = "rmse",
  .model_type = "regression"
)
| .data | The data being passed to the function. The time-series object. | 
| .rec_obj | This is the recipe object you want to use. You can use
 | 
| .splits_obj | NULL is the default, when NULL then one will be created. | 
| .rsamp_obj | NULL is the default, when NULL then one will be created. It
will default to creating an  | 
| .tune | Default is TRUE, this will create a tuning grid and tuned workflow | 
| .grid_size | Default is 10 | 
| .num_cores | Default is 1 | 
| .best_metric | Default is "rmse". You can choose a metric depending on the
model_type used. If  | 
| .model_type | Default is  | 
This uses the parsnip::nearest_neighbor() with the engine set to kknn
A list
Steven P. Sanderson II, MPH
Other Boiler_Plate: 
hai_auto_c50(),
hai_auto_cubist(),
hai_auto_earth(),
hai_auto_glmnet(),
hai_auto_ranger(),
hai_auto_svm_poly(),
hai_auto_svm_rbf(),
hai_auto_wflw_metrics(),
hai_auto_xgboost()
## Not run: 
library(dplyr)
data <- iris
rec_obj <- hai_knn_data_prepper(data, Species ~ .)
auto_knn <- hai_auto_knn(
  .data = data,
  .rec_obj = rec_obj,
  .best_metric = "f_meas",
  .model_type = "classification"
)
auto_knn$recipe_info
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.