Code
prep(others, training = sacr_tr_chr, strings_as_factors = FALSE)
Condition
Error in `step_other()`:
Caused by error in `prep()`:
! The level other is already a factor level that will be retained. Please choose a different value.
Code
rec %>% step_other(city, zip, threshold = 3.14) %>% prep()
Condition
Error in `step_other()`:
Caused by error in `prep()`:
! `threshold` must be a whole number, not the number 3.14.
Code
rec %>% step_other(city, zip, threshold = letters) %>% prep()
Condition
Error in `step_other()`:
Caused by error in `prep()`:
! `threshold` should be a single numeric value a character vector
Code
others
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 1
case_weights: 1
-- Training information
Training data contained 732 data points and no incomplete rows.
-- Operations
* Collapsing factor levels for: city | Trained, weighted
Code
others
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 1
case_weights: 1
-- Training information
Training data contained 732 data points and no incomplete rows.
-- Operations
* Collapsing factor levels for: city | Trained, ignored weights
Code
bake(others, new_data = sacr_te[, 3:9])
Condition
Error in `step_other()`:
! The following required columns are missing from `new_data`: city and zip.
Code
rec
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 10
-- Operations
* Collapsing factor levels for: <none>
Code
rec
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 10
-- Training information
Training data contained 32 data points and no incomplete rows.
-- Operations
* Collapsing factor levels for: <none> | Trained
Code
print(rec)
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 2
-- Operations
* Collapsing factor levels for: city and zip
Code
prep(rec)
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 2
-- Training information
Training data contained 732 data points and no incomplete rows.
-- Operations
* Collapsing factor levels for: city and zip | Trained
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.