Code
prep(impute_rec, training = credit_tr, verbose = FALSE)
Condition
Error in `step_impute_mode()`:
Caused by error in `prep()`:
! The data should be character or factor to compute the mode. Not an integer vector.
Code
imputed_te <- bake(imputed, credit_te)
Condition
Warning:
! `ptype` was added to `step_impute_mode()` after this recipe was created.
i Regenerate your recipe to avoid this warning.
Code
imputed
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 1
case_weights: 1
-- Training information
Training data contained 150 data points and 10 incomplete rows.
-- Operations
* Mode imputation for: x1 | Trained, weighted
Code
imputed
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 1
case_weights: 1
-- Training information
Training data contained 150 data points and 10 incomplete rows.
-- Operations
* Mode imputation for: x1 | Trained, ignored weights
Code
bake(imputed, new_data = credit_te[, c(-6)])
Condition
Error in `step_impute_mode()`:
! The following required column is missing from `new_data`: Marital.
Code
rec
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 10
-- Operations
* Mode imputation 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
* Mode imputation for: <none> | Trained
Code
print(rec)
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 13
-- Operations
* Mode imputation for: Status, Home, Marital
Code
prep(rec)
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 13
-- Training information
Training data contained 2000 data points and 186 incomplete rows.
-- Operations
* Mode imputation for: Status, Home, Marital | Trained
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.