View source: R/check_enough_data.R
check_enough_data | R Documentation |
check_enough_data
creates a specification of a recipe
operation that will check if variables contain enough data.
check_enough_data(
recipe,
...,
min_observations = NULL,
epi_keys = NULL,
drop_na = TRUE,
role = NA,
trained = FALSE,
skip = TRUE,
id = rand_id("enough_data")
)
recipe |
A recipe object. The check will be added to the sequence of operations for this recipe. |
... |
One or more selector functions to choose variables for this check.
See |
min_observations |
The minimum number of data points required for training. If this is NULL, the total number of predictors will be used. |
epi_keys |
A character vector of column names on which to group the data and check threshold within each group. Useful if your forecaster trains per group (for example, per geo_value). |
drop_na |
A logical for whether to count NA values as valid rows. |
role |
Not used by this check since no new variables are created. |
trained |
A logical for whether the selectors in |
skip |
A logical. If |
id |
A character string that is unique to this check to identify it. |
This check will break the prep
and/or bake function if any of the
checked columns have not enough non-NA values. If the check passes, nothing
is changed in the data. It is best used after every other step.
For checking training data, it is best to set ...
to be
all_predictors(), all_outcomes()
, while for checking prediction data, it
is best to set ...
to be all_predictors()
only, with n = 1
.
When you tidy()
this check, a tibble with column
terms
(the selectors or variables selected) is returned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.