Comments (9)
Hi JΓΌrgen,
thanks for posting your issue here.
Please provide a reproducible example, preferably using the reprex package.
I cannot reproduce your issue - see my reprex below.
library("mlr3verse")
#> Loading required package: mlr3
#> Loading required package: mlr3filters
#> Loading required package: mlr3learners
#> Loading required package: mlr3pipelines
#> Loading required package: mlr3tuning
#> Loading required package: mlr3viz
#> Loading required package: paradox
library("mlr3spatiotempcv")
learner <- lrn("classif.rpart")
tune_ps <- ParamSet$new(list(
ParamDbl$new("cp", lower = 0.001, upper = 0.1),
ParamInt$new("minsplit", lower = 1, upper = 10)
))
terminator <- trm("evals", n_evals = 2)
tuner <- tnr("random_search")
logger <- lgr::get_logger("bbotk")
logger$set_threshold("warn")
logger_mlr3 <- lgr::get_logger("mlr3")
logger_mlr3$set_threshold("warn")
at <- AutoTuner$new(
learner = learner,
resampling = rsmp("spcv_coords", folds = 3),
measure = msr("classif.ce"),
search_space = tune_ps,
terminator = terminator,
tuner = tuner
)
grid <- benchmark_grid(
task = tsk("ecuador"),
learner = list(at),
resampling = rsmp("spcv_coords", folds = 3)
)
bmr <- benchmark(grid)
bmr$resamplings
#> resampling_hash resampling_id resampling
#> 1: 1ed7490ce716cb8b spcv_coords <ResamplingSpCVCoords[19]>
Created on 2021-01-06 by the reprex package (v0.3.0)
Session info
devtools::session_info()
#> β Session info βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
#> setting value
#> version R version 4.0.3 Patched (2020-12-21 r79675)
#> os macOS Big Sur 10.16
#> system x86_64, darwin17.0
#> ui X11
#> language (EN)
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz Europe/Zurich
#> date 2021-01-06
#>
#> β Packages βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
#> package * version date lib
#> assertthat 0.2.1 2019-03-21 [1]
#> backports 1.2.1 2020-12-09 [1]
#> bbotk 0.2.2 2020-10-08 [1]
#> callr 3.5.1 2020-10-13 [1]
#> checkmate 2.0.0 2020-02-06 [1]
#> cli 2.2.0 2020-11-20 [1]
#> codetools 0.2-18 2020-11-04 [2]
#> colorspace 2.0-0 2020-11-11 [1]
#> crayon 1.3.4 2017-09-16 [1]
#> data.table 1.13.6 2020-12-30 [1]
#> desc 1.2.0 2018-05-01 [1]
#> devtools 2.3.2 2020-09-18 [1]
#> digest 0.6.27 2020-10-24 [1]
#> dplyr 1.0.2 2020-08-18 [1]
#> ellipsis 0.3.1 2020-05-15 [1]
#> evaluate 0.14 2019-05-28 [1]
#> fansi 0.4.1 2020-01-08 [1]
#> fs 1.5.0 2020-07-31 [1]
#> future 1.21.0 2020-12-10 [1]
#> future.apply 1.7.0 2021-01-04 [1]
#> generics 0.1.0 2020-10-31 [1]
#> ggplot2 3.3.3 2020-12-30 [1]
#> globals 0.14.0 2020-11-22 [1]
#> glue 1.4.2 2020-08-27 [1]
#> gtable 0.3.0 2019-03-25 [1]
#> highr 0.8 2019-03-20 [1]
#> htmltools 0.5.0.9003 2020-12-26 [1]
#> knitr 1.30 2020-09-22 [1]
#> lgr 0.4.1 2020-10-20 [1]
#> lifecycle 0.2.0 2020-03-06 [1]
#> listenv 0.8.0 2019-12-05 [1]
#> magrittr 2.0.1 2020-11-17 [1]
#> memoise 1.1.0 2017-04-21 [1]
#> mlr3 * 0.9.0 2020-12-06 [1]
#> mlr3filters * 0.4.0 2020-11-10 [1]
#> mlr3learners * 0.4.3 2020-12-08 [1]
#> mlr3measures 0.3.0 2020-10-05 [1]
#> mlr3misc 0.6.0 2020-11-17 [1]
#> mlr3pipelines * 0.3.2 2020-12-17 [1]
#> mlr3spatiotempcv * 0.1.0.9000 2020-12-26 [1]
#> mlr3tuning * 0.5.0 2020-12-07 [1]
#> mlr3verse * 0.1.3 2020-07-06 [1]
#> mlr3viz * 0.5.0 2020-11-02 [1]
#> munsell 0.5.0 2018-06-12 [1]
#> paradox * 0.6.0 2020-12-04 [1]
#> parallelly 1.23.0 2021-01-04 [1]
#> pillar 1.4.7 2020-11-20 [1]
#> pkgbuild 1.2.0 2020-12-15 [1]
#> pkgconfig 2.0.3 2019-09-22 [1]
#> pkgload 1.1.0 2020-05-29 [1]
#> prettyunits 1.1.1 2020-01-24 [1]
#> processx 3.4.5 2020-11-30 [1]
#> ps 1.5.0 2020-12-05 [1]
#> purrr 0.3.4 2020-04-17 [1]
#> R6 2.5.0 2020-10-28 [1]
#> remotes 2.2.0 2020-07-21 [1]
#> rlang 0.4.10 2020-12-30 [1]
#> rmarkdown 2.6.4 2021-01-05 [1]
#> rpart 4.1-15 2019-04-12 [2]
#> rprojroot 2.0.2 2020-11-15 [1]
#> scales 1.1.1 2020-05-11 [1]
#> sessioninfo 1.1.1 2018-11-05 [1]
#> stringi 1.5.3 2020-09-09 [1]
#> stringr 1.4.0 2019-02-10 [1]
#> testthat 3.0.1 2021-01-05 [1]
#> tibble 3.0.4 2020-10-12 [1]
#> tidyselect 1.1.0 2020-05-11 [1]
#> usethis 2.0.0.9000 2020-12-24 [1]
#> uuid 0.1-4 2020-02-26 [1]
#> vctrs 0.3.6 2020-12-17 [1]
#> withr 2.3.0 2020-09-22 [1]
#> xfun 0.19 2020-10-30 [1]
#> yaml 2.2.1 2020-02-01 [1]
#> source
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> Github (rstudio/htmltools@d18bd8e)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> Github (mlr-org/mlr3spatiotempcv@59cbc9f)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.2)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> Github (rstudio/rmarkdown@2e8572e)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> Github (r-lib/testthat@149c888)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> Github (r-lib/usethis@b01ab07)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#> CRAN (R 4.0.3)
#>
#> [1] /Users/pjs/Library/R/4.0/library
#> [2] /Library/Frameworks/R.framework/Versions/4.0/Resources/library
from mlr3spatiotempcv.
Hi Patrick,
thanks for the swift response!
It seems to be working now after reloading and rerunning the session again. I was trying to identify the issue now, but I can't reproduce it myself anymore. Must have been have been a little hickup on my end. Anyways, thanks again and sorry for the inconvenience caused!
Have a nice day!
JΓΌrgen
from mlr3spatiotempcv.
Sounds good! π
from mlr3spatiotempcv.
I am trying to run the reproducible example above and get an error:
library("mlr3verse")
library("mlr3spatiotempcv")
learner <- lrn("classif.rpart")
tune_ps <- ParamSet$new(list(
ParamDbl$new("cp", lower = 0.001, upper = 0.1),
ParamInt$new("minsplit", lower = 1, upper = 10)
))
#> Error in eval(expr, envir, enclos): object 'ParamSet' not found
Any idea why this isn't reproducible for me?
from mlr3spatiotempcv.
Most likely your package versions differ.
from mlr3spatiotempcv.
Thanks for your reply.
I am using mlr3spatiotempcv
0.2.0 and mlr3verse
0.2.1. The code works for me if I load the paradox
package.
library(mlr3verse)
library(mlr3spatiotempcv)
library(paradox)
learner <- lrn("classif.rpart")
tune_ps <- ParamSet$new(list(
ParamDbl$new("cp", lower = 0.001, upper = 0.1),
ParamInt$new("minsplit", lower = 1, upper = 10)
))
Here is my session info after loading mlr3spatiotempcv
and mlr3verse
.
library("mlr3verse")
library("mlr3spatiotempcv")
sessionInfo()
#> R version 4.0.4 (2021-02-15)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur 10.16
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
#>
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] mlr3spatiotempcv_0.2.0 mlr3verse_0.2.1
#>
#> loaded via a namespace (and not attached):
#> [1] Rcpp_1.0.6 paradox_0.7.1 lattice_0.20-41
#> [4] palmerpenguins_0.1.0 assertthat_0.2.1 digest_0.6.27
#> [7] utf8_1.1.4 parallelly_1.23.0 R6_2.5.0
#> [10] backports_1.2.1 reprex_1.0.0 evaluate_0.14
#> [13] ggplot2_3.3.3 highr_0.8 pillar_1.5.0
#> [16] rlang_0.4.10 mlr3fselect_0.5.0 uuid_0.1-4
#> [19] rstudioapi_0.13 data.table_1.14.0 distr6_1.5.0
#> [22] Matrix_1.3-2 checkmate_2.0.0 rmarkdown_2.7
#> [25] splines_4.0.4 stringr_1.4.0 mlr3pipelines_0.3.4
#> [28] munsell_0.5.0 compiler_4.0.4 set6_0.2.1
#> [31] xfun_0.21 pkgconfig_2.0.3 mlr3tuning_0.7.0
#> [34] htmltools_0.5.1.1 tidyselect_1.1.0 mlr3data_0.3.0
#> [37] tibble_3.1.0 lgr_0.4.2 mlr3cluster_0.1.1
#> [40] mlr3misc_0.7.0 clusterCrit_1.2.8 fansi_0.4.2
#> [43] crayon_1.4.1 dplyr_1.0.4 withr_2.4.1
#> [46] grid_4.0.4 gtable_0.3.0 lifecycle_1.0.0
#> [49] DBI_1.1.1 magrittr_2.0.1 mlr3learners_0.4.3
#> [52] scales_1.1.1 mlr3proba_0.3.1 cli_2.3.1
#> [55] stringi_1.5.3 mlr3viz_0.5.2 fs_1.5.0
#> [58] mlr3filters_0.4.1 ellipsis_0.3.1 bbotk_0.3.0
#> [61] vctrs_0.3.6 generics_0.1.0 tools_4.0.4
#> [64] mlr3_0.11.0 glue_1.4.2 purrr_0.3.4
#> [67] parallel_4.0.4 survival_3.2-7 yaml_2.2.1
#> [70] clue_0.3-58 colorspace_2.0-0 cluster_2.1.0
#> [73] R62S3_1.4.1 knitr_1.31
Thanks for your help with this.
from mlr3spatiotempcv.
Thanks. Maybe like we're missing some imports from paradox in the latest mlr3verse?
from mlr3spatiotempcv.
paradox (and mlr3verse) now offer a more concise way to create parameter sets:
tune_ps <- ps(
cp = p_dbl(lower = 0.001, upper = 0.1),
minsplit = p_int(lower = 1, upper = 10)
)
We are currently in the process of updating all examples, sorry for the confusion.
If you prefer the old syntax, you can still attach paradox.
from mlr3spatiotempcv.
OK - that makes sense. I have actually been using ps
to create parameter sets in my code, but I'm new at this and didn't recognize the connection with ParamSet
. Thanks for your help!
from mlr3spatiotempcv.
Related Issues (20)
- Check out `spcosa` package
- spatial resampling for train and test set in computer vision cases HOT 1
- Loading mlr3spatiotempcv prevents pipelines with target variable transformations from making predictions HOT 2
- New SpCV method Zalazar et al.
- Handling of `sf` objects WRT `DataBackends` HOT 2
- Longterm play of Task*ST and DataBackends HOT 1
- `as_task_*_st` and friends could allow setting column roles directly HOT 2
- Update method help pages HOT 1
- as.data.table(mlr_resamplings) does not work without suggested packages
- Add label and man field to resamplings
- Clarify the use of column roles for grouping features HOT 2
- Task printer should show `time` and `space` column roles
- Log message during `private$sample()` when column roles "space" and "time" are set HOT 1
- sf object no longer accepted by TaskClassifST HOT 1
- CRAN 2.0.1 version produces bug when registering `sf` objects as spatial backend for `TaskClassifST` HOT 3
- `register_mlr3` fails due to non-matching columns HOT 1
- cleanup when unloading HOT 1
- Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools** HOT 1
- Failure with the new version of **blockCV** HOT 5
- linnenbrink2023 reference broken in mlr3spatiotempcv vignette HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlr3spatiotempcv.