brian-j-smith / machineshop Goto Github PK
View Code? Open in Web Editor NEWMachineShop: R package of models and tools for machine learning
Home Page: https://brian-j-smith.github.io/MachineShop/
MachineShop: R package of models and tools for machine learning
Home Page: https://brian-j-smith.github.io/MachineShop/
Maybe I missed it, but I could not find documentation about how the outer loop is being performed when nested resampling is done. I assume the inner loop is defined via one of the algorithms in section 9.1 in the user guide, e.g. via BootOptimismControl()
or CVControl()
. How can the outer loop be controlled or looked up?
The following code that uses the optimism-corrected bootstrap resampling works on Windows and Mac OS, but not on Linux. Any idea what is going on (fyi, using CVControl()
works under Linux)?
library(MachineShop, warn.conflicts = FALSE)
tuned_model <- TunedModel(
XGBTreeModel,
grid = TuningGrid(),
control = BootOptimismControl()
)
MachineShop::fit(mpg ~ ., data = mtcars, model = tuned_model)
#> Error in .fit_optim(object, ...): Resampling failed for all models.
#> XGBTreeModel.1: `...` must be empty.
#> ✖ Problematic argument:
#> • group = case_comp_name(df, "groups")
#> XGBTreeModel.2: `...` must be empty.
#> ✖ Problematic argument:
#> • group = case_comp_name(df, "groups")
#> XGBTreeModel.3: `...` must be empty.
#> ✖ Problematic argument:
#> • group = case_comp_name(df, "groups")
#> XGBTreeModel.4: `...` must be empty.
#> ✖ Problematic argument:
#> • group = case_comp_name(df, "groups")
#> XGBTreeModel.5: `...` must be empty.
#> ✖ Problematic argument:
#> • group = case_comp_name(df, "groups")
#> XGBTreeModel.6: `...` must be empty.
#> ✖ Problematic argument:
#> • group = case_comp_name(df, "groups")
#> XGBTreeModel.7: `...` must be empty.
#> ✖ Problematic argument:
#> • group = case_comp_name(df, "groups")
#> XGBTreeModel.8: `...` must be empty.
#> ✖ Problematic argument:
#> • group = case_comp_name(df, "groups")
#> XGBTreeModel.9: `...` must be empty.
#> ✖ Problematic argument:
#> • group = case_comp_name(df, "groups")
sessionInfo()
#> R version 4.1.2 (2021-11-01)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: TUXEDO OS 2
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
#>
#> locale:
#> [1] LC_CTYPE=de_DE.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=de_DE.UTF-8 LC_COLLATE=de_DE.UTF-8
#> [5] LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=de_DE.UTF-8
#> [7] LC_PAPER=de_DE.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] MachineShop_3.6.2
#>
#> loaded via a namespace (and not attached):
#> [1] tidyr_1.3.0 splines_4.1.2 foreach_1.5.2
#> [4] prodlim_2023.08.28 stats4_4.1.2 coin_1.4-2
#> [7] yaml_2.3.7 progress_1.2.2 globals_0.16.2
#> [10] ipred_0.9-14 pillar_1.9.0 lattice_0.20-45
#> [13] glue_1.6.2 digest_0.6.33 hardhat_1.3.0
#> [16] sandwich_3.0-2 colorspace_2.1-0 recipes_1.0.8
#> [19] htmltools_0.5.6 Matrix_1.6-1 timeDate_4022.108
#> [22] pkgconfig_2.0.3 DiceDesign_1.9 listenv_0.9.0
#> [25] purrr_1.0.2 mvtnorm_1.2-3 scales_1.2.1
#> [28] gower_1.0.1 lava_1.7.2.1 timechange_0.2.0
#> [31] tibble_3.2.1 generics_0.1.3 ggplot2_3.4.3
#> [34] party_1.3-13 TH.data_1.1-2 withr_2.5.0
#> [37] furrr_0.3.1 nnet_7.3-17 cli_3.6.1
#> [40] strucchange_1.5-3 survival_3.2-13 magrittr_2.0.3
#> [43] crayon_1.5.2 polspline_1.1.23 evaluate_0.21
#> [46] fs_1.6.3 future_1.33.0 fansi_1.0.4
#> [49] parallelly_1.36.0 MASS_7.3-55 dials_1.2.0
#> [52] class_7.3-20 tools_4.1.2 data.table_1.14.8
#> [55] prettyunits_1.1.1 hms_1.1.3 multcomp_1.4-25
#> [58] lifecycle_1.0.3 matrixStats_1.0.0 kernlab_0.9-32
#> [61] rsample_1.2.0 munsell_0.5.0 reprex_2.0.2
#> [64] compiler_4.1.2 rlang_1.1.1 grid_4.1.2
#> [67] iterators_1.0.14 rstudioapi_0.15.0 rmarkdown_2.24
#> [70] gtable_0.3.4 codetools_0.2-18 abind_1.4-5
#> [73] R6_2.5.1 zoo_1.8-12 lubridate_1.9.2
#> [76] knitr_1.44 dplyr_1.1.3 fastmap_1.1.1
#> [79] future.apply_1.11.0 utf8_1.2.3 libcoin_1.0-9
#> [82] modeltools_0.2-23 parallel_4.1.2 Rcpp_1.0.11
#> [85] vctrs_0.6.3 rpart_4.1.16 tidyselect_1.2.0
#> [88] xfun_0.40
Created on 2023-09-15 with reprex v2.0.2
Hello 👋
In the most recent CRAN release of {recipes}, we took the first step towards updating the printing infrastructure to use {cli}. This means that in order for your steps to print properly when the next version of {recipes} gets on CRAN, you will need to have adopted this change as well. Failure to do so won't result in errors, only malformed printing. The change itself is fairly minimal. Please see the following PR tidymodels/recipes#871 for examples of how this change is to be done. Please let me know if you have any questions!
See example below:
# Old
print.step_pls <- function(x, width = max(20, options()$width - 35), ...) {
cat("PLS feature extraction with ")
printer(x$columns, x$terms, x$trained, width = width)
invisible(x)
}
# New
print.step_pls <- function(x, width = max(20, options()$width - 35), ...) {
title <- "PLS feature extraction with "
print_step(x$columns, x$terms, x$trained, width = width, title = title)
invisible(x)
}
Hi there! We've made a few changes in recipes to fully support modern tidyselect. You can see that PR here
tidymodels/recipes#595
In the process, we slightly tweaked bake()
to more directly use an element of a prepped recipe called $last_term_info
. This element is only added to the recipe at prep()
time, and is something we now left_join()
against in bake()
.
It seems that prep.ModelRecipe()
can skip the call to prep()
if the recipe looks fully trained.
Lines 76 to 85 in 8777d6b
For better or worse, a recipe looks fully trained if there are 0 steps, which means that prep.recipe()
won't be called in those cases - meaning that $last_term_info
won't get added onto the recipe. This causes this failure in our revdeps
tidymodels/recipes#595 (comment)
Is there any way you can just let prep.recipe()
get called unconditionally in prep.ModelRecipe()
?
As an FYI, we plan to submit recipes to CRAN fairly soon.
Hi,
The model gives an error in the neural network operation of the mnist data. Could the model not work in the multi-factor target variable?
thanks.
Prepare for release:
urlchecker::url_check()
devtools::check(remote = TRUE, manual = TRUE)
devtools::check_win_devel()
rhub::check_for_cran()
revdepcheck::revdep_check(num_workers = 4)
cran-comments.md
Submit to CRAN:
usethis::use_version('minor')
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
In addition to the permutation-based feature importance, there is permutation-based p-values for the feature importance (Altmann, A., Tolosi, L., Sander, O. & Lengauer, T. (2010). Permutation importance: a corrected feature importance measure, Bioinformatics 26:1340-1347). There is essentially only the ranger
package that implements this via the importance_pvalues
function. Would you think that such a function is helpful? I could imagine that this may aid in judging whether a feature is relevant or not.
Instead of rsample
(to signficantly reduce dependencies)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.