Code
filtering_trained <- prep(filtering, training = dat2, verbose = FALSE)
Condition
Warning:
The correlation matrix has missing values. 1 column was excluded from the filter.
Code
filtering_trained <- prep(filtering, training = dat3, verbose = FALSE)
Condition
Warning:
The correlation matrix has sporadic missing values. Some columns were excluded from the filter.
Code
filtering_trained
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 8
case_weights: 1
-- Training information
Training data contained 100 data points and no incomplete rows.
-- Operations
* Correlation filter on: V3_dup, V1, V2 | Trained, weighted
Code
filtering_trained
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 8
case_weights: 1
-- Training information
Training data contained 100 data points and no incomplete rows.
-- Operations
* Correlation filter on: V6, V1, V3 | Trained, ignored weights
Code
tmp <- recipe(~., data = mtcars) %>% step_corr(all_predictors()) %>% prep()
Condition
Warning:
Too many correlations are `NA`; skipping correlation filter.
Code
rec
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 10
-- Operations
* Correlation filter on: <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
* Correlation filter on: <none> | Trained
Code
print(rec)
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 7
-- Operations
* Correlation filter on: all_predictors()
Code
prep(rec)
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 7
-- Training information
Training data contained 100 data points and no incomplete rows.
-- Operations
* Correlation filter on: V6 and V1 | Trained
Code
recipe(mpg ~ ., mtcars) %>% step_corr(all_predictors(), threshold = 2) %>% prep()
Condition
Error in `step_corr()`:
Caused by error in `prep()`:
! `threshold` must be a number between 0 and 1, not the number 2.
Code
recipe(mpg ~ ., mtcars) %>% step_corr(all_predictors(), use = "this") %>% prep()
Condition
Error in `step_corr()`:
Caused by error in `prep()`:
! `use` must be one of "all.obs", "complete.obs", "pairwise.complete.obs", "everything", or "na.or.complete", not "this".
Code
recipe(mpg ~ ., mtcars) %>% step_corr(all_predictors(), method = "my dissertation") %>%
prep()
Condition
Error in `step_corr()`:
Caused by error in `prep()`:
! `method` must be one of "pearson", "kendall", or "spearman", not "my dissertation".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.