From c141083f89d1f96a8b09f5f2c5aa0170080dc54c Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Wed, 10 Jan 2024 14:47:04 -0800 Subject: [PATCH] update snapshots --- tests/testthat/_snaps/collapse_cart.md | 2 +- tests/testthat/_snaps/discretize_cart.md | 5 +- tests/testthat/_snaps/discretize_xgb.md | 20 +++---- tests/testthat/_snaps/embed.md | 23 ++++---- tests/testthat/_snaps/feature_hash.md | 14 ++--- tests/testthat/_snaps/lencode_bayes.md | 18 +++--- tests/testthat/_snaps/lencode_glm.md | 15 ++--- tests/testthat/_snaps/lencode_mixed.md | 15 ++--- tests/testthat/_snaps/pca_sparse.md | 12 ++-- tests/testthat/_snaps/pca_sparse_bayes.md | 12 ++-- tests/testthat/_snaps/pca_truncated.md | 10 ++-- tests/testthat/_snaps/umap.md | 8 +-- tests/testthat/_snaps/umap.new.md | 68 +++++++++++++++++++++++ tests/testthat/_snaps/woe.md | 13 +++-- 14 files changed, 154 insertions(+), 81 deletions(-) create mode 100644 tests/testthat/_snaps/umap.new.md diff --git a/tests/testthat/_snaps/collapse_cart.md b/tests/testthat/_snaps/collapse_cart.md index 89e5ff5b..abdc3d6e 100644 --- a/tests/testthat/_snaps/collapse_cart.md +++ b/tests/testthat/_snaps/collapse_cart.md @@ -47,7 +47,7 @@ predictor: 73 -- Operations - * Collapsing factor levels using CART: Neighborhood, Central_Air + * Collapsing factor levels using CART: Neighborhood and Central_Air --- diff --git a/tests/testthat/_snaps/discretize_cart.md b/tests/testthat/_snaps/discretize_cart.md index b81167c1..c342dae5 100644 --- a/tests/testthat/_snaps/discretize_cart.md +++ b/tests/testthat/_snaps/discretize_cart.md @@ -42,7 +42,8 @@ Condition Error in `step_discretize_cart()`: Caused by error in `prep()`: - ! All columns selected for the step should be double, or integer. + x All columns selected for the step should be double or integer. + * 1 factor variable found: `w` # tidy method @@ -85,7 +86,7 @@ Training data contained 1000 data points and no incomplete rows. -- Operations - * Discretizing variables using CART: x, z | Trained, weighted + * Discretizing variables using CART: x and z | Trained, weighted # empty printing diff --git a/tests/testthat/_snaps/discretize_xgb.md b/tests/testthat/_snaps/discretize_xgb.md index af61fd1c..6a06c68f 100644 --- a/tests/testthat/_snaps/discretize_xgb.md +++ b/tests/testthat/_snaps/discretize_xgb.md @@ -4,7 +4,7 @@ xgboost Output ##### xgb.Booster - raw: 69.1 Kb + raw: 74.2 Kb call: xgboost::xgb.train(params = .params, data = .train, nrounds = 100, watchlist = list(train = .train, test = .test), verbose = 0, @@ -19,19 +19,19 @@ cb.early.stop(stopping_rounds = early_stopping_rounds, maximize = maximize, verbose = verbose) # of features: 13 - niter: 89 - best_iteration : 79 - best_ntreelimit : 79 - best_score : 0.4442069 - best_msg : [79] train-logloss:0.420000 test-logloss:0.444207 + niter: 96 + best_iteration : 86 + best_ntreelimit : 86 + best_score : 0.4421503 + best_msg : [86] train-logloss:0.417583 test-logloss:0.442150 nfeatures : 13 evaluation_log: iter train_logloss test_logloss 1 0.6279229 0.6303495 2 0.5869984 0.5894989 --- - 88 0.4180034 0.4449478 - 89 0.4178084 0.4446590 + 95 0.4157892 0.4425857 + 96 0.4156102 0.4432699 # run_xgboost for multi-classification @@ -287,7 +287,7 @@ Training data contained 1000 data points and no incomplete rows. -- Operations - * Discretizing variables using xgboost: x, z | Trained, weighted + * Discretizing variables using xgboost: x and z | Trained, weighted # empty printing @@ -357,5 +357,5 @@ Training data contained 1000 data points and no incomplete rows. -- Operations - * Discretizing variables using xgboost: x, z | Trained + * Discretizing variables using xgboost: x and z | Trained diff --git a/tests/testthat/_snaps/embed.md b/tests/testthat/_snaps/embed.md index 4e22ebb7..1bf18646 100644 --- a/tests/testthat/_snaps/embed.md +++ b/tests/testthat/_snaps/embed.md @@ -4,9 +4,9 @@ new_values_ch <- bake(class_test, new_data = new_dat_ch, contains("embed")) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. --- @@ -14,9 +14,9 @@ new_values_ch <- bake(class_test, new_data = new_dat_ch, contains("embed")) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. # bad args @@ -26,7 +26,8 @@ Condition Error in `step_embed()`: Caused by error in `prep()`: - ! All columns selected for the step should be string, factor, or ordered. + x All columns selected for the step should be string, factor, or ordered. + * 1 double variable found: `Sepal.Length` # check_name() is used @@ -35,8 +36,8 @@ Condition Error in `step_embed()`: Caused by error in `bake()`: - ! Name collision occured. The following variable names already exists: - i x3_embed_1 + ! Name collision occurred. The following variable names already exist: + * `x3_embed_1` # empty printing @@ -79,8 +80,8 @@ rec <- prep(rec) Condition Warning: - 'keep_original_cols' was added to `step_embed()` after this recipe was created. - Regenerate your recipe to avoid this warning. + `keep_original_cols` was added to `step_embed()` after this recipe was created. + i Regenerate your recipe to avoid this warning. # printing diff --git a/tests/testthat/_snaps/feature_hash.md b/tests/testthat/_snaps/feature_hash.md index d99c2c81..54a69451 100644 --- a/tests/testthat/_snaps/feature_hash.md +++ b/tests/testthat/_snaps/feature_hash.md @@ -4,9 +4,9 @@ res_te <- bake(rec_tr, te_dat, dplyr::starts_with("x3")) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. # check_name() is used @@ -15,8 +15,8 @@ Condition Error in `step_feature_hash()`: Caused by error in `bake()`: - ! Name collision occured. The following variable names already exists: - i x3_hash_01 + ! Name collision occurred. The following variable names already exist: + * `x3_hash_01` # empty printing @@ -59,8 +59,8 @@ rec <- prep(rec) Condition Warning: - 'keep_original_cols' was added to `step_feature_hash()` after this recipe was created. - Regenerate your recipe to avoid this warning. + `keep_original_cols` was added to `step_feature_hash()` after this recipe was created. + i Regenerate your recipe to avoid this warning. # printing diff --git a/tests/testthat/_snaps/lencode_bayes.md b/tests/testthat/_snaps/lencode_bayes.md index 3f358c42..96664736 100644 --- a/tests/testthat/_snaps/lencode_bayes.md +++ b/tests/testthat/_snaps/lencode_bayes.md @@ -11,9 +11,9 @@ new_values_ch <- bake(class_test, new_data = new_dat_ch) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. --- @@ -29,9 +29,9 @@ new_values_ch <- bake(reg_test, new_data = new_dat_ch) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. # character encoded predictor @@ -64,9 +64,9 @@ new_values_ch <- bake(class_test, new_data = new_dat_ch) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. # case weights diff --git a/tests/testthat/_snaps/lencode_glm.md b/tests/testthat/_snaps/lencode_glm.md index 512cd4ce..2e54662a 100644 --- a/tests/testthat/_snaps/lencode_glm.md +++ b/tests/testthat/_snaps/lencode_glm.md @@ -4,9 +4,9 @@ new_values_ch <- bake(class_test, new_data = new_dat_ch) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. --- @@ -14,9 +14,9 @@ new_values_ch <- bake(reg_test, new_data = new_dat_ch) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. # character encoded predictor @@ -31,7 +31,8 @@ Condition Error in `step_lencode_glm()`: Caused by error in `prep()`: - ! All columns selected for the step should be string, factor, or ordered. + x All columns selected for the step should be string, factor, or ordered. + * 1 double variable found: `Sepal.Length` # case weights diff --git a/tests/testthat/_snaps/lencode_mixed.md b/tests/testthat/_snaps/lencode_mixed.md index 9d07c64d..c5333520 100644 --- a/tests/testthat/_snaps/lencode_mixed.md +++ b/tests/testthat/_snaps/lencode_mixed.md @@ -4,9 +4,9 @@ new_values_ch <- bake(class_test, new_data = new_dat_ch) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. --- @@ -14,9 +14,9 @@ new_values_ch <- bake(reg_test, new_data = new_dat_ch) Condition Warning: - There was 1 column that was a factor when the recipe was prepped: - 'x3'. - This may cause errors when processing new data. + ! There was 1 column that was a factor when the recipe was prepped: + * `x3` + i This may cause errors when processing new data. # bad args @@ -26,7 +26,8 @@ Condition Error in `step_lencode_mixed()`: Caused by error in `prep()`: - ! All columns selected for the step should be string, factor, or ordered. + x All columns selected for the step should be string, factor, or ordered. + * 1 double variable found: `Sepal.Length` # case weights diff --git a/tests/testthat/_snaps/pca_sparse.md b/tests/testthat/_snaps/pca_sparse.md index e31e5439..3fab7c00 100644 --- a/tests/testthat/_snaps/pca_sparse.md +++ b/tests/testthat/_snaps/pca_sparse.md @@ -14,7 +14,7 @@ Training data contained 1817 data points and no incomplete rows. -- Operations - * Sparse PCA extraction with: angle_ch_1, area_ch_1, ... | Trained + * Sparse PCA extraction with: angle_ch_1 and area_ch_1, ... | Trained # check_name() is used @@ -23,8 +23,8 @@ Condition Error in `step_pca_sparse()`: Caused by error in `bake()`: - ! Name collision occured. The following variable names already exists: - i PC1 + ! Name collision occurred. The following variable names already exist: + * `PC1` # empty printing @@ -67,8 +67,8 @@ rec <- prep(rec) Condition Warning: - 'keep_original_cols' was added to `step_pca_sparse()` after this recipe was created. - Regenerate your recipe to avoid this warning. + `keep_original_cols` was added to `step_pca_sparse()` after this recipe was created. + i Regenerate your recipe to avoid this warning. # printing @@ -106,5 +106,5 @@ Training data contained 32 data points and no incomplete rows. -- Operations - * Sparse PCA extraction with: cyl, disp, hp, drat, wt, qsec, vs, ... | Trained + * Sparse PCA extraction with: cyl, disp, hp, drat, wt, qsec, ... | Trained diff --git a/tests/testthat/_snaps/pca_sparse_bayes.md b/tests/testthat/_snaps/pca_sparse_bayes.md index 35af661d..6f5bbf07 100644 --- a/tests/testthat/_snaps/pca_sparse_bayes.md +++ b/tests/testthat/_snaps/pca_sparse_bayes.md @@ -14,7 +14,7 @@ Training data contained 1817 data points and no incomplete rows. -- Operations - * Sparse PCA extraction with: angle_ch_1, area_ch_1, ... | Trained + * Sparse PCA extraction with: angle_ch_1 and area_ch_1, ... | Trained # check_name() is used @@ -23,8 +23,8 @@ Condition Error in `step_pca_sparse_bayes()`: Caused by error in `bake()`: - ! Name collision occured. The following variable names already exists: - i PC1 + ! Name collision occurred. The following variable names already exist: + * `PC1` # empty printing @@ -67,8 +67,8 @@ rec <- prep(rec) Condition Warning: - 'keep_original_cols' was added to `step_pca_sparse_bayes()` after this recipe was created. - Regenerate your recipe to avoid this warning. + `keep_original_cols` was added to `step_pca_sparse_bayes()` after this recipe was created. + i Regenerate your recipe to avoid this warning. # printing @@ -101,5 +101,5 @@ Training data contained 1817 data points and no incomplete rows. -- Operations - * Sparse PCA extraction with: angle_ch_1, area_ch_1, ... | Trained + * Sparse PCA extraction with: angle_ch_1 and area_ch_1, ... | Trained diff --git a/tests/testthat/_snaps/pca_truncated.md b/tests/testthat/_snaps/pca_truncated.md index 7ca84a68..0724e71a 100644 --- a/tests/testthat/_snaps/pca_truncated.md +++ b/tests/testthat/_snaps/pca_truncated.md @@ -5,8 +5,8 @@ Condition Error in `step_pca_truncated()`: Caused by error in `bake()`: - ! Name collision occured. The following variable names already exists: - i PC1 + ! Name collision occurred. The following variable names already exist: + * `PC1` # empty printing @@ -49,8 +49,8 @@ rec <- prep(rec) Condition Warning: - 'keep_original_cols' was added to `step_pca_truncated()` after this recipe was created. - Regenerate your recipe to avoid this warning. + `keep_original_cols` was added to `step_pca_truncated()` after this recipe was created. + i Regenerate your recipe to avoid this warning. # printing @@ -85,5 +85,5 @@ Training data contained 32 data points and no incomplete rows. -- Operations - * Truncated PCA extraction with: cyl, disp, hp, drat, wt, qsec, ... | Trained + * Truncated PCA extraction with: cyl, disp, hp, drat, wt, ... | Trained diff --git a/tests/testthat/_snaps/umap.md b/tests/testthat/_snaps/umap.md index d4b2e442..6a325f79 100644 --- a/tests/testthat/_snaps/umap.md +++ b/tests/testthat/_snaps/umap.md @@ -5,8 +5,8 @@ Condition Error in `step_umap()`: Caused by error in `bake()`: - ! Name collision occured. The following variable names already exists: - i UMAP1 + ! Name collision occurred. The following variable names already exist: + * `UMAP1` # empty printing @@ -49,8 +49,8 @@ rec <- prep(rec) Condition Warning: - 'keep_original_cols' was added to `step_pca()` after this recipe was created. - Regenerate your recipe to avoid this warning. + `keep_original_cols` was added to `step_pca()` after this recipe was created. + i Regenerate your recipe to avoid this warning. # printing diff --git a/tests/testthat/_snaps/umap.new.md b/tests/testthat/_snaps/umap.new.md new file mode 100644 index 00000000..a3cc8f09 --- /dev/null +++ b/tests/testthat/_snaps/umap.new.md @@ -0,0 +1,68 @@ +# check_name() is used + + Code + prep(rec, training = dat) + Condition + Error in `step_umap()`: + Caused by error in `irlba::irlba()`: + ! function 'as_cholmod_sparse' not provided by package 'Matrix' + +# empty printing + + Code + rec + Message + + -- Recipe ---------------------------------------------------------------------- + + -- Inputs + Number of variables by role + outcome: 1 + predictor: 10 + + -- Operations + * UMAP embedding for: + +--- + + 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 + * UMAP embedding for: | Trained + +# keep_original_cols - can prep recipes with it missing + + Code + rec <- prep(rec) + Condition + Warning: + `keep_original_cols` was added to `step_pca()` after this recipe was created. + i Regenerate your recipe to avoid this warning. + +# printing + + Code + print(rec) + Message + + -- Recipe ---------------------------------------------------------------------- + + -- Inputs + Number of variables by role + predictor: 4 + + -- Operations + * UMAP embedding for: all_predictors() + diff --git a/tests/testthat/_snaps/woe.md b/tests/testthat/_snaps/woe.md index f0508ece..2856081b 100644 --- a/tests/testthat/_snaps/woe.md +++ b/tests/testthat/_snaps/woe.md @@ -87,7 +87,7 @@ Training data contained 2000 data points and 186 incomplete rows. -- Operations - * WoE version against outcome Status for: Home, Marital, Records, Job | Trained + * WoE version against outcome Status for: Home and Marital, ... | Trained --- @@ -96,7 +96,8 @@ Condition Error in `step_woe()`: Caused by error in `prep()`: - ! All columns selected for the step should be string, factor, or ordered. + x All columns selected for the step should be string, factor, or ordered. + * 9 integer variables found: `Seniority`, `Time`, `Age`, ... # 2-level factors @@ -153,8 +154,8 @@ rec <- prep(rec) Condition Warning: - 'keep_original_cols' was added to `step_woe()` after this recipe was created. - Regenerate your recipe to avoid this warning. + `keep_original_cols` was added to `step_woe()` after this recipe was created. + i Regenerate your recipe to avoid this warning. # printing @@ -170,7 +171,7 @@ predictor: 13 -- Operations - * WoE version against outcome Status for: Job, Home + * WoE version against outcome Status for: Job and Home --- @@ -192,5 +193,5 @@ Training data contained 4454 data points and 415 incomplete rows. -- Operations - * WoE version against outcome Status for: Job, Home | Trained + * WoE version against outcome Status for: Job and Home | Trained