-
Notifications
You must be signed in to change notification settings - Fork 92
Document default ranges for tuning parameters #954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello @emmafeuer 👋 Thanks for submitting this issue! What is happening here is the difference between the default dials objects and the model specific dials objects. You are correct that it has the range 1-10. library(tidymodels)
neighbors()
#> # Nearest Neighbors (quantitative)
#> Range: [1, 10]
grid_regular(neighbors())
#> # A tibble: 3 × 1
#> neighbors
#> <int>
#> 1 1
#> 2 5
#> 3 10 So you could pass when you call parsnip/R/nearest_neighbor_data.R Line 18 in dd36a95
this is admittedly not documented super well on parsnips side. So if you don't pass anything to knn_mod <- nearest_neighbor(neighbors = tune()) |>
set_mode("classification") |>
set_engine("kknn")
knn_param_set <- extract_parameter_set_dials(knn_mod)
knn_param_set$object[[1]]
#> # Nearest Neighbors (quantitative)
#> Range: [1, 15]
grid_regular(knn_param_set)
#> # A tibble: 3 × 1
#> neighbors
#> <int>
#> 1 1
#> 2 8
#> 3 15 Created on 2023-03-31 with reprex v2.0.2 |
I'm going to move this to parsnip because this is about documenting the default ranges used by parsnip models. The default ranges for (out-of-the-box) dials objects are documented in dials. |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
when you run the neighbors() in R, it returns that the default range is [1,10]. Additionally, when you look up the documentation for neighbors(), it says the default is [1,10].
However, when you set neighbors = tune() in a model and try to use the default range, R selects a range of [1, 15] instead of [1, 10]. This can be seen when you run extract_set_parameter_dials() and look at the range.
it would be super helpful to have this discrepancy fixed, either by changing the documentation to be [1, 15] or changing the default that results when you set neighbors = tune()


The text was updated successfully, but these errors were encountered: