If I fit a fit a k nearest neighbors model using parsnip::nearest_neighbor()
, what k is selected if I don't specify how to tune?
I am trying to figure out what k is selected here:
the_model <- nearest_neighbor() %>%
set_engine("kknn") %>%
set_mode("classification")
the_workflow <-
workflow() %>%
add_recipe(the_recipe) %>%
add_model(the_model)
the_results <-
the_workflow %>%
fit_resamples(resamples = cv_folds,
metrics = metric_set(roc_auc),
control = control_resamples(save_pred = TRUE))
I know that if I use nearest_neighbor(neighbors = tune())
I can get the k back using select_best("roc_auc")
but without specifying how to tune I get results but select_best()
does not return a k. What k value is it using (and how did you figure out the answer)?