Code
prep(rec, training = dat)
Condition
Error in `step_nnmf_sparse()`:
Caused by error in `bake()`:
! Name collision occurred. The following variable names already exist:
* `NNMF1`
Code
recipe(~., data = mtcars) %>% step_nnmf_sparse(all_predictors()) %>% prep()
Condition
Error in `step_nnmf_sparse()`:
Caused by error in `prep()`:
x Failed with error:
i Error in RcppML::nmf(A = dat, k = 2, L1 = c(0.001, 0.001), verbose = FALSE, : mocked error
Code
recipe(~., data = mtcars) %>% step_nnmf_sparse(all_predictors()) %>% prep()
Condition
Error in `step_nnmf_sparse()`:
Caused by error in `prep()`:
x The NNMF loadings are missing.
i The penalty may have been too high or missing values are present in data.
Code
bake(rec_trained, new_data = mtcars[, -3])
Condition
Error in `step_nnmf_sparse()`:
! The following required column is missing from `new_data`: disp.
Code
rec
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 10
-- Operations
* Non-negative matrix factorization 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
* No non-negative matrix factorization was extracted from: <none> | Trained
Code
rec <- prep(rec)
Condition
Warning:
`keep_original_cols` was added to `step_nnmf_sparse()` after this recipe was created.
i Regenerate your recipe to avoid this warning.
Code
print(rec)
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 10
-- Operations
* Non-negative matrix factorization for: disp and drat
Code
prep(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
* Non-negative matrix factorization for: disp and drat | Trained
Code
recipe(mpg ~ ., mtcars) %>% step_nnmf_sparse(disp, drat, num_comp = -1) %>%
prep()
Condition
Error in `step_nnmf_sparse()`:
Caused by error in `prep()`:
! `num_comp` must be a whole number larger than or equal to 0, not the number -1.
Code
recipe(mpg ~ ., mtcars) %>% step_nnmf_sparse(disp, drat, penalty = -1) %>% prep()
Condition
Error in `step_nnmf_sparse()`:
Caused by error in `prep()`:
! `penalty` must be a number larger than or equal to 2.22044604925031e-16, not the number -1.
Code
recipe(mpg ~ ., mtcars) %>% step_nnmf_sparse(disp, drat, prefix = 1) %>% prep()
Condition
Error in `step_nnmf_sparse()`:
Caused by error in `prep()`:
! `prefix` must be a single string, not the number 1.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.