min_grid.model_spec | R Documentation |
min_grid()
determines exactly what models should be fit in order to
evaluate the entire set of tuning parameter combinations. This is for
internal use only and the API may change in the near future.
## S3 method for class 'model_spec'
min_grid(x, grid, ...)
fit_max_value(x, grid, ...)
## S3 method for class 'boost_tree'
min_grid(x, grid, ...)
## S3 method for class 'linear_reg'
min_grid(x, grid, ...)
## S3 method for class 'logistic_reg'
min_grid(x, grid, ...)
## S3 method for class 'mars'
min_grid(x, grid, ...)
## S3 method for class 'multinom_reg'
min_grid(x, grid, ...)
## S3 method for class 'nearest_neighbor'
min_grid(x, grid, ...)
## S3 method for class 'cubist_rules'
min_grid(x, grid, ...)
## S3 method for class 'C5_rules'
min_grid(x, grid, ...)
## S3 method for class 'rule_fit'
min_grid(x, grid, ...)
## S3 method for class 'pls'
min_grid(x, grid, ...)
## S3 method for class 'poisson_reg'
min_grid(x, grid, ...)
x |
A model specification. |
grid |
A tibble with tuning parameter combinations. |
... |
Not currently used. |
fit_max_value()
can be used in other packages to implement a min_grid()
method.
A tibble with the minimum tuning parameters to fit and an additional list column with the parameter combinations used for prediction.
library(dplyr)
library(dials)
library(parsnip)
## -----------------------------------------------------------------------------
## No ability to exploit submodels:
svm_spec <-
svm_poly(cost = tune(), degree = tune()) %>%
set_engine("kernlab") %>%
set_mode("regression")
svm_grid <-
svm_spec %>%
extract_parameter_set_dials() %>%
grid_regular(levels = 3)
min_grid(svm_spec, svm_grid)
## -----------------------------------------------------------------------------
## Can use submodels
xgb_spec <-
boost_tree(trees = tune(), min_n = tune()) %>%
set_engine("xgboost") %>%
set_mode("regression")
xgb_grid <-
xgb_spec %>%
extract_parameter_set_dials() %>%
grid_regular(levels = 3)
min_grid(xgb_spec, xgb_grid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.