min_cols | R Documentation |
For some tuning parameters, the range of values depend on the data
dimensions (e.g. mtry
). Some packages will fail if the parameter values are
outside of these ranges. Since the model might receive resampled versions of
the data, these ranges can't be set prior to the point where the model is
fit. These functions check the possible range of the data and adjust them
if needed (with a warning).
min_cols(num_cols, source)
min_rows(num_rows, source, offset = 0)
num_cols , num_rows |
The parameter value requested by the user. |
source |
A data frame for the data to be used in the fit. If the source is named "data", it is assumed that one column of the data corresponds to an outcome (and is subtracted off). |
offset |
A number subtracted off of the number of rows available in the data. |
An integer (and perhaps a warning).
nearest_neighbor(neighbors= 100) %>%
set_engine("kknn") %>%
set_mode("regression") %>%
translate()
library(ranger)
rand_forest(mtry = 2, min_n = 100, trees = 3) %>%
set_engine("ranger") %>%
set_mode("regression") %>%
fit(mpg ~ ., data = mtcars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.