Skip to content

grid_max_entropy() drops last specified value for qualitative parameters #94

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

Closed
rbjanis opened this issue Jan 31, 2020 · 2 comments
Closed

Comments

@rbjanis
Copy link

rbjanis commented Jan 31, 2020

Discovered at Applied Machine Learning Workshop at Rstudio::conf 2020.

When values are specified for qualitative parameters, the last specified value is doesn't appear in the grid produced by grid_max_entropy(). This doesn't seem to happen when grid_regular() is used.

  library(dials)
#> Loading required package: scales
knn_params <- parameters(neighbors(), 
                        weight_func(c('rectangular', 'triangular', 'epanechnikov')), 
                        dist_power()) 
knn_params <- grid_max_entropy(knn_params, size = 50)

unique(knn_params$weight_func)
#> [1] "rectangular" "triangular"
# epanechnikov missing

# Another example
params <- parameters(prune_method(c('backward', 'none', 'exhaustive', 'forward'))) 
params <- grid_max_entropy(params, size = 50)

unique(params$prune_method)
#> [1] "none"       "backward"   "exhaustive"
# forward missing

Created on 2020-01-31 by the reprex package (v0.3.0)

topepo added a commit that referenced this issue Feb 16, 2020
@topepo topepo closed this as completed in 9cccc6e Feb 17, 2020
@topepo
Copy link
Member

topepo commented Feb 17, 2020

library(dials)
#> Loading required package: scales

knn_params <- parameters(neighbors(), 
                         weight_func(c('rectangular', 'triangular', 'epanechnikov')), 
                         dist_power()) 
knn_params <- grid_max_entropy(knn_params, size = 50)

unique(knn_params$weight_func)
#> [1] "rectangular"  "epanechnikov" "triangular"

# Another example
params <- parameters(prune_method(c('backward', 'none', 'exhaustive', 'forward'))) 
params <- grid_max_entropy(params, size = 50)

unique(params$prune_method)
#> [1] "none"       "exhaustive" "forward"    "backward"

Created on 2020-02-16 by the reprex package (v0.3.0)

@github-actions
Copy link

github-actions bot commented Mar 6, 2021

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.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants