Skip to content

Commit

Permalink
docs: first try to fix issues with vignettes that occur only on macos…
Browse files Browse the repository at this point in the history
…x cran runners
  • Loading branch information
kapsner committed Jul 11, 2024
1 parent d5e4306 commit 836b023
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 85 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mllrnrs
Title: R6-Based ML Learners for 'mlexperiments'
Version: 0.0.4
Version: 0.0.4.9002
Authors@R:
person("Lorenz A.", "Kapsner", , "[email protected]", role = c("cre", "aut", "cph"),
comment = c(ORCID = "0000-0003-1866-860X"))
Expand Down Expand Up @@ -40,7 +40,7 @@ VignetteBuilder:
quarto
Config/testthat/edition: 3
Config/testthat/parallel: false
Date/Publication: 2024-07-05 09:24:53.829592 UTC
Date/Publication: 2024-07-11 10:11:18.154286 UTC
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
SystemRequirements: Quarto command line tools
Expand Down
8 changes: 6 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# mllrnrs NEWS

## Unreleased (2024-05-29)
## v0.0.4 (2024-07-05)

#### New features

Expand All @@ -25,6 +25,10 @@

#### Other changes

- fixed indentation
([d5e4306](https://github.com/kapsner/mllrnrs/tree/d5e430689e1e81ba15f5c6803028d18993247f3b))
- updated version for cran-release
([2ff35e2](https://github.com/kapsner/mllrnrs/tree/2ff35e2c237c03a6e566e269744c5b15df973c7e))
- switch vignetteengine to quarto
([b70f3d6](https://github.com/kapsner/mllrnrs/tree/b70f3d678751b67513d1404062362b651d5e806a))
- added automated gen of readme
Expand All @@ -37,7 +41,7 @@
([323f9cb](https://github.com/kapsner/mllrnrs/tree/323f9cb0dc0e38213154669dccff7a700f5071c2))

Full set of changes:
[`v0.0.3...b70f3d6`](https://github.com/kapsner/mllrnrs/compare/v0.0.3...b70f3d6)
[`v0.0.3...v0.0.4`](https://github.com/kapsner/mllrnrs/compare/v0.0.3...v0.0.4)

## v0.0.3 (2024-03-07)

Expand Down
2 changes: 1 addition & 1 deletion data-raw/devstuffs.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ my_desc$set_authors(c(
# Remove some author fields
my_desc$del("Maintainer")
# Set the version
my_desc$set_version("0.0.4")
my_desc$set_version("0.0.4.9002")
# The title of your package
my_desc$set(Title = "R6-Based ML Learners for 'mlexperiments'")
# The description of your package
Expand Down
1 change: 0 additions & 1 deletion vignettes/mllrnrs_glmnet_binary.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down
30 changes: 14 additions & 16 deletions vignettes/mllrnrs_glmnet_multiclass.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down Expand Up @@ -483,7 +482,7 @@ head(tuner_results_grid)
## Appendix II: k-Fold Cross Validation with Target Weigths

```{r}
validator <- mlexperiments::MLCrossValidation$new(
validator_w_weights <- mlexperiments::MLCrossValidation$new(
learner = mllrnrs::LearnerGlmnet$new(
metric_optimization_higher_better = FALSE
),
Expand All @@ -493,22 +492,21 @@ validator <- mlexperiments::MLCrossValidation$new(
)
# append the optimized setting from above with the newly created weights
validator$learner_args <- c(
tuner$results$best.setting[-1],
list("case_weights" = y_weights)
validator_w_weights$learner_args <- c(
tuner_w_weights$results$best.setting[-1]
)
validator$predict_args <- predict_args
validator$performance_metric <- performance_metric
validator$performance_metric_args <- performance_metric_args
validator$return_models <- return_models
validator_w_weights$predict_args <- predict_args
validator_w_weights$performance_metric <- performance_metric
validator_w_weights$performance_metric_args <- performance_metric_args
validator_w_weights$return_models <- return_models
validator$set_data(
validator_w_weights$set_data(
x = train_x,
y = train_y
)
validator_results <- validator$execute()
validator_results <- validator_w_weights$execute()
#>
#> CV fold: Fold1
#>
Expand All @@ -519,11 +517,11 @@ validator_results <- validator$execute()
#>
head(validator_results)
#> fold performance alpha lambda family type.measure standardize
#> <char> <num> <num> <num> <char> <char> <lgcl>
#> 1: Fold1 0.4139240 0.7 0.003092562 multinomial class TRUE
#> 2: Fold2 0.3570648 0.7 0.003092562 multinomial class TRUE
#> 3: Fold3 0.3831881 0.7 0.003092562 multinomial class TRUE
#> fold performance lambda alpha family type.measure standardize
#> <char> <num> <num> <num> <char> <char> <lgcl>
#> 1: Fold1 0.4075269 0.005314924 0.9 multinomial class TRUE
#> 2: Fold2 0.3611115 0.005314924 0.9 multinomial class TRUE
#> 3: Fold3 0.3957362 0.005314924 0.9 multinomial class TRUE
```

```{r include=FALSE}
Expand Down
1 change: 0 additions & 1 deletion vignettes/mllrnrs_glmnet_regression.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down
1 change: 0 additions & 1 deletion vignettes/mllrnrs_lightgbm_binary.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down
40 changes: 19 additions & 21 deletions vignettes/mllrnrs_lightgbm_multiclass.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down Expand Up @@ -915,7 +914,7 @@ head(tuner_results_grid)
## Appendix II: k-Fold Cross Validation with Target Weigths

```{r}
validator <- mlexperiments::MLCrossValidation$new(
validator_w_weights <- mlexperiments::MLCrossValidation$new(
learner = mllrnrs::LearnerLightgbm$new(
metric_optimization_higher_better = FALSE
),
Expand All @@ -925,22 +924,21 @@ validator <- mlexperiments::MLCrossValidation$new(
)
# append the optimized setting from above with the newly created weights
validator$learner_args <- c(
tuner$results$best.setting[-1],
list("case_weights" = y_weights)
validator_w_weights$learner_args <- c(
tuner_w_weights$results$best.setting[-1]
)
validator$predict_args <- predict_args
validator$performance_metric <- performance_metric
validator$performance_metric_args <- performance_metric_args
validator$return_models <- return_models
validator_w_weights$predict_args <- predict_args
validator_w_weights$performance_metric <- performance_metric
validator_w_weights$performance_metric_args <- performance_metric_args
validator_w_weights$return_models <- return_models
validator$set_data(
validator_w_weights$set_data(
x = train_x,
y = train_y
)
validator_results <- validator$execute()
validator_results <- validator_w_weights$execute()
#>
#> CV fold: Fold1
#>
Expand All @@ -951,16 +949,16 @@ validator_results <- validator$execute()
#>
head(validator_results)
#> fold performance bagging_fraction feature_fraction min_data_in_leaf learning_rate num_leaves nrounds max_depth verbose
#> <char> <num> <num> <num> <num> <num> <num> <int> <int> <int>
#> 1: Fold1 0.9635665 0.8 0.6 8 0.1 14 66 -1 -1
#> 2: Fold2 0.9551452 0.8 0.6 8 0.1 14 66 -1 -1
#> 3: Fold3 0.9521232 0.8 0.6 8 0.1 14 66 -1 -1
#> objective metric num_class
#> <char> <char> <char>
#> 1: multiclass multi_logloss 3
#> 2: multiclass multi_logloss 3
#> 3: multiclass multi_logloss 3
#> fold performance nrounds bagging_fraction feature_fraction min_data_in_leaf learning_rate num_leaves max_depth verbose objective
#> <char> <num> <int> <num> <num> <num> <num> <num> <int> <int> <char>
#> 1: Fold1 0.9700167 75 1 0.8 4 0.1 10 -1 -1 multiclass
#> 2: Fold2 0.9554064 75 1 0.8 4 0.1 10 -1 -1 multiclass
#> 3: Fold3 0.9539854 75 1 0.8 4 0.1 10 -1 -1 multiclass
#> metric num_class
#> <char> <char>
#> 1: multi_logloss 3
#> 2: multi_logloss 3
#> 3: multi_logloss 3
```

```{r include=FALSE}
Expand Down
1 change: 0 additions & 1 deletion vignettes/mllrnrs_lightgbm_regression.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down
1 change: 0 additions & 1 deletion vignettes/mllrnrs_ranger_binary.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down
26 changes: 12 additions & 14 deletions vignettes/mllrnrs_ranger_multiclass.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down Expand Up @@ -553,30 +552,29 @@ head(tuner_results_grid)
## Appendix II: k-Fold Cross Validation with Target Weigths

```{r}
validator <- mlexperiments::MLCrossValidation$new(
validator_w_weights <- mlexperiments::MLCrossValidation$new(
learner = mllrnrs::LearnerRanger$new(),
fold_list = fold_list,
ncores = ncores,
seed = seed
)
# append the optimized setting from above with the newly created weights
validator$learner_args <- c(
tuner$results$best.setting[-1],
list("case_weights" = y_weights)
validator_w_weights$learner_args <- c(
tuner_w_weights$results$best.setting[-1]
)
validator$predict_args <- predict_args
validator$performance_metric <- performance_metric
validator$performance_metric_args <- performance_metric_args
validator$return_models <- return_models
validator_w_weights$predict_args <- predict_args
validator_w_weights$performance_metric <- performance_metric
validator_w_weights$performance_metric_args <- performance_metric_args
validator_w_weights$return_models <- return_models
validator$set_data(
validator_w_weights$set_data(
x = train_x,
y = train_y
)
validator_results <- validator$execute()
validator_results <- validator_w_weights$execute()
#>
#> CV fold: Fold1
#>
Expand All @@ -589,9 +587,9 @@ validator_results <- validator$execute()
head(validator_results)
#> fold performance num.trees mtry min.node.size max.depth sample.fraction probability classification
#> <char> <num> <num> <num> <num> <num> <num> <lgcl> <lgcl>
#> 1: Fold1 0.4565664 500 4 9 9 0.8 TRUE TRUE
#> 2: Fold2 0.4266609 500 4 9 9 0.8 TRUE TRUE
#> 3: Fold3 0.4576471 500 4 9 9 0.8 TRUE TRUE
#> 1: Fold1 0.4265252 500 2 5 9 0.5 TRUE TRUE
#> 2: Fold2 0.4060490 500 2 5 9 0.5 TRUE TRUE
#> 3: Fold3 0.4234232 500 2 5 9 0.5 TRUE TRUE
```

```{r include=FALSE}
Expand Down
1 change: 0 additions & 1 deletion vignettes/mllrnrs_ranger_regression.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down
1 change: 0 additions & 1 deletion vignettes/mllrnrs_xgboost_binary.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down
35 changes: 14 additions & 21 deletions vignettes/mllrnrs_xgboost_multiclass.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down Expand Up @@ -519,7 +518,7 @@ head(tuner_results_grid)
## Appendix II: k-Fold Cross Validation with Target Weigths

```{r}
validator <- mlexperiments::MLCrossValidation$new(
validator_w_weights <- mlexperiments::MLCrossValidation$new(
learner = mllrnrs::LearnerXgboost$new(
metric_optimization_higher_better = FALSE
),
Expand All @@ -529,22 +528,21 @@ validator <- mlexperiments::MLCrossValidation$new(
)
# append the optimized setting from above with the newly created weights
validator$learner_args <- c(
tuner$results$best.setting[-1],
list("case_weights" = y_weights)
validator_w_weights$learner_args <- c(
tuner_w_weights$results$best.setting[-1]
)
validator$predict_args <- predict_args
validator$performance_metric <- performance_metric
validator$performance_metric_args <- performance_metric_args
validator$return_models <- return_models
validator_w_weights$predict_args <- predict_args
validator_w_weights$performance_metric <- performance_metric
validator_w_weights$performance_metric_args <- performance_metric_args
validator_w_weights$return_models <- return_models
validator$set_data(
validator_w_weights$set_data(
x = train_x,
y = train_y
)
validator_results <- validator$execute()
validator_results <- validator_w_weights$execute()
#>
#> CV fold: Fold1
#>
Expand All @@ -555,16 +553,11 @@ validator_results <- validator$execute()
#>
head(validator_results)
#> fold performance subsample colsample_bytree min_child_weight learning_rate max_depth nrounds objective eval_metric
#> <char> <num> <num> <num> <num> <num> <num> <int> <char> <char>
#> 1: Fold1 0.4508447 0.5356077 0.8312972 1 0.1099728 10 23 multi:softprob mlogloss
#> 2: Fold2 0.4185381 0.5356077 0.8312972 1 0.1099728 10 23 multi:softprob mlogloss
#> 3: Fold3 0.4436661 0.5356077 0.8312972 1 0.1099728 10 23 multi:softprob mlogloss
#> num_class
#> <num>
#> 1: 3
#> 2: 3
#> 3: 3
#> fold performance nrounds subsample colsample_bytree min_child_weight learning_rate max_depth objective eval_metric num_class
#> <char> <num> <int> <num> <num> <num> <num> <num> <char> <char> <num>
#> 1: Fold1 0.4107641 46 0.8 0.8 5 0.1 5 multi:softprob mlogloss 3
#> 2: Fold2 0.3762118 46 0.8 0.8 5 0.1 5 multi:softprob mlogloss 3
#> 3: Fold3 0.4119798 46 0.8 0.8 5 0.1 5 multi:softprob mlogloss 3
```

```{r include=FALSE}
Expand Down
1 change: 0 additions & 1 deletion vignettes/mllrnrs_xgboost_regression.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vignette: >
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console

execute:
eval: false
collapse: true
Expand Down

0 comments on commit 836b023

Please sign in to comment.