Giter Site home page Giter Site logo

Comments (3)

pat-s avatar pat-s commented on May 25, 2024

Works fine for me. Did you update all packages? You were still using spcv-coords in your example whereas the CRAN version uses underscores - hence I assume you are on an oudated version.

Using the {reprex} package also helps checking for issues.

library("mlr3")
library("mlr3spatiotempcv")
library("mlr3tuning")
library("paradox")

task <- tsk("ecuador")
learner <- lrn("classif.rpart", predict_type = "prob")

# tune hyperparameter cp
param_set <- ps(cp = p_dbl(lower = -5, upper = 0, trafo = function(x) 10^x))

# AUROC suitable for binary classification tasks
measure <- msr("classif.auc")

# 10 evaluations
terminator <- trm("evals", n_evals = 10)

# random search: best balance between computation time and search space grazing
tuner <- tnr("random_search")

# inner resampling method
tuning_resampling <- rsmp("spcv_coords", folds = 10)
# tuning_resampling$instantiate(task)

instance <- TuningInstanceSingleCrit$new(
  task = task,
  learner = learner,
  resampling = tuning_resampling,
  measure = measure,
  search_space = param_set,
  terminator = terminator
)

Created on 2021-02-12 by the reprex package (v1.0.0)

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.3 (2020-10-10)
#>  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-02-12                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package          * version    date       lib
#>  assertthat         0.2.1      2019-03-21 [1]
#>  backports          1.2.1      2020-12-09 [1]
#>  bbotk              0.3.0      2021-01-24 [1]
#>  checkmate          2.0.0      2020-02-06 [1]
#>  cli                2.3.0      2021-01-31 [1]
#>  colorspace         2.0-0      2020-11-11 [1]
#>  crayon             1.4.1      2021-02-08 [1]
#>  data.table         1.13.6     2020-12-30 [1]
#>  DBI                1.1.1      2021-01-15 [1]
#>  digest             0.6.27     2020-10-24 [1]
#>  dplyr              1.0.4      2021-02-02 [1]
#>  ellipsis           0.3.1      2020-05-15 [1]
#>  evaluate           0.14       2019-05-28 [1]
#>  fs                 1.5.0      2020-07-31 [1]
#>  generics           0.1.0      2020-10-31 [1]
#>  ggplot2            3.3.3      2020-12-30 [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.1.1    2021-01-22 [1]
#>  knitr              1.31       2021-01-27 [1]
#>  lgr                0.4.2      2021-01-10 [1]
#>  lifecycle          0.2.0      2020-03-06 [1]
#>  magrittr           2.0.1      2020-11-17 [1]
#>  mlr3             * 0.10.0     2021-01-21 [1]
#>  mlr3measures       0.3.1      2021-01-06 [1]
#>  mlr3misc           0.7.0      2021-01-05 [1]
#>  mlr3spatiotempcv * 0.1.1.9000 2021-01-30 [1]
#>  mlr3tuning       * 0.6.0      2021-01-24 [1]
#>  munsell            0.5.0      2018-06-12 [1]
#>  paradox          * 0.7.0      2021-01-23 [1]
#>  pillar             1.4.7      2020-11-20 [1]
#>  pkgconfig          2.0.3      2019-09-22 [1]
#>  purrr              0.3.4      2020-04-17 [1]
#>  R.cache            0.14.0     2019-12-06 [1]
#>  R.methodsS3        1.8.1      2020-08-26 [1]
#>  R.oo               1.24.0     2020-08-26 [1]
#>  R.utils            2.10.1     2020-08-26 [1]
#>  R6                 2.5.0      2020-10-28 [1]
#>  rematch2           2.1.2      2020-05-01 [1]
#>  reprex             1.0.0      2021-01-27 [1]
#>  rlang              0.4.10     2020-12-30 [1]
#>  rmarkdown          2.6.6      2021-02-10 [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]
#>  styler             1.3.2.9000 2020-10-19 [1]
#>  tibble             3.0.6      2021-01-29 [1]
#>  tidyselect         1.1.0      2020-05-11 [1]
#>  uuid               0.1-4      2020-02-26 [1]
#>  vctrs              0.3.6      2020-12-17 [1]
#>  withr              2.4.1      2021-01-26 [1]
#>  xfun               0.21       2021-02-10 [1]
#>  yaml               2.2.1      2020-02-01 [1]
#>  source                                   
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.4)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.2)                           
#>  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)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.2)                           
#>  Github (mlr-org/mlr3spatiotempcv@8f0d554)
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.2)                           
#>  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)                           
#>  CRAN (R 4.0.2)                           
#>  Github (rstudio/rmarkdown@a62cb20)       
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.3)                           
#>  Github (pat-s/styler@51d5200)            
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.3)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.2)                           
#>  CRAN (R 4.0.4)                           
#>  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.

konstantinschellenberg avatar konstantinschellenberg commented on May 25, 2024

Alright, that's it, thanks! Now working flawlessly.

from mlr3spatiotempcv.

pat-s avatar pat-s commented on May 25, 2024

Great! Feel free to close your issues in the future 👍

from mlr3spatiotempcv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.