# regression task partitioned into training and test set
-task = tsk("ames_housing")
+task = tsk("california_housing")
split = partition(task, ratio = 0.5)
data = data.frame(
y = c(task$truth(split$train), task$truth(split$test)),
diff --git a/dev/search.json b/dev/search.json
index 50ebb4d83..b485e686c 100644
--- a/dev/search.json
+++ b/dev/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement michellang@gmail.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://mlr3.mlr-org.com/dev/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://mlr3.mlr-org.com/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Michel Lang. Author. Bernd Bischl. Author. Jakob Richter. Author. Patrick Schratz. Author. Giuseppe Casalicchio. Contributor. Stefan Coors. Contributor. Quay Au. Contributor. Martin Binder. Author. Florian Pfisterer. Author. Raphael Sonabend. Author. Lennart Schneider. Contributor. Marc Becker. Maintainer, author. Sebastian Fischer. Author. Lona Koers. Contributor.","code":""},{"path":"https://mlr3.mlr-org.com/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Lang M, Binder M, Richter J, Schratz P, Pfisterer F, Coors S, Au Q, Casalicchio G, Kotthoff L, Bischl B (2019). “mlr3: modern object-oriented machine learning framework R.” Journal Open Source Software. doi:10.21105/joss.01903, https://joss.theoj.org/papers/10.21105/joss.01903.","code":"@Article{mlr3, title = {{mlr3}: A modern object-oriented machine learning framework in {R}}, author = {Michel Lang and Martin Binder and Jakob Richter and Patrick Schratz and Florian Pfisterer and Stefan Coors and Quay Au and Giuseppe Casalicchio and Lars Kotthoff and Bernd Bischl}, journal = {Journal of Open Source Software}, year = {2019}, month = {dec}, doi = {10.21105/joss.01903}, url = {https://joss.theoj.org/papers/10.21105/joss.01903}, }"},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"mlr3-","dir":"","previous_headings":"","what":"Machine Learning in R - Next Generation","title":"Machine Learning in R - Next Generation","text":"Package website: release | dev Efficient, object-oriented programming building blocks machine learning. Successor mlr.","code":""},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"resources-for-users-and-developers","dir":"","previous_headings":"","what":"Resources (for users and developers)","title":"Machine Learning in R - Next Generation","text":"written book. central entry point package. mlr-org website includes example gallery case studies. Reference manual FAQ Ask questions Stackoverflow (tag #mlr3) Recommended core regression, classification, survival learners mlr3learners others mlr3extralearners Use learner search get simple overview Overview cheatsheets mlr3 mlr3tuning mlr3pipelines useR2019 talk mlr3 useR2019 talk mlr3pipelines mlr3tuning useR2020 tutorial mlr3, mlr3tuning mlr3pipelines course Introduction Machine learning (I2ML) free open flipped classroom course basics machine learning. mlr3 used demos exercises. mlr3-targets: Tutorial showcasing use {mlr3} targets reproducible ML workflow automation. List extension packages mlr-outreach contains public talks slides resources. Wiki: Contains mainly information developers.","code":""},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Machine Learning in R - Next Generation","text":"Install last release CRAN: Install development version GitHub: want get started mlr3, recommend installing mlr3verse meta-package installs mlr3 important extension packages:","code":"install.packages(\"mlr3\") remotes::install_github(\"mlr-org/mlr3\") install.packages(\"mlr3verse\")"},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"constructing-learners-and-tasks","dir":"","previous_headings":"Example","what":"Constructing Learners and Tasks","title":"Machine Learning in R - Next Generation","text":"","code":"library(mlr3) # create learning task task_penguins = as_task_classif(species ~ ., data = palmerpenguins::penguins) task_penguins ## (344 x 8) ## * Target: species ## * Properties: multiclass ## * Features (7): ## - int (3): body_mass_g, flipper_length_mm, year ## - dbl (2): bill_depth_mm, bill_length_mm ## - fct (2): island, sex # load learner and set hyperparameter learner = lrn(\"classif.rpart\", cp = .01)"},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"basic-train--predict","dir":"","previous_headings":"Example","what":"Basic train + predict","title":"Machine Learning in R - Next Generation","text":"","code":"# train/test split split = partition(task_penguins, ratio = 0.67) # train the model learner$train(task_penguins, split$train_set) # predict data prediction = learner$predict(task_penguins, split$test_set) # calculate performance prediction$confusion ## truth ## response Adelie Chinstrap Gentoo ## Adelie 146 5 0 ## Chinstrap 6 63 1 ## Gentoo 0 0 123 measure = msr(\"classif.acc\") prediction$score(measure) ## classif.acc ## 0.9651163"},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"resample","dir":"","previous_headings":"Example","what":"Resample","title":"Machine Learning in R - Next Generation","text":"","code":"# 3-fold cross validation resampling = rsmp(\"cv\", folds = 3L) # run experiments rr = resample(task_penguins, learner, resampling) # access results rr$score(measure)[, .(task_id, learner_id, iteration, classif.acc)] ## task_id learner_id iteration classif.acc ## 1: palmerpenguins::penguins classif.rpart 1 0.8956522 ## 2: palmerpenguins::penguins classif.rpart 2 0.9478261 ## 3: palmerpenguins::penguins classif.rpart 3 0.9649123 rr$aggregate(measure) ## classif.acc ## 0.9361302"},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"extension-packages","dir":"","previous_headings":"","what":"Extension Packages","title":"Machine Learning in R - Next Generation","text":"Consult wiki short descriptions links respective repositories. beginners, strongly recommend install load mlr3verse package better user experience.","code":""},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"why-a-rewrite","dir":"","previous_headings":"","what":"Why a rewrite?","title":"Machine Learning in R - Next Generation","text":"mlr first released CRAN 2013. core design architecture date back even . addition many features led feature creep makes mlr hard maintain hard extend. also think mlr nicely extensible parts (learners, measures, etc.), parts less easy extend outside. Also, many helpful R libraries exist time mlr created, inclusion result non-trivial API changes.","code":""},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"design-principles","dir":"","previous_headings":"","what":"Design principles","title":"Machine Learning in R - Next Generation","text":"basic building blocks machine learning implemented package. Focus computation . visualization stuff. can go extra packages. Overcome limitations R’s S3 classes help R6. Embrace R6 clean OO-design, object state-changes reference semantics. might less “traditional R”, seems fit mlr nicely. Embrace data.table fast convenient data frame computations. Combine data.table R6, make heavy use list columns data.tables. Defensive programming type safety. user input checked checkmate. Return types documented, mechanisms popular base R “simplify” result unpredictably (e.g., sapply() drop argument [.data.frame) avoided. parallelly: Helper functions parallelization. extra recursive dependencies. future.apply: Resampling benchmarking parallelized future abstraction interfacing many parallel backends. backports: Ensures backward compatibility older R releases. Developed members mlr team. recursive dependencies. checkmate: Fast argument checks. Developed members mlr team. extra recursive dependencies. mlr3misc: Miscellaneous functions used multiple mlr3 extension packages. Developed mlr team. paradox: Descriptions parameters parameter sets. Developed mlr team. extra recursive dependencies. R6: Reference class objects. recursive dependencies. data.table: Extension R’s data.frame. recursive dependencies. digest (via mlr3misc): Hash digests. recursive dependencies. uuid: Create unique string identifiers. recursive dependencies. lgr: Logging facility. extra recursive dependencies. mlr3measures: Performance measures. extra recursive dependencies. mlbench: collection machine learning data sets. dependencies. palmerpenguins: classification data set penguins, used examples provided toy task. dependencies. Reflections: Objects queryable properties capabilities, allowing program . capture output, warnings exceptions, evaluate callr can used.","code":""},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"contributing-to-mlr3","dir":"","previous_headings":"","what":"Contributing to mlr3","title":"Machine Learning in R - Next Generation","text":"R package licensed LGPL-3. encounter problems using software (lack documentation, misleading wrong documentation, unexpected behavior, bugs, …) just want suggest features, please open issue issue tracker. Pull requests welcome included discretion maintainers. Please consult wiki style guide, roxygen guide pull request guide.","code":""},{"path":"https://mlr3.mlr-org.com/dev/index.html","id":"citing-mlr3","dir":"","previous_headings":"","what":"Citing mlr3","title":"Machine Learning in R - Next Generation","text":"use mlr3, please cite JOSS article:","code":"@Article{mlr3, title = {{mlr3}: A modern object-oriented machine learning framework in {R}}, author = {Michel Lang and Martin Binder and Jakob Richter and Patrick Schratz and Florian Pfisterer and Stefan Coors and Quay Au and Giuseppe Casalicchio and Lars Kotthoff and Bernd Bischl}, journal = {Journal of Open Source Software}, year = {2019}, month = {dec}, doi = {10.21105/joss.01903}, url = {https://joss.theoj.org/papers/10.21105/joss.01903}, }"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":null,"dir":"Reference","previous_headings":"","what":"Container for Benchmarking Results — BenchmarkResult","title":"Container for Benchmarking Results — BenchmarkResult","text":"result container object returned benchmark(). BenchmarkResult consists data multiple ResampleResults. contents BenchmarkResult ResampleResult almost identical stored ResampleResults can extracted via $resample_result() method, index performed resample experiment. allows us investigate extracted ResampleResult individual resampling iterations, well predictions models fold. BenchmarkResults can visualized via mlr3viz's autoplot() function. statistical analysis benchmark results advanced plots, see mlr3benchmark.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Container for Benchmarking Results — BenchmarkResult","text":"stored objects accessed reference. modify extracted object without cloning first.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"s-methods","dir":"Reference","previous_headings":"","what":"S3 Methods","title":"Container for Benchmarking Results — BenchmarkResult","text":".data.table(rr, ..., reassemble_learners = TRUE, convert_predictions = TRUE, predict_sets = \"test\") BenchmarkResult -> data.table::data.table() Returns tabular view internal data. c(...) (BenchmarkResult, ...) -> BenchmarkResult Combines multiple objects convertible BenchmarkResult new BenchmarkResult.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Container for Benchmarking Results — BenchmarkResult","text":"task_type (character(1)) Task type objects BenchmarkResult. stored objects (Task, Learner, Prediction) single BenchmarkResult required task type, e.g., \"classif\" \"regr\". NA empty BenchmarkResults. tasks (data.table::data.table()) Table included Tasks three columns: \"task_hash\" (character(1)), \"task_id\" (character(1)), \"task\" (Task). learners (data.table::data.table()) Table included Learners three columns: \"learner_hash\" (character(1)), \"learner_id\" (character(1)), \"learner\" (Learner). Note feasible access learned models via field, training task ambiguous. reason returned learner reset returned. Instead, select row table returned $score(). resamplings (data.table::data.table()) Table included Resamplings three columns: \"resampling_hash\" (character(1)), \"resampling_id\" (character(1)), \"resampling\" (Resampling). resample_results (data.table::data.table()) Returns table three columns: uhash (character()). resample_result (ResampleResult). n_resample_results (integer(1)) Returns total number stored ResampleResults. uhashes (character()) Set (unique) hashes included ResampleResults.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Container for Benchmarking Results — BenchmarkResult","text":"BenchmarkResult$new() BenchmarkResult$help() BenchmarkResult$format() BenchmarkResult$print() BenchmarkResult$combine() BenchmarkResult$marshal() BenchmarkResult$unmarshal() BenchmarkResult$score() BenchmarkResult$obs_loss() BenchmarkResult$aggregate() BenchmarkResult$filter() BenchmarkResult$resample_result() BenchmarkResult$discard() BenchmarkResult$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$new(data = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"data (ResultData) object type ResultData, either extracted another ResampleResult, another BenchmarkResult, manually constructed as_result_data().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-help-","dir":"Reference","previous_headings":"","what":"Method help()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Opens help page object.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$help()"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$print()"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-combine-","dir":"Reference","previous_headings":"","what":"Method combine()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Fuses second BenchmarkResult , mutating BenchmarkResult -place. second BenchmarkResult bmr NULL, simply returns self. Note can alternatively use combine function c() calls method internally.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$combine(bmr)"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"bmr (BenchmarkResult) second BenchmarkResult object.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Benchmarking Results — BenchmarkResult","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keep object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-marshal-","dir":"Reference","previous_headings":"","what":"Method marshal()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Marshals stored models.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$marshal(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"... () Additional arguments passed marshal_model().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-unmarshal-","dir":"Reference","previous_headings":"","what":"Method unmarshal()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Unmarshals stored models.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$unmarshal(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"... () Additional arguments passed unmarshal_model().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-score-","dir":"Reference","previous_headings":"","what":"Method score()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Returns table one row resampling iteration, including involved objects: Task, Learner, Resampling, iteration number (integer(1)), Prediction. ids set TRUE, character column extracted ids added table convenient filtering: \"task_id\", \"learner_id\", \"resampling_id\". Additionally calculates provided performance measures binds performance scores extra columns. columns named using id respective Measure.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$score( measures = NULL, ids = TRUE, conditions = FALSE, predictions = TRUE )"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"measures (Measure | list Measure) Measure(s) calculate. ids (logical(1)) Adds object ids (\"task_id\", \"learner_id\", \"resampling_id\") extra character columns returned table. conditions (logical(1)) Adds condition messages (\"warnings\", \"errors\") extra list columns character vectors returned table predictions (logical(1)) Additionally return prediction objects, one column predict_set learners combined. Columns named \"prediction_train\", \"prediction_test\" \"prediction_internal_valid\", present.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Benchmarking Results — BenchmarkResult","text":"data.table::data.table().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-obs-loss-","dir":"Reference","previous_headings":"","what":"Method obs_loss()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Calculates observation-wise loss via loss function set Measure's field obs_loss. Returns data.table() columns row_ids, truth, response one additional numeric column measure, named respective measure id. observation-wise loss function measure, column filled NA values. Note measures RMSE, $obs_loss, require additional transformation aggregation, example taking square-root.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$obs_loss(measures = NULL, predict_sets = \"test\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"measures (Measure | list Measure) Measure(s) calculate. predict_sets (character()) predict sets.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-aggregate-","dir":"Reference","previous_headings":"","what":"Method aggregate()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Returns result table resampling iterations combined ResampleResults. column aggregated performance score added Measure, named id respective measure. method aggregation controlled Measure, e.g. micro aggregation, macro aggregation custom aggregation. measures default macro aggregation. Note aggregated performances just give quick impression approaches work well approaches probably underperforming. However, aggregates account variance replace statistical test. See mlr3viz get better impression via boxplots mlr3benchmark critical difference plots significance tests. convenience, different flags can set extract information returned ResampleResult.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$aggregate( measures = NULL, ids = TRUE, uhashes = FALSE, params = FALSE, conditions = FALSE )"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"measures (Measure | list Measure) Measure(s) calculate. ids (logical(1)) Adds object ids (\"task_id\", \"learner_id\", \"resampling_id\") extra character columns convenient subsetting. uhashes (logical(1)) Adds uhash values ResampleResult extra character column \"uhash\". params (logical(1)) Adds hyperparameter values extra list column \"params\". can unnest mlr3misc::unnest(). conditions (logical(1)) Adds number resampling iterations least one warning extra integer column \"warnings\", number resampling iterations errors extra integer column \"errors\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Benchmarking Results — BenchmarkResult","text":"data.table::data.table().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-filter-","dir":"Reference","previous_headings":"","what":"Method filter()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Subsets benchmark result. task_ids NULL, keeps tasks provided task ids discards others tasks. procedure learner_ids resampling_ids.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$filter( task_ids = NULL, task_hashes = NULL, learner_ids = NULL, learner_hashes = NULL, resampling_ids = NULL, resampling_hashes = NULL )"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"task_ids (character()) Ids Tasks keep. task_hashes (character()) Hashes Tasks keep. learner_ids (character()) Ids Learners keep. learner_hashes (character()) Hashes Learners keep. resampling_ids (character()) Ids Resamplings keep. resampling_hashes (character()) Hashes Resamplings keep.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Benchmarking Results — BenchmarkResult","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-resample-result-","dir":"Reference","previous_headings":"","what":"Method resample_result()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Retrieve -th ResampleResult, position unique hash uhash. uhash mutually exclusive.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-11","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$resample_result(i = NULL, uhash = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-9","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"(integer(1)) iteration value filter . uhash (logical(1)) ushash value filter .","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Benchmarking Results — BenchmarkResult","text":"ResampleResult.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-discard-","dir":"Reference","previous_headings":"","what":"Method discard()","title":"Container for Benchmarking Results — BenchmarkResult","text":"Shrinks BenchmarkResult discarding parts internally stored data. Note certain operations might stop work, e.g. extracting importance values learners calculating measures requiring task's data.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-12","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$discard(backends = FALSE, models = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-10","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"backends (logical(1)) TRUE, DataBackend removed stored Tasks. models (logical(1)) TRUE, stored model removed Learners.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Benchmarking Results — BenchmarkResult","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Container for Benchmarking Results — BenchmarkResult","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"usage-13","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"BenchmarkResult$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"arguments-11","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Benchmarking Results — BenchmarkResult","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/BenchmarkResult.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Container for Benchmarking Results — BenchmarkResult","text":"","code":"set.seed(123) learners = list( lrn(\"classif.featureless\", predict_type = \"prob\"), lrn(\"classif.rpart\", predict_type = \"prob\") ) design = benchmark_grid( tasks = list(tsk(\"sonar\"), tsk(\"penguins\")), learners = learners, resamplings = rsmp(\"cv\", folds = 3) ) print(design) #> task learner resampling #> #> 1: sonar classif.featureless cv #> 2: sonar classif.rpart cv #> 3: penguins classif.featureless cv #> 4: penguins classif.rpart cv bmr = benchmark(design) print(bmr) #> of 12 rows with 4 resampling runs #> nr task_id learner_id resampling_id iters warnings errors #> 1 sonar classif.featureless cv 3 0 0 #> 2 sonar classif.rpart cv 3 0 0 #> 3 penguins classif.featureless cv 3 0 0 #> 4 penguins classif.rpart cv 3 0 0 bmr$tasks #> Key: #> task_hash task_id task #> #> 1: c064c6bd7596f188 penguins #> 2: c0fcb04583948144 sonar bmr$learners #> Key: #> learner_hash learner_id #> #> 1: 24129222692c2943 classif.rpart #> 2: 38adf5e650d6602c classif.featureless #> learner #> #> 1: #> 2: # first 5 resampling iterations head(as.data.table(bmr, measures = c(\"classif.acc\", \"classif.auc\")), 5) #> uhash task #> #> 1: 337bfaad-a7f0-45e7-af49-375334d8f55d #> 2: 337bfaad-a7f0-45e7-af49-375334d8f55d #> 3: 337bfaad-a7f0-45e7-af49-375334d8f55d #> 4: c65b305b-4b82-42da-8775-4f0e0cdd5607 #> 5: c65b305b-4b82-42da-8775-4f0e0cdd5607 #> learner resampling iteration #> #> 1: 1 #> 2: 2 #> 3: 3 #> 4: 1 #> 5: 2 #> prediction #> #> 1: #> 2: #> 3: #> 4: #> 5: # aggregate results bmr$aggregate() #> nr task_id learner_id resampling_id iters classif.ce #> #> 1: 1 sonar classif.featureless cv 3 0.46604555 #> 2: 2 sonar classif.rpart cv 3 0.27391304 #> 3: 3 penguins classif.featureless cv 3 0.55814900 #> 4: 4 penguins classif.rpart cv 3 0.05812357 #> Hidden columns: resample_result # aggregate results with hyperparameters as separate columns mlr3misc::unnest(bmr$aggregate(params = TRUE), \"params\") #> nr task_id learner_id resampling_id iters classif.ce method #> #> 1: 1 sonar classif.featureless cv 3 0.46604555 mode #> 2: 2 sonar classif.rpart cv 3 0.27391304 #> 3: 3 penguins classif.featureless cv 3 0.55814900 mode #> 4: 4 penguins classif.rpart cv 3 0.05812357 #> xval #> #> 1: NA #> 2: 0 #> 3: NA #> 4: 0 #> Hidden columns: resample_result # extract resample result for classif.rpart rr = bmr$aggregate()[learner_id == \"classif.rpart\", resample_result][[1]] print(rr) #> with 3 resampling iterations #> task_id learner_id resampling_id iteration prediction_test warnings #> sonar classif.rpart cv 1 0 #> sonar classif.rpart cv 2 0 #> sonar classif.rpart cv 3 0 #> errors #> 0 #> 0 #> 0 # access the confusion matrix of the first resampling iteration rr$predictions()[[1]]$confusion #> truth #> response M R #> M 30 18 #> R 3 19 # reduce to subset with task id \"sonar\" bmr$filter(task_ids = \"sonar\") print(bmr) #> of 6 rows with 2 resampling runs #> nr task_id learner_id resampling_id iters warnings errors #> 1 sonar classif.featureless cv 3 0 0 #> 2 sonar classif.rpart cv 3 0 0"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":null,"dir":"Reference","previous_headings":"","what":"DataBackend — DataBackend","title":"DataBackend — DataBackend","text":"abstract base class data backends. Data backends provide layer abstraction various data storage systems. recommended work directly DataBackend. Instead, data access handled transparently via Task. package comes two implementations backends: DataBackendDataTable stores data data.table::data.table(). DataBackendMatrix stores data sparse Matrix::sparseMatrix(). connect --memory database management systems SQL servers, see extension package mlr3db.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"DataBackend — DataBackend","text":"required set fields methods implement custom DataBackend listed respective sections (see DataBackendDataTable DataBackendMatrix exemplary implementations interface).","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"DataBackend — DataBackend","text":"primary_key (character(1)) Column name primary key column positive unique integer row ids.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"DataBackend — DataBackend","text":"data_formats (character()) Supported data format. Always \"data.table\".. deprecated removed future. hash (character(1)) Hash (unique identifier) object. col_hashes (named character) Hash (unique identifier) columns except primary_key: character vector, named columns element refers . Columns different Tasks DataBackends agreeing col_hashes always represent data, given rows selected. reverse necessarily true: can columns content different col_hashes.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"DataBackend — DataBackend","text":"DataBackend$new() DataBackend$format() DataBackend$print()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"DataBackend — DataBackend","text":"Creates new instance R6 class. Note: object typically constructed via derived classes, e.g. DataBackendDataTable DataBackendMatrix, via S3 method as_data_backend().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend — DataBackend","text":"","code":"DataBackend$new(data, primary_key, data_formats)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend — DataBackend","text":"data () format input data depends specialization. E.g., DataBackendDataTable expects data.table::data.table() DataBackendMatrix expects Matrix::Matrix() Matrix. primary_key (character(1)) DataBackend needs way address rows, done via column unique integer values, referenced primary_key. use variable may differ backends. data_formats (character()) Deprecated: ignored, removed future.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"DataBackend — DataBackend","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend — DataBackend","text":"","code":"DataBackend$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend — DataBackend","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"DataBackend — DataBackend","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend — DataBackend","text":"","code":"DataBackend$print()"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"DataBackend — DataBackend","text":"","code":"data = data.table::data.table(id = 1:5, x = runif(5), y = sample(letters[1:3], 5, replace = TRUE)) b = DataBackendDataTable$new(data, primary_key = \"id\") print(b) #> (5x3) #> id x y #> #> 1 0.9686412 c #> 2 0.4884955 c #> 3 0.4778220 c #> 4 0.7487929 c #> 5 0.6676402 b b$head(2) #> Key: #> id x y #> #> 1: 1 0.9686412 c #> 2: 2 0.4884955 c b$data(rows = 1:2, cols = \"x\") #> x #> #> 1: 0.9686412 #> 2: 0.4884955 b$distinct(rows = b$rownames, \"y\") #> $y #> [1] \"c\" \"b\" #> b$missings(rows = b$rownames, cols = names(data)) #> id x y #> 0 0 0"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":null,"dir":"Reference","previous_headings":"","what":"DataBackend for data.table — DataBackendDataTable","title":"DataBackend for data.table — DataBackendDataTable","text":"DataBackend data.table serves efficient -memory data base.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"DataBackend for data.table — DataBackendDataTable","text":"mlr3::DataBackend -> DataBackendDataTable","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"DataBackend for data.table — DataBackendDataTable","text":"compact_seq logical(1) TRUE, row ids natural sequence 1 nrow(data) (determined internally). case, row lookup uses faster positional indices instead equi joins.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"DataBackend for data.table — DataBackendDataTable","text":"rownames (integer()) Returns vector distinct row identifiers, .e. contents primary key column. colnames (character()) Returns vector column names, including primary key column. nrow (integer(1)) Number rows (observations). ncol (integer(1)) Number columns (variables), including primary key column.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"DataBackend for data.table — DataBackendDataTable","text":"mlr3::DataBackend$format() mlr3::DataBackend$print()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"DataBackend for data.table — DataBackendDataTable","text":"DataBackendDataTable$new() DataBackendDataTable$data() DataBackendDataTable$head() DataBackendDataTable$distinct() DataBackendDataTable$missings()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"DataBackend for data.table — DataBackendDataTable","text":"Creates new instance R6 class. Note DataBackendDataTable copy input data, as_data_backend() calls data.table::copy(). as_data_backend() also takes care casting data.table() adds primary key column necessary.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for data.table — DataBackendDataTable","text":"","code":"DataBackendDataTable$new(data, primary_key)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for data.table — DataBackendDataTable","text":"data (data.table::data.table()) input data.table(). primary_key (character(1) | integer()) Name primary key column, integer vector row ids.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"method-data-","dir":"Reference","previous_headings":"","what":"Method data()","title":"DataBackend for data.table — DataBackendDataTable","text":"Returns slice data specified format. Currently, supported formats \"data.table\" \"Matrix\". rows must addressed vector primary key values, columns must referred via column names. Queries rows matching row id queries columns matching column name silently ignored. Rows guaranteed returned order rows, columns may returned arbitrary order. Duplicated row ids result duplicated rows, duplicated column names lead exception.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for data.table — DataBackendDataTable","text":"","code":"DataBackendDataTable$data(rows, cols, data_format)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for data.table — DataBackendDataTable","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering. cols (character()) Vector column names. data_format (character(1)) Deprecated. Ignored, removed future.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"method-head-","dir":"Reference","previous_headings":"","what":"Method head()","title":"DataBackend for data.table — DataBackendDataTable","text":"Retrieve first n rows.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for data.table — DataBackendDataTable","text":"","code":"DataBackendDataTable$head(n = 6L)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for data.table — DataBackendDataTable","text":"n (integer(1)) Number rows.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"DataBackend for data.table — DataBackendDataTable","text":"data.table::data.table() first n rows.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"method-distinct-","dir":"Reference","previous_headings":"","what":"Method distinct()","title":"DataBackend for data.table — DataBackendDataTable","text":"Returns named list vectors distinct values column specified. na_rm TRUE, missing values removed returned vectors distinct values. Non-existing rows columns silently ignored.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for data.table — DataBackendDataTable","text":"","code":"DataBackendDataTable$distinct(rows, cols, na_rm = TRUE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for data.table — DataBackendDataTable","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering. cols (character()) Vector column names. na_rm logical(1) Whether remove NAs .","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"DataBackend for data.table — DataBackendDataTable","text":"Named list() distinct values.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"method-missings-","dir":"Reference","previous_headings":"","what":"Method missings()","title":"DataBackend for data.table — DataBackendDataTable","text":"Returns number missing values per column specified slice data. Non-existing rows columns silently ignored.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for data.table — DataBackendDataTable","text":"","code":"DataBackendDataTable$missings(rows, cols)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for data.table — DataBackendDataTable","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering. cols (character()) Vector column names.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"DataBackend for data.table — DataBackendDataTable","text":"Total missing values per column (named numeric()).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendDataTable.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"DataBackend for data.table — DataBackendDataTable","text":"","code":"data = as.data.table(palmerpenguins::penguins) data$id = seq_len(nrow(palmerpenguins::penguins)) b = DataBackendDataTable$new(data = data, primary_key = \"id\") print(b) #> (344x9) #> species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g #> #> Adelie Torgersen 39.1 18.7 181 3750 #> Adelie Torgersen 39.5 17.4 186 3800 #> Adelie Torgersen 40.3 18.0 195 3250 #> Adelie Torgersen NA NA NA NA #> Adelie Torgersen 36.7 19.3 193 3450 #> Adelie Torgersen 39.3 20.6 190 3650 #> sex year id #> #> male 2007 1 #> female 2007 2 #> female 2007 3 #> 2007 4 #> female 2007 5 #> male 2007 6 #> [...] (338 rows omitted) b$head() #> Key: #> species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g #> #> 1: Adelie Torgersen 39.1 18.7 181 3750 #> 2: Adelie Torgersen 39.5 17.4 186 3800 #> 3: Adelie Torgersen 40.3 18.0 195 3250 #> 4: Adelie Torgersen NA NA NA NA #> 5: Adelie Torgersen 36.7 19.3 193 3450 #> 6: Adelie Torgersen 39.3 20.6 190 3650 #> sex year id #> #> 1: male 2007 1 #> 2: female 2007 2 #> 3: female 2007 3 #> 4: 2007 4 #> 5: female 2007 5 #> 6: male 2007 6 b$data(rows = 100:101, cols = \"species\") #> species #> #> 1: Adelie #> 2: Adelie b$nrow #> [1] 344 head(b$rownames) #> [1] 1 2 3 4 5 6 b$ncol #> [1] 9 b$colnames #> [1] \"species\" \"island\" \"bill_length_mm\" #> [4] \"bill_depth_mm\" \"flipper_length_mm\" \"body_mass_g\" #> [7] \"sex\" \"year\" \"id\" # alternative construction as_data_backend(palmerpenguins::penguins) #> (344x9) #> species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g #> #> Adelie Torgersen 39.1 18.7 181 3750 #> Adelie Torgersen 39.5 17.4 186 3800 #> Adelie Torgersen 40.3 18.0 195 3250 #> Adelie Torgersen NA NA NA NA #> Adelie Torgersen 36.7 19.3 193 3450 #> Adelie Torgersen 39.3 20.6 190 3650 #> sex year ..row_id #> #> male 2007 1 #> female 2007 2 #> female 2007 3 #> 2007 4 #> female 2007 5 #> male 2007 6 #> [...] (338 rows omitted)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":null,"dir":"Reference","previous_headings":"","what":"DataBackend for Matrix — DataBackendMatrix","title":"DataBackend for Matrix — DataBackendMatrix","text":"DataBackend Matrix. Data split (numerical) sparse part optional dense part. parts automatically merged sparse format $data(). Note merging parts potentially comes data loss, dense columns converted numeric columns.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"DataBackend for Matrix — DataBackendMatrix","text":"mlr3::DataBackend -> DataBackendMatrix","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"DataBackend for Matrix — DataBackendMatrix","text":"rownames (integer()) Returns vector distinct row identifiers, .e. contents primary key column. colnames (character()) Returns vector column names, including primary key column. nrow (integer(1)) Number rows (observations). ncol (integer(1)) Number columns (variables), including primary key column.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"DataBackend for Matrix — DataBackendMatrix","text":"mlr3::DataBackend$format() mlr3::DataBackend$print()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"DataBackend for Matrix — DataBackendMatrix","text":"DataBackendMatrix$new() DataBackendMatrix$data() DataBackendMatrix$head() DataBackendMatrix$distinct() DataBackendMatrix$missings()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"DataBackend for Matrix — DataBackendMatrix","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for Matrix — DataBackendMatrix","text":"","code":"DataBackendMatrix$new(data, dense, primary_key = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for Matrix — DataBackendMatrix","text":"data Matrix::Matrix() input Matrix::Matrix(). dense data.frame(). Dense data, converted data.table::data.table(). primary_key (character(1) | integer()) Name primary key column, integer vector row ids.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"method-data-","dir":"Reference","previous_headings":"","what":"Method data()","title":"DataBackend for Matrix — DataBackendMatrix","text":"Returns slice data \"data.table\". rows must addressed vector primary key values, columns must referred via column names. Queries rows matching row id queries columns matching column name silently ignored. Rows guaranteed returned order rows, columns may returned arbitrary order. Duplicated row ids result duplicated rows, duplicated column names lead exception.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for Matrix — DataBackendMatrix","text":"","code":"DataBackendMatrix$data(rows, cols, data_format)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for Matrix — DataBackendMatrix","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering. cols (character()) Vector column names. data_format (character(1)) Deprecated. Ignored, removed future.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"method-head-","dir":"Reference","previous_headings":"","what":"Method head()","title":"DataBackend for Matrix — DataBackendMatrix","text":"Retrieve first n rows.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for Matrix — DataBackendMatrix","text":"","code":"DataBackendMatrix$head(n = 6L)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for Matrix — DataBackendMatrix","text":"n (integer(1)) Number rows.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"DataBackend for Matrix — DataBackendMatrix","text":"data.table::data.table() first n rows.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"method-distinct-","dir":"Reference","previous_headings":"","what":"Method distinct()","title":"DataBackend for Matrix — DataBackendMatrix","text":"Returns named list vectors distinct values column specified. na_rm TRUE, missing values removed returned vectors distinct values. Non-existing rows columns silently ignored.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for Matrix — DataBackendMatrix","text":"","code":"DataBackendMatrix$distinct(rows, cols, na_rm = TRUE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for Matrix — DataBackendMatrix","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering. cols (character()) Vector column names. na_rm logical(1) Whether remove NAs .","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"DataBackend for Matrix — DataBackendMatrix","text":"Named list() distinct values.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"method-missings-","dir":"Reference","previous_headings":"","what":"Method missings()","title":"DataBackend for Matrix — DataBackendMatrix","text":"Returns number missing values per column specified slice data. Non-existing rows columns silently ignored.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"DataBackend for Matrix — DataBackendMatrix","text":"","code":"DataBackendMatrix$missings(rows, cols)"},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"DataBackend for Matrix — DataBackendMatrix","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering. cols (character()) Vector column names.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"DataBackend for Matrix — DataBackendMatrix","text":"Total missing values per column (named numeric()).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/DataBackendMatrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"DataBackend for Matrix — DataBackendMatrix","text":"","code":"requireNamespace(\"Matrix\") data = Matrix::Matrix(sample(0:1, 20, replace = TRUE), ncol = 2) colnames(data) = c(\"x1\", \"x2\") dense = data.frame( ..row_id = 1:10, num = runif(10), fact = factor(sample(c(\"a\", \"b\"), 10, replace = TRUE), levels = c(\"a\", \"b\")) ) b = as_data_backend(data, dense = dense, primary_key = \"..row_id\") b$head() #> ..row_id num fact x1 x2 #> #> 1: 1 0.57207372 b 0 1 #> 2: 2 0.70381295 a 1 1 #> 3: 3 0.65722106 b 0 0 #> 4: 4 0.28935215 b 1 1 #> 5: 5 0.09723946 a 1 0 #> 6: 6 0.96242132 a 0 1 b$data(1:3, b$colnames) #> ..row_id num fact x1 x2 #> #> 1: 1 0.5720737 b 0 1 #> 2: 2 0.7038130 a 1 1 #> 3: 3 0.6572211 b 0 0"},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":null,"dir":"Reference","previous_headings":"","what":"Stack for Hot Start Learners — HotstartStack","title":"Stack for Hot Start Learners — HotstartStack","text":"class stores learners hot starting training, .e. resuming continuing already fitted model. assume hot starting possible single hyperparameter (also called fidelity parameter, usually controlling complexity expensiveness) altered hyperparameters identical. HotstartStack stores trained learners can potentially used hot start learner. Learner automatically hot start training stack attached $hotstart_stack field stack contains suitable learner. example, want train random forest learner 1000 trees already random forest learner 500 trees (hot start learner), can add hot start learner HotstartStack expensive learner 1000 trees. now call train() method (resample() benchmark()), random forest 500 trees fitted combined 500 trees hotstart learner, effectively saving fit 500 trees. Hot starting supported learners property \"hotstart_forward\" \"hotstart_backward\". example, xgboost model (mlr3learners) can hot start forward adding boosting iterations, random forest can go backwards removing trees. fidelity parameters tagged \"hotstart\" learner's parameter set.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Stack for Hot Start Learners — HotstartStack","text":"stack data.table::data.table() Stores hot start learners. hotstart_threshold (named numeric(1)) Threshold storing learners stack. value hotstart parameter threshold, learner added stack.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Stack for Hot Start Learners — HotstartStack","text":"HotstartStack$new() HotstartStack$add() HotstartStack$start_cost() HotstartStack$format() HotstartStack$print() HotstartStack$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Stack for Hot Start Learners — HotstartStack","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Stack for Hot Start Learners — HotstartStack","text":"","code":"HotstartStack$new(learners = NULL, hotstart_threshold = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stack for Hot Start Learners — HotstartStack","text":"learners (List Learners) Learners added hotstart stack. NULL (default), empty stack created. hotstart_threshold (named numeric(1)) Threshold storing learners stack.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"method-add-","dir":"Reference","previous_headings":"","what":"Method add()","title":"Stack for Hot Start Learners — HotstartStack","text":"Add learners hot start stack.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Stack for Hot Start Learners — HotstartStack","text":"","code":"HotstartStack$add(learners)"},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stack for Hot Start Learners — HotstartStack","text":"learners (List Learners). Learners added hotstart stack.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Stack for Hot Start Learners — HotstartStack","text":"self (invisibly).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"method-start-cost-","dir":"Reference","previous_headings":"","what":"Method start_cost()","title":"Stack for Hot Start Learners — HotstartStack","text":"Calculates cost learner stack hot start target learner. following cost values can returned: NA_real_: Learner unsuitable hot start target learner. -1: Hotstart learner stack target learner identical. 0 Cost hot starting backwards always 0. > 0 Cost hot starting forward.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Stack for Hot Start Learners — HotstartStack","text":"","code":"HotstartStack$start_cost(learner, task_hash)"},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stack for Hot Start Learners — HotstartStack","text":"learner Learner Target learner. task_hash Task Hash task target learner trained.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"Stack for Hot Start Learners — HotstartStack","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Stack for Hot Start Learners — HotstartStack","text":"","code":"HotstartStack$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stack for Hot Start Learners — HotstartStack","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Stack for Hot Start Learners — HotstartStack","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Stack for Hot Start Learners — HotstartStack","text":"","code":"HotstartStack$print(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stack for Hot Start Learners — HotstartStack","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Stack for Hot Start Learners — HotstartStack","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Stack for Hot Start Learners — HotstartStack","text":"","code":"HotstartStack$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stack for Hot Start Learners — HotstartStack","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/HotstartStack.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Stack for Hot Start Learners — HotstartStack","text":"","code":"# train learner on pima task task = tsk(\"pima\") learner = lrn(\"classif.debug\", iter = 1) learner$train(task) # initialize stack with previously fitted learner hot = HotstartStack$new(list(learner)) # retrieve learner with increased fidelity parameter learner = lrn(\"classif.debug\", iter = 2) # calculate cost of hot starting hot$start_cost(learner, task$hash) #> [1] 1 # add stack with hot start learner learner$hotstart_stack = hot # train automatically uses hot start learner while fitting the model learner$train(task)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":null,"dir":"Reference","previous_headings":"","what":"Learner Class — Learner","title":"Learner Class — Learner","text":"abstract base class learner objects like LearnerClassif LearnerRegr. Learners build around three following key parts: Methods $train() $predict() call internal methods private methods $.train()/$.predict()). paradox::ParamSet stores meta-information available hyperparameters, also stores hyperparameter settings. Meta-information requirements capabilities learner. fitted model stored field $model, available calling $train(). Predefined learners stored dictionary mlr_learners, e.g. classif.rpart regr.rpart. classification regression learners implemented add-package mlr3learners. Learners survival analysis (general, probabilistic regression) can found mlr3proba. Unsupervised cluster algorithms implemented mlr3cluster. dictionary mlr_learners gets automatically populated new learners soon respective packages loaded. (experimental) learners can found GitHub repository: https://github.com/mlr-org/mlr3extralearners. guide extend mlr3 custom learners can found mlr3book. combine learner preprocessing operations like factor encoding, mlr3pipelines recommended. Hyperparameters stored param_set can tuned mlr3tuning.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"optional-extractors","dir":"Reference","previous_headings":"","what":"Optional Extractors","title":"Learner Class — Learner","text":"Specific learner implementations free implement additional getters ease access certain parts model inherited subclasses. following operations, extractors standardized: importance(...): Returns feature importance score numeric vector. higher score, important variable. returned vector named feature names sorted decreasing order. Note model might omit features used . learner must tagged property \"importance\". filter variables using importance scores, see package mlr3filters. selected_features(...): Returns subset selected features character(). learner must tagged property \"selected_features\". oob_error(...): Returns --bag error model numeric(1). learner must tagged property \"oob_error\". loglik(...): Extracts log-likelihood (c.f. stats::logLik()). can used measures like mlr_measures_aic mlr_measures_bic. internal_valid_scores: Returns internal validation score(s) model named list(). available Learners \"validation\" property. learner trained yet, returns NULL. internal_tuned_values: Returns internally tuned hyperparameters model named list(). available Learners \"internal_tuning\" property. learner trained yet, returns NULL.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"setting-hyperparameters","dir":"Reference","previous_headings":"","what":"Setting Hyperparameters","title":"Learner Class — Learner","text":"information hyperparameters stored slot param_set paradox::ParamSet. printer gives overview ids available hyperparameters, storage type, lower upper bounds, possible levels (factors), default values assigned values. set hyperparameters, assign named list subslot values: Note operation replaces previously set hyperparameter values. intend change one specific hyperparameter value leave others -, can use helper function mlr3misc::insert_named(): learner additional hyperparameters encoded ParamSet, can easily extend learner. , add factor hyperparameter id \"foo\" possible levels \"\" \"b\":","code":"lrn = lrn(\"classif.rpart\") lrn$param_set$values = list(minsplit = 3, cp = 0.01) lrn$param_set$values = mlr3misc::insert_named(lrn$param_set$values, list(cp = 0.001)) lrn$param_set$add(paradox::ParamFct$new(\"foo\", levels = c(\"a\", \"b\")))"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"implementing-validation","dir":"Reference","previous_headings":"","what":"Implementing Validation","title":"Learner Class — Learner","text":"Learners, XGBoost, boosting algorithms, deep learning models (mlr3torch), utilize validation data training prevent overfitting log validation performance. possible configure learners able receive independent validation set training. , one must: annotate learner \"validation\" property implement active binding $internal_valid_scores (see section Optional Extractors), well private method $.extract_internal_valid_scores() returns (final) internal validation scores model Learner returns named list() numeric(1). model trained yet, method return NULL. Add validate parameter, can either NULL, ratio $(0, 1)$, \"test\", \"predefined\": NULL: validation ratio: proportion 1 - ratio task used training ratio used validation. \"test\" means \"test\" task used. Warning: can lead biased performance estimation. option available learner trained via resample(), benchmark() functions internally use , e.g. tune() mlr3tuning batchmark() mlr3batchmark. especially useful hyperparameter tuning, one might e.g. want use validation data early stopping model evaluation. \"predefined\" means task's (manually set) $internal_valid_task used. See Task documentation information. example , see LearnerClassifDebug. Note .train(), $internal_valid_task present $validate field Learner set non-NULL value.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"implementing-internal-tuning","dir":"Reference","previous_headings":"","what":"Implementing Internal Tuning","title":"Learner Class — Learner","text":"learners XGBoost cv.glmnet can internally tune hyperparameters. XGBoost, example, can tune number boosting rounds based validation performance. CV Glmnet, hand, can tune regularization parameter based internal cross-validation. Internal tuning can therefore rely internal validation data, necessarily . order able combine internal hyperparamer tuning standard hyperparameter optimization implemented via mlr3tuning, one : annotate learner \"internal_tuning\" property implement active binding $internal_tuned_values (see section Optional Extractors) well private method $.extract_internal_tuned_values() extracts internally tuned values Learner's model returns named list(). model trained yet, method return NULL. least one parameter tagged \"internal_tuning\", requires also provide in_tune_fn disable_tune_fn, also include default aggregation function. example , see LearnerClassifDebug.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"implementing-marshaling","dir":"Reference","previous_headings":"","what":"Implementing Marshaling","title":"Learner Class — Learner","text":"Learners models serialized e.g. contain external pointers. order still able save , use parallelization callr encapsulation necessary implement (un)-marshaled. See marshaling .","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Learner Class — Learner","text":"id (character(1)) Identifier object. Used tables, plot text output. label (character(1)) Label object. Can used tables, plot text output instead ID. state (NULL | named list()) Current (internal) state learner. Contains information gathered train() predict(). recommended access elements state directly. internal data structure may change future. task_type (character(1)) Task type, e.g. \"classif\" \"regr\". complete list possible task types (depending loaded packages), see mlr_reflections$task_types$type. predict_types (character()) Stores possible predict types learner capable . complete list candidate predict types, grouped task type, stored mlr_reflections$learner_predict_types. feature_types (character()) Stores feature types learner can handle, e.g. \"logical\", \"numeric\", \"factor\". complete list candidate feature types, grouped task type, stored mlr_reflections$task_feature_types. properties (character()) Stores set properties/capabilities learner . complete list candidate properties, grouped task type, stored mlr_reflections$learner_properties. packages (character(1)) Set required packages. packages loaded, attached. predict_sets (character()) resample()/benchmark(), Learner can predict multiple sets. Per default, learner predicts observations test set (predict_sets == \"test\"). change behavior, set predict_sets non-empty subset {\"train\", \"test\", \"internal_valid\"}. \"train\" predict set contains train ids resampling. means learner validation sets $validate ratio (creating validation data training data), train predictions include predictions validation data. set yields separate Prediction object. can combined via getters ResampleResult/BenchmarkResult, Measures can configured operate specific subsets calculated prediction sets. parallel_predict (logical(1)) set TRUE, use future calculate predictions parallel (default: FALSE). row ids task split future::nbrOfWorkers() chunks, predictions evaluated according active future::plan(). currently works methods Learner$predict() Learner$predict_newdata(), effect resample() benchmark() means parallelize. Note recorded time required prediction reports time required predict properly defined depends parallelization backend. timeout (named numeric(2)) Timeout learner's train predict steps, seconds. works differently different encapsulation methods, see mlr3misc::encapsulate(). Default c(train = Inf, predict = Inf). Also see section error handling mlr3book: https://mlr3book.mlr-org.com/chapters/chapter10/advanced_technical_aspects_of_mlr3.html#sec-error-handling man (character(1)) String format [pkg]::[topic] pointing manual page object. Defaults NA, can set child classes.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Learner Class — Learner","text":"data_formats (character()) Supported data format. Always \"data.table\".. deprecated removed future. model () fitted model. available $train() called. timings (named numeric(2)) Elapsed time seconds steps \"train\" \"predict\". predictions multiple predict sets made resample() benchmark(), predict time shows cumulative duration predictions. learner$predict() called manually, last predict time gets overwritten. Measured via mlr3misc::encapsulate(). log (data.table::data.table()) Returns output (including warning errors) table columns \"stage\" (\"train\" \"predict\"), \"class\" (\"output\", \"warning\", \"error\"), \"msg\" (character()). warnings (character()) Logged warnings vector. errors (character()) Logged errors vector. hash (character(1)) Hash (unique identifier) object. hash calculated based learner id, parameter settings, predict type, fallback hash, parallel predict setting, validate setting, predict sets. phash (character(1)) Hash (unique identifier) partial object, excluding components varied systematically tuning (parameter values). predict_type (character(1)) Stores currently active predict type, e.g. \"response\". Must element $predict_types. param_set (paradox::ParamSet) Set hyperparameters. fallback (Learner) Returns fallback learner set $encapsulate(). encapsulation (character(2)) Returns encapsulation settings set $encapsulate(). hotstart_stack (HotstartStack). Stores HotstartStack.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Learner Class — Learner","text":"Learner$new() Learner$format() Learner$print() Learner$help() Learner$train() Learner$predict() Learner$predict_newdata() Learner$reset() Learner$base_learner() Learner$encapsulate() Learner$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Learner Class — Learner","text":"Creates new instance R6 class. Note object typically constructed via derived classes, e.g. LearnerClassif LearnerRegr.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$new( id, task_type, param_set = ps(), predict_types = character(), feature_types = character(), properties = character(), data_formats, packages = character(), label = NA_character_, man = NA_character_ )"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Learner Class — Learner","text":"id (character(1)) Identifier new instance. task_type (character(1)) Type task, e.g. \"regr\" \"classif\". Must element mlr_reflections$task_types$type. param_set (paradox::ParamSet) Set hyperparameters. predict_types (character()) Supported predict types. Must subset mlr_reflections$learner_predict_types. feature_types (character()) Feature types learner operates . Must subset mlr_reflections$task_feature_types. properties (character()) Set properties Learner. Must subset mlr_reflections$learner_properties. following properties currently standardized understood learners mlr3: \"missings\": learner can handle missing values data. \"weights\": learner supports observation weights. \"importance\": learner supports extraction importance scores, .e. comes $importance() extractor function (see section optional extractors Learner). \"selected_features\": learner supports extraction set selected features, .e. comes $selected_features() extractor function (see section optional extractors Learner). \"oob_error\": learner supports extraction estimated bag error, .e. comes oob_error() extractor function (see section optional extractors Learner). \"validation\": learner can use validation task training. \"internal_tuning\": learner able internally optimize hyperparameters (also tagged \"internal_tuning\"). \"marshal\": save learners property, need call $marshal() first. learner marshaled state, call first need call $unmarshal() use model, e.g. prediction. data_formats (character()) Deprecated: ignored, removed future. packages (character()) Set required packages. warning signaled constructor least one packages installed, loaded (attached) later -demand via requireNamespace(). label (character(1)) Label new instance. man (character(1)) String format [pkg]::[topic] pointing manual page object. referenced help package can opened via method $help().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"Learner Class — Learner","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Learner Class — Learner","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Learner Class — Learner","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$print(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Learner Class — Learner","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-help-","dir":"Reference","previous_headings":"","what":"Method help()","title":"Learner Class — Learner","text":"Opens corresponding help page referenced field $man.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$help()"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-train-","dir":"Reference","previous_headings":"","what":"Method train()","title":"Learner Class — Learner","text":"Train learner set observations provided task. Mutates learner reference, .e. stores model alongside information field $state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$train(task, row_ids = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Learner Class — Learner","text":"task (Task). row_ids (integer()) Vector training indices subset task$row_ids. simple split training test set, see partition().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Learner Class — Learner","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-predict-","dir":"Reference","previous_headings":"","what":"Method predict()","title":"Learner Class — Learner","text":"Uses information stored $train() $state create new Prediction set observations provided task.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$predict(task, row_ids = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Learner Class — Learner","text":"task (Task). row_ids (integer()) Vector test indices subset task$row_ids. simple split training test set, see partition().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Learner Class — Learner","text":"Prediction.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-predict-newdata-","dir":"Reference","previous_headings":"","what":"Method predict_newdata()","title":"Learner Class — Learner","text":"Uses model fitted $train() create new Prediction based new data newdata. Object task task used $train() required conversion newdata. learner's $train() method called, (size reduced) version training task stored learner. learner fitted via resample() benchmark(), need pass corresponding task stored ResampleResult BenchmarkResult, respectively.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$predict_newdata(newdata, task = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Learner Class — Learner","text":"newdata (object supported as_data_backend()) New data predict . data formats convertible as_data_backend() supported, e.g. data.frame() DataBackend. DataBackend provided newdata, row ids preserved, otherwise set sequence 1:nrow(newdata). task (Task).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Learner Class — Learner","text":"Prediction.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-reset-","dir":"Reference","previous_headings":"","what":"Method reset()","title":"Learner Class — Learner","text":"Reset learner, .e. un-train resetting state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$reset()"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Learner Class — Learner","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-base-learner-","dir":"Reference","previous_headings":"","what":"Method base_learner()","title":"Learner Class — Learner","text":"Extracts base learner nested learner objects like GraphLearner mlr3pipelines AutoTuner mlr3tuning. Returns Learner regular learners.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$base_learner(recursive = Inf)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"Learner Class — Learner","text":"recursive (integer(1)) Depth recursion multiple nested objects.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"Learner Class — Learner","text":"Learner.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-encapsulate-","dir":"Reference","previous_headings":"","what":"Method encapsulate()","title":"Learner Class — Learner","text":"Sets encapsulation method fallback learner train predict steps. currently four different methods implemented: \"none\": Just runs learner current session measures elapsed time. keep log, output printed directly console. Works well together traceback(). \"try\": Similar \"none\", catches error. Output printed console logged. \"evaluate\": Uses package evaluate call learner, measure time logging. \"callr\": Uses package callr call learner, measure time logging. encapsulation spawns separate R session learner called. comes considerable overhead, also guards session teared segfaults. fallback learner fitted create valid predictions case either model fitting prediction original learner fails. training step predict step original learner fails, fallback used completely predict predictions sets. original learner partially fails predict step (usually form missing predict observations producing NA`` predictions), missing predictions imputed fallback. Note fallback always trained, know advance whether prediction fail. training step fails, $modelfield original learner isNULL`. Also see section error handling mlr3book: https://mlr3book.mlr-org.com/chapters/chapter10/advanced_technical_aspects_of_mlr3.html#sec-error-handling","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$encapsulate(method, fallback = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"Learner Class — Learner","text":"method character(1) One \"none\", \"try\", \"evaluate\" \"callr\". See description details. fallback Learner fallback learner failed predictions.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"Learner Class — Learner","text":"self (invisibly).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Learner Class — Learner","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"Learner Class — Learner","text":"","code":"Learner$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Learner.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"Learner Class — Learner","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":null,"dir":"Reference","previous_headings":"","what":"Classification Learner — LearnerClassif","title":"Classification Learner — LearnerClassif","text":"Learner specializes Learner classification problems: task_type set \"classif\". Creates Predictions class PredictionClassif. Possible values predict_types : \"response\": Predicts class label observation test set. \"prob\": Predicts posterior probability class observation test set. Additional learner properties include: \"twoclass\": learner works binary classification problems. \"multiclass\": learner works multiclass classification problems. Predefined learners can found dictionary mlr_learners. Essential classification learners can found dictionary loading mlr3learners. Additional learners implement Github package https://github.com/mlr-org/mlr3extralearners.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"Classification Learner — LearnerClassif","text":"mlr3::Learner -> LearnerClassif","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Classification Learner — LearnerClassif","text":"mlr3::Learner$base_learner() mlr3::Learner$encapsulate() mlr3::Learner$format() mlr3::Learner$help() mlr3::Learner$predict() mlr3::Learner$predict_newdata() mlr3::Learner$print() mlr3::Learner$reset() mlr3::Learner$train()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Classification Learner — LearnerClassif","text":"LearnerClassif$new() LearnerClassif$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Classification Learner — LearnerClassif","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Classification Learner — LearnerClassif","text":"","code":"LearnerClassif$new( id, param_set = ps(), predict_types = \"response\", feature_types = character(), properties = character(), data_formats, packages = character(), label = NA_character_, man = NA_character_ )"},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Classification Learner — LearnerClassif","text":"id (character(1)) Identifier new instance. param_set (paradox::ParamSet) Set hyperparameters. predict_types (character()) Supported predict types. Must subset mlr_reflections$learner_predict_types. feature_types (character()) Feature types learner operates . Must subset mlr_reflections$task_feature_types. properties (character()) Set properties Learner. Must subset mlr_reflections$learner_properties. following properties currently standardized understood learners mlr3: \"missings\": learner can handle missing values data. \"weights\": learner supports observation weights. \"importance\": learner supports extraction importance scores, .e. comes $importance() extractor function (see section optional extractors Learner). \"selected_features\": learner supports extraction set selected features, .e. comes $selected_features() extractor function (see section optional extractors Learner). \"oob_error\": learner supports extraction estimated bag error, .e. comes oob_error() extractor function (see section optional extractors Learner). \"validation\": learner can use validation task training. \"internal_tuning\": learner able internally optimize hyperparameters (also tagged \"internal_tuning\"). \"marshal\": save learners property, need call $marshal() first. learner marshaled state, call first need call $unmarshal() use model, e.g. prediction. data_formats (character()) Deprecated: ignored, removed future. packages (character()) Set required packages. warning signaled constructor least one packages installed, loaded (attached) later -demand via requireNamespace(). label (character(1)) Label new instance. man (character(1)) String format [pkg]::[topic] pointing manual page object. referenced help package can opened via method $help().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Classification Learner — LearnerClassif","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Classification Learner — LearnerClassif","text":"","code":"LearnerClassif$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Classification Learner — LearnerClassif","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerClassif.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Classification Learner — LearnerClassif","text":"","code":"# get all classification learners from mlr_learners: lrns = mlr_learners$mget(mlr_learners$keys(\"^classif\")) names(lrns) #> [1] \"classif.debug\" \"classif.featureless\" \"classif.rpart\" # get a specific learner from mlr_learners: lrn = lrn(\"classif.rpart\") print(lrn) #> : Classification Tree #> * Model: - #> * Parameters: xval=0 #> * Packages: mlr3, rpart #> * Predict Types: [response], prob #> * Feature Types: logical, integer, numeric, factor, ordered #> * Properties: importance, missings, multiclass, selected_features, #> twoclass, weights # train the learner: task = tsk(\"penguins\") lrn$train(task, 1:200) # predict on new observations: lrn$predict(task, 201:344)$confusion #> truth #> response Adelie Chinstrap Gentoo #> Adelie 0 62 1 #> Chinstrap 0 0 0 #> Gentoo 0 6 75"},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":null,"dir":"Reference","previous_headings":"","what":"Regression Learner — LearnerRegr","title":"Regression Learner — LearnerRegr","text":"Learner specializes Learner regression problems: task_type set \"regr\". Creates Predictions class PredictionRegr. Possible values predict_types : \"response\": Predicts numeric response observation test set. \"se\": Predicts standard error value response observation test set. \"distr\": Probability distribution VectorDistribution object (requires package distr6, available via repository https://raphaels1.r-universe.dev). Predefined learners can found dictionary mlr_learners. Essential regression learners can found dictionary loading mlr3learners. Additional learners implement Github package https://github.com/mlr-org/mlr3extralearners.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"Regression Learner — LearnerRegr","text":"mlr3::Learner -> LearnerRegr","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Regression Learner — LearnerRegr","text":"quantiles (numeric()) Numeric vector probabilities used predicting quantiles. Elements must 0 1, missing provided ascending order. one quantile provided, used response. Otherwise, set $quantile_response specify response quantile. quantile_response (numeric(1)) quantile used response.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Regression Learner — LearnerRegr","text":"mlr3::Learner$base_learner() mlr3::Learner$encapsulate() mlr3::Learner$format() mlr3::Learner$help() mlr3::Learner$predict() mlr3::Learner$predict_newdata() mlr3::Learner$print() mlr3::Learner$reset() mlr3::Learner$train()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Regression Learner — LearnerRegr","text":"LearnerRegr$new() LearnerRegr$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Regression Learner — LearnerRegr","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression Learner — LearnerRegr","text":"","code":"LearnerRegr$new( id, param_set = ps(), predict_types = \"response\", feature_types = character(), properties = character(), data_formats, packages = character(), label = NA_character_, man = NA_character_ )"},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression Learner — LearnerRegr","text":"id (character(1)) Identifier new instance. param_set (paradox::ParamSet) Set hyperparameters. predict_types (character()) Supported predict types. Must subset mlr_reflections$learner_predict_types. feature_types (character()) Feature types learner operates . Must subset mlr_reflections$task_feature_types. properties (character()) Set properties Learner. Must subset mlr_reflections$learner_properties. following properties currently standardized understood learners mlr3: \"missings\": learner can handle missing values data. \"weights\": learner supports observation weights. \"importance\": learner supports extraction importance scores, .e. comes $importance() extractor function (see section optional extractors Learner). \"selected_features\": learner supports extraction set selected features, .e. comes $selected_features() extractor function (see section optional extractors Learner). \"oob_error\": learner supports extraction estimated bag error, .e. comes oob_error() extractor function (see section optional extractors Learner). \"validation\": learner can use validation task training. \"internal_tuning\": learner able internally optimize hyperparameters (also tagged \"internal_tuning\"). \"marshal\": save learners property, need call $marshal() first. learner marshaled state, call first need call $unmarshal() use model, e.g. prediction. data_formats (character()) Deprecated: ignored, removed future. packages (character()) Set required packages. warning signaled constructor least one packages installed, loaded (attached) later -demand via requireNamespace(). label (character(1)) Label new instance. man (character(1)) String format [pkg]::[topic] pointing manual page object. referenced help package can opened via method $help().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Regression Learner — LearnerRegr","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression Learner — LearnerRegr","text":"","code":"LearnerRegr$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression Learner — LearnerRegr","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/LearnerRegr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Regression Learner — LearnerRegr","text":"","code":"# get all regression learners from mlr_learners: lrns = mlr_learners$mget(mlr_learners$keys(\"^regr\")) names(lrns) #> [1] \"regr.debug\" \"regr.featureless\" \"regr.rpart\" # get a specific learner from mlr_learners: mlr_learners$get(\"regr.rpart\") #> : Regression Tree #> * Model: - #> * Parameters: xval=0 #> * Packages: mlr3, rpart #> * Predict Types: [response] #> * Feature Types: logical, integer, numeric, factor, ordered #> * Properties: importance, missings, selected_features, weights lrn(\"classif.featureless\") #> : Featureless Classification Learner #> * Model: - #> * Parameters: method=mode #> * Packages: mlr3 #> * Predict Types: [response], prob #> * Feature Types: logical, integer, numeric, character, factor, ordered, #> POSIXct #> * Properties: featureless, importance, missings, multiclass, #> selected_features, twoclass"},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":null,"dir":"Reference","previous_headings":"","what":"Measure Class — Measure","title":"Measure Class — Measure","text":"abstract base class measures like MeasureClassif MeasureRegr. Measures classes tailored around two functions work: function $score() quantifies performance comparing truth predictions. function $aggregator() combines multiple performance scores returned $score() single numeric value. addition two functions, meta-information performance measure stored. Predefined measures stored dictionary mlr_measures, e.g. classif.auc time_train. Many measures mlr3 implemented mlr3measures ordinary functions. guide extend mlr3 custom measures can found mlr3book.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"inheriting","dir":"Reference","previous_headings":"","what":"Inheriting","title":"Measure Class — Measure","text":"measures (confidence intervals mlr3inferr) necessary measure returns one value. cases necessary overwrite public methods $aggregate() /$score() return named numeric() least one names corresponds id measure .","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Measure Class — Measure","text":"id (character(1)) Identifier object. Used tables, plot text output. label (character(1)) Label object. Can used tables, plot text output instead ID. task_type (character(1)) Task type, e.g. \"classif\" \"regr\". complete list possible task types (depending loaded packages), see mlr_reflections$task_types$type. param_set (paradox::ParamSet) Set hyperparameters. obs_loss (function() | NULL) Function calculate observation-wise loss. trafo (list() | NULL) NULL list two elements: trafo: transformation function applied aggregating observation-wise losses (e.g. sqrt RMSE) deriv: derivative trafo. predict_type (character(1)) Required predict type Learner. check_prerequisites (character(1)) proceed one following prerequisites met: wrong predict type (e.g., probabilities required, labels available). wrong predict set (e.g., learner predicted training set, predictions test set required). task properties satisfied (e.g., binary classification measure multiclass task). Possible values \"ignore\" (just return NaN) \"warn\" (default, raise warning returning NaN). task_properties (character()) Required properties Task. range (numeric(2)) Lower upper bound possible performance scores. properties (character()) Properties measure. minimize (logical(1)) TRUE, good predictions correspond small values performance scores. packages (character(1)) Set required packages. packages loaded, attached. man (character(1)) String format [pkg]::[topic] pointing manual page object. Defaults NA, can set child classes.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Measure Class — Measure","text":"predict_sets (character()) resample()/benchmark(), Learner can predict multiple sets. Per default, learner predicts observations test set (predict_sets == \"test\"). change behavior, set predict_sets non-empty subset {\"train\", \"test\", \"internal_valid\"}. \"train\" predict set contains train ids resampling. means learner validation sets $validate ratio (creating validation data training data), train predictions include predictions validation data. set yields separate Prediction object. can combined via getters ResampleResult/BenchmarkResult, Measures can configured operate specific subsets calculated prediction sets. hash (character(1)) Hash (unique identifier) object. hash calculated based id, parameter settings, predict sets $score, $average, $aggregator, $obs_loss, $trafo method. Measure can define additional fields included hash setting field $.extra_hash. average (character(1)) Method aggregation: \"micro\": predictions multiple resampling iterations first combined single Prediction object. Next, scoring function measure applied combined object, yielding single numeric score. \"macro\": scoring function applied Prediction object resampling iterations, yielding single numeric score. Next, scores combined aggregator function single numerical score. \"custom\": measure comes custom aggregation method directly operates ResampleResult. aggregator (function()) Function aggregate scores computed different resampling iterations.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Measure Class — Measure","text":"Measure$new() Measure$format() Measure$print() Measure$help() Measure$score() Measure$aggregate() Measure$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Measure Class — Measure","text":"Creates new instance R6 class. Note object typically constructed via derived classes, e.g. MeasureClassif MeasureRegr.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure Class — Measure","text":"","code":"Measure$new( id, task_type = NA, param_set = ps(), range = c(-Inf, Inf), minimize = NA, average = \"macro\", aggregator = NULL, obs_loss = NULL, properties = character(), predict_type = \"response\", predict_sets = \"test\", task_properties = character(), packages = character(), label = NA_character_, man = NA_character_, trafo = NULL )"},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure Class — Measure","text":"id (character(1)) Identifier new instance. task_type (character(1)) Type task, e.g. \"regr\" \"classif\". Must element mlr_reflections$task_types$type. param_set (paradox::ParamSet) Set hyperparameters. range (numeric(2)) Feasible range measure c(lower_bound, upper_bound). bounds may infinite. minimize (logical(1)) Set TRUE good predictions correspond small values, FALSE good predictions correspond large values. set NA (default), tuning measure possible. average (character(1)) average multiple Predictions ResampleResult. default, \"macro\", calculates individual performances scores Prediction uses function defined $aggregator average single number. set \"micro\", individual Prediction objects first combined single new Prediction object used assess performance. function $aggregator used case. aggregator (function()) Function aggregate multiple iterations. role function depends value field \"average\": \"macro\": numeric vector scores (one per iteration) passed. aggregate function defaults mean() case. \"micro\": aggregator function used. Instead, predictions multiple iterations first combined scored one go. \"custom\": ResampleResult passed aggregate function. obs_loss (function NULL) observation-wise loss function, e.g. zero-one classification error. properties (character()) Properties measure. Must subset mlr_reflections$measure_properties. Supported mlr3: \"requires_task\" (requires complete Task), \"requires_learner\" (requires trained Learner), \"requires_model\" (requires trained Learner, including fitted model), \"requires_train_set\" (requires training indices Resampling), \"na_score\" (measure expected occasionally return NA NaN). \"primary_iters\" (measure explictly handles resamplings use subset iterations point estimate). \"requires_no_prediction\" (prediction required; usually means measure extracts information learner state.). predict_type (character(1)) Required predict type Learner. Possible values stored mlr_reflections$learner_predict_types. predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". task_properties (character()) Required task properties, see Task. packages (character()) Set required packages. warning signaled constructor least one packages installed, loaded (attached) later -demand via requireNamespace(). label (character(1)) Label new instance. man (character(1)) String format [pkg]::[topic] pointing manual page object. referenced help package can opened via method $help(). trafo (list() NULL) optional list two elements, containing transformation \"fn\" derivative \"deriv\". transformation function function applied aggregating pointwise losses, .e. requires $obs_loss present. example sqrt RMSE.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"Measure Class — Measure","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure Class — Measure","text":"","code":"Measure$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure Class — Measure","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Measure Class — Measure","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure Class — Measure","text":"","code":"Measure$print(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure Class — Measure","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"method-help-","dir":"Reference","previous_headings":"","what":"Method help()","title":"Measure Class — Measure","text":"Opens corresponding help page referenced field $man.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure Class — Measure","text":"","code":"Measure$help()"},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"method-score-","dir":"Reference","previous_headings":"","what":"Method score()","title":"Measure Class — Measure","text":"Takes Prediction (list Prediction objects named valid predict_sets) calculates numeric score. measure flagged properties \"requires_task\", \"requires_learner\", \"requires_model\" \"requires_train_set\", must additionally pass respective Task, (trained) Learner training set indices. handled internally resample()/benchmark().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure Class — Measure","text":"","code":"Measure$score(prediction, task = NULL, learner = NULL, train_set = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure Class — Measure","text":"prediction (Prediction | named list Prediction). task (Task). learner (Learner). train_set (integer()).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Measure Class — Measure","text":"numeric(1).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"method-aggregate-","dir":"Reference","previous_headings":"","what":"Method aggregate()","title":"Measure Class — Measure","text":"Aggregates multiple performance scores single score, e.g. using aggregator function measure.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure Class — Measure","text":"","code":"Measure$aggregate(rr)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure Class — Measure","text":"rr ResampleResult.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Measure Class — Measure","text":"numeric(1).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Measure Class — Measure","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Measure Class — Measure","text":"","code":"Measure$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Measure.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Measure Class — Measure","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":null,"dir":"Reference","previous_headings":"","what":"Classification Measure — MeasureClassif","title":"Classification Measure — MeasureClassif","text":"measure specializes Measure classification problems: task_type set \"classif\". Possible values predict_type \"response\" \"prob\". Predefined measures can found dictionary mlr_measures. default measure classification classif.ce.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"Classification Measure — MeasureClassif","text":"mlr3::Measure -> MeasureClassif","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Classification Measure — MeasureClassif","text":"mlr3::Measure$aggregate() mlr3::Measure$format() mlr3::Measure$help() mlr3::Measure$print() mlr3::Measure$score()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Classification Measure — MeasureClassif","text":"MeasureClassif$new() MeasureClassif$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Classification Measure — MeasureClassif","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Classification Measure — MeasureClassif","text":"","code":"MeasureClassif$new( id, param_set = ps(), range, minimize = NA, average = \"macro\", aggregator = NULL, properties = character(), predict_type = \"response\", predict_sets = \"test\", task_properties = character(), packages = character(), label = NA_character_, man = NA_character_ )"},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Classification Measure — MeasureClassif","text":"id (character(1)) Identifier new instance. param_set (paradox::ParamSet) Set hyperparameters. range (numeric(2)) Feasible range measure c(lower_bound, upper_bound). bounds may infinite. minimize (logical(1)) Set TRUE good predictions correspond small values, FALSE good predictions correspond large values. set NA (default), tuning measure possible. average (character(1)) average multiple Predictions ResampleResult. default, \"macro\", calculates individual performances scores Prediction uses function defined $aggregator average single number. set \"micro\", individual Prediction objects first combined single new Prediction object used assess performance. function $aggregator used case. aggregator (function()) Function aggregate multiple iterations. role function depends value field \"average\": \"macro\": numeric vector scores (one per iteration) passed. aggregate function defaults mean() case. \"micro\": aggregator function used. Instead, predictions multiple iterations first combined scored one go. \"custom\": ResampleResult passed aggregate function. properties (character()) Properties measure. Must subset mlr_reflections$measure_properties. Supported mlr3: \"requires_task\" (requires complete Task), \"requires_learner\" (requires trained Learner), \"requires_model\" (requires trained Learner, including fitted model), \"requires_train_set\" (requires training indices Resampling), \"na_score\" (measure expected occasionally return NA NaN). \"primary_iters\" (measure explictly handles resamplings use subset iterations point estimate). \"requires_no_prediction\" (prediction required; usually means measure extracts information learner state.). predict_type (character(1)) Required predict type Learner. Possible values stored mlr_reflections$learner_predict_types. predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". task_properties (character()) Required task properties, see Task. packages (character()) Set required packages. warning signaled constructor least one packages installed, loaded (attached) later -demand via requireNamespace(). label (character(1)) Label new instance. man (character(1)) String format [pkg]::[topic] pointing manual page object. referenced help package can opened via method $help().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Classification Measure — MeasureClassif","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Classification Measure — MeasureClassif","text":"","code":"MeasureClassif$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureClassif.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Classification Measure — MeasureClassif","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":null,"dir":"Reference","previous_headings":"","what":"Regression Measure — MeasureRegr","title":"Regression Measure — MeasureRegr","text":"measure specializes Measure regression problems: task_type set \"regr\". Possible values predict_type \"response\", \"se\" \"distr\". Predefined measures can found dictionary mlr_measures. default measure regression regr.mse.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"Regression Measure — MeasureRegr","text":"mlr3::Measure -> MeasureRegr","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Regression Measure — MeasureRegr","text":"mlr3::Measure$aggregate() mlr3::Measure$format() mlr3::Measure$help() mlr3::Measure$print() mlr3::Measure$score()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Regression Measure — MeasureRegr","text":"MeasureRegr$new() MeasureRegr$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Regression Measure — MeasureRegr","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression Measure — MeasureRegr","text":"","code":"MeasureRegr$new( id, param_set = ps(), range, minimize = NA, average = \"macro\", aggregator = NULL, properties = character(), predict_type = \"response\", predict_sets = \"test\", task_properties = character(), packages = character(), label = NA_character_, man = NA_character_ )"},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression Measure — MeasureRegr","text":"id (character(1)) Identifier new instance. param_set (paradox::ParamSet) Set hyperparameters. range (numeric(2)) Feasible range measure c(lower_bound, upper_bound). bounds may infinite. minimize (logical(1)) Set TRUE good predictions correspond small values, FALSE good predictions correspond large values. set NA (default), tuning measure possible. average (character(1)) average multiple Predictions ResampleResult. default, \"macro\", calculates individual performances scores Prediction uses function defined $aggregator average single number. set \"micro\", individual Prediction objects first combined single new Prediction object used assess performance. function $aggregator used case. aggregator (function()) Function aggregate multiple iterations. role function depends value field \"average\": \"macro\": numeric vector scores (one per iteration) passed. aggregate function defaults mean() case. \"micro\": aggregator function used. Instead, predictions multiple iterations first combined scored one go. \"custom\": ResampleResult passed aggregate function. properties (character()) Properties measure. Must subset mlr_reflections$measure_properties. Supported mlr3: \"requires_task\" (requires complete Task), \"requires_learner\" (requires trained Learner), \"requires_model\" (requires trained Learner, including fitted model), \"requires_train_set\" (requires training indices Resampling), \"na_score\" (measure expected occasionally return NA NaN). \"primary_iters\" (measure explictly handles resamplings use subset iterations point estimate). \"requires_no_prediction\" (prediction required; usually means measure extracts information learner state.). predict_type (character(1)) Required predict type Learner. Possible values stored mlr_reflections$learner_predict_types. predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". task_properties (character()) Required task properties, see Task. packages (character()) Set required packages. warning signaled constructor least one packages installed, loaded (attached) later -demand via requireNamespace(). label (character(1)) Label new instance. man (character(1)) String format [pkg]::[topic] pointing manual page object. referenced help package can opened via method $help().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Regression Measure — MeasureRegr","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression Measure — MeasureRegr","text":"","code":"MeasureRegr$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureRegr.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression Measure — MeasureRegr","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":null,"dir":"Reference","previous_headings":"","what":"Similarity Measure — MeasureSimilarity","title":"Similarity Measure — MeasureSimilarity","text":"measure specializes Measure measures quantifying similarity sets selected features. calculate similarity measures, Learner must property \"selected_features\". task_type set NA_character_. average set \"custom\". Predefined measures can found dictionary mlr_measures, prefixed \"sim.\".","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"Similarity Measure — MeasureSimilarity","text":"mlr3::Measure -> MeasureSimilarity","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Similarity Measure — MeasureSimilarity","text":"mlr3::Measure$aggregate() mlr3::Measure$format() mlr3::Measure$help() mlr3::Measure$print() mlr3::Measure$score()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Similarity Measure — MeasureSimilarity","text":"MeasureSimilarity$new() MeasureSimilarity$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Similarity Measure — MeasureSimilarity","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Similarity Measure — MeasureSimilarity","text":"","code":"MeasureSimilarity$new( id, param_set = ps(), range, minimize = NA, average = \"macro\", aggregator = NULL, properties = character(), predict_type = NA_character_, predict_sets = \"test\", task_properties = character(), packages = character(), label = NA_character_, man = NA_character_ )"},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Similarity Measure — MeasureSimilarity","text":"id (character(1)) Identifier new instance. param_set (paradox::ParamSet) Set hyperparameters. range (numeric(2)) Feasible range measure c(lower_bound, upper_bound). bounds may infinite. minimize (logical(1)) Set TRUE good predictions correspond small values, FALSE good predictions correspond large values. set NA (default), tuning measure possible. average (character(1)) average multiple Predictions ResampleResult. default, \"macro\", calculates individual performances scores Prediction uses function defined $aggregator average single number. set \"micro\", individual Prediction objects first combined single new Prediction object used assess performance. function $aggregator used case. aggregator (function()) Function aggregate multiple iterations. role function depends value field \"average\": \"macro\": numeric vector scores (one per iteration) passed. aggregate function defaults mean() case. \"micro\": aggregator function used. Instead, predictions multiple iterations first combined scored one go. \"custom\": ResampleResult passed aggregate function. properties (character()) Properties measure. Must subset mlr_reflections$measure_properties. Supported mlr3: \"requires_task\" (requires complete Task), \"requires_learner\" (requires trained Learner), \"requires_model\" (requires trained Learner, including fitted model), \"requires_train_set\" (requires training indices Resampling), \"na_score\" (measure expected occasionally return NA NaN). \"primary_iters\" (measure explictly handles resamplings use subset iterations point estimate). \"requires_no_prediction\" (prediction required; usually means measure extracts information learner state.). predict_type (character(1)) Required predict type Learner. Possible values stored mlr_reflections$learner_predict_types. predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". task_properties (character()) Required task properties, see Task. packages (character()) Set required packages. warning signaled constructor least one packages installed, loaded (attached) later -demand via requireNamespace(). label (character(1)) Label new instance. man (character(1)) String format [pkg]::[topic] pointing manual page object. referenced help package can opened via method $help().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Similarity Measure — MeasureSimilarity","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Similarity Measure — MeasureSimilarity","text":"","code":"MeasureSimilarity$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Similarity Measure — MeasureSimilarity","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/MeasureSimilarity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Similarity Measure — MeasureSimilarity","text":"","code":"task = tsk(\"penguins\") learners = list( lrn(\"classif.rpart\", maxdepth = 1, id = \"r1\"), lrn(\"classif.rpart\", maxdepth = 2, id = \"r2\") ) resampling = rsmp(\"cv\", folds = 3) grid = benchmark_grid(task, learners, resampling) bmr = benchmark(grid, store_models = TRUE) bmr$aggregate(msrs(c(\"classif.ce\", \"sim.jaccard\"))) #> nr task_id learner_id resampling_id iters classif.ce sim.jaccard #> #> 1: 1 penguins r1 cv 3 0.22400203 0.3333333 #> 2: 2 penguins r2 cv 3 0.07271803 0.4166667 #> Hidden columns: resample_result"},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":null,"dir":"Reference","previous_headings":"","what":"Abstract Prediction Object — Prediction","title":"Abstract Prediction Object — Prediction","text":"abstract base class task objects like PredictionClassif PredictionRegr. Prediction objects store following information: row ids test set corresponding true (observed) response. corresponding predicted response. Additional predictions based class predict_type. E.g., class probabilities classification estimated standard error regression. Note object usually constructed via derived classes, e.g. PredictionClassif PredictionRegr.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"s-methods","dir":"Reference","previous_headings":"","what":"S3 Methods","title":"Abstract Prediction Object — Prediction","text":".data.table(rr) Prediction -> data.table::data.table() Converts data data.table::data.table(). c(..., keep_duplicates = TRUE) (Prediction, Prediction, ...) -> Prediction Combines multiple Predictions single Prediction. keep_duplicates FALSE duplicated row ids, data former passed objects get overwritten data later passed objects.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Abstract Prediction Object — Prediction","text":"data (named list()) Internal data structure. task_type (character(1)) Required type Task. task_properties (character()) Required properties Task. predict_types (character()) Set predict types object stores. man (character(1)) String format [pkg]::[topic] pointing manual page object. Defaults NA, can set child classes.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Abstract Prediction Object — Prediction","text":"row_ids (integer()) Vector row ids predictions stored. truth () True (observed) outcome. missing (integer()) Returns row_ids predictions missing incomplete.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Abstract Prediction Object — Prediction","text":"Prediction$format() Prediction$print() Prediction$help() Prediction$score() Prediction$obs_loss() Prediction$filter() Prediction$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"Abstract Prediction Object — Prediction","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Abstract Prediction Object — Prediction","text":"","code":"Prediction$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Abstract Prediction Object — Prediction","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Abstract Prediction Object — Prediction","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Abstract Prediction Object — Prediction","text":"","code":"Prediction$print(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Abstract Prediction Object — Prediction","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"method-help-","dir":"Reference","previous_headings":"","what":"Method help()","title":"Abstract Prediction Object — Prediction","text":"Opens corresponding help page referenced field $man.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Abstract Prediction Object — Prediction","text":"","code":"Prediction$help()"},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"method-score-","dir":"Reference","previous_headings":"","what":"Method score()","title":"Abstract Prediction Object — Prediction","text":"Calculates performance provided measures Task Learner may NULL measures, measures need extract information objects. Note predict_sets measures ignored method, instead predictions used.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Abstract Prediction Object — Prediction","text":"","code":"Prediction$score( measures = NULL, task = NULL, learner = NULL, train_set = NULL )"},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Abstract Prediction Object — Prediction","text":"measures (Measure | list Measure) Measure(s) calculate. task (Task). learner (Learner). train_set (integer()).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Abstract Prediction Object — Prediction","text":"Prediction.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"method-obs-loss-","dir":"Reference","previous_headings":"","what":"Method obs_loss()","title":"Abstract Prediction Object — Prediction","text":"Calculates observation-wise loss via loss function set Measure's field obs_loss. Returns data.table() columns row_ids, truth, response one additional numeric column measure, named respective measure id. observation-wise loss function measure, column filled NA values. Note measures RMSE, $obs_loss, require additional transformation aggregation, example taking square-root.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Abstract Prediction Object — Prediction","text":"","code":"Prediction$obs_loss(measures = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Abstract Prediction Object — Prediction","text":"measures (Measure | list Measure) Measure(s) calculate.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"method-filter-","dir":"Reference","previous_headings":"","what":"Method filter()","title":"Abstract Prediction Object — Prediction","text":"Filters Prediction, keeping predictions provided row_ids. changes object -place, need create clone preserve original Prediction.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Abstract Prediction Object — Prediction","text":"","code":"Prediction$filter(row_ids)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Abstract Prediction Object — Prediction","text":"row_ids integer() Row indices.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Abstract Prediction Object — Prediction","text":"self, modified.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Abstract Prediction Object — Prediction","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Abstract Prediction Object — Prediction","text":"","code":"Prediction$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Prediction.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Abstract Prediction Object — Prediction","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":null,"dir":"Reference","previous_headings":"","what":"Prediction Object for Classification — PredictionClassif","title":"Prediction Object for Classification — PredictionClassif","text":"object wraps predictions returned learner class LearnerClassif, .e. predicted response class probabilities. response provided construction, class probabilities , response calculated probabilities: class label highest probability chosen. case ties, label selected randomly.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Prediction Object for Classification — PredictionClassif","text":"object constructed manually, make sure factor levels truth levels task, order. case binary classification tasks, positive class label must first level.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"thresholding","dir":"Reference","previous_headings":"","what":"Thresholding","title":"Prediction Object for Classification — PredictionClassif","text":"probabilities stored, possible change threshold determines predicted class label. Usually, label class highest predicted probability selected. binary classification problems, threshold defaults 0.5. cost-sensitive imbalanced classification problems, manually adjusting threshold can increase predictive performance. binary problems single threshold value can set. probability exceeds threshold, positive class predicted. probability equals threshold, label selected randomly. binary multi-class problems, named numeric vector thresholds can set. length names must correspond number classes class names, respectively. determine class label, probabilities divided threshold. results ratio > 1 probability exceeds threshold, ratio < 1 otherwise. Note possible either none multiple ratios greater 1 time. Anyway, class label maximum ratio selected. case ties ratio, one tied class labels selected randomly. Note following edge cases threshold equal 0 handled specially: threshold 0 resulting ratio gets Inf thus gets always selected. multiple ratios value Inf, one selected according ties_method (randomly per default). additionally predicted probability also 0, ratio 0/0 results NaN values. simply replaced 0 thus never get selected.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"Prediction Object for Classification — PredictionClassif","text":"mlr3::Prediction -> PredictionClassif","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Prediction Object for Classification — PredictionClassif","text":"response (factor()) Access stored predicted class labels. prob (matrix()) Access stored probabilities. confusion (matrix()) Confusion matrix, resulting comparison truth response. Truth columns, predicted response rows.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Prediction Object for Classification — PredictionClassif","text":"mlr3::Prediction$filter() mlr3::Prediction$format() mlr3::Prediction$help() mlr3::Prediction$obs_loss() mlr3::Prediction$print() mlr3::Prediction$score()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Prediction Object for Classification — PredictionClassif","text":"PredictionClassif$new() PredictionClassif$set_threshold() PredictionClassif$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Prediction Object for Classification — PredictionClassif","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prediction Object for Classification — PredictionClassif","text":"","code":"PredictionClassif$new( task = NULL, row_ids = task$row_ids, truth = task$truth(), response = NULL, prob = NULL, check = TRUE )"},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prediction Object for Classification — PredictionClassif","text":"task (TaskClassif) Task, used extract defaults row_ids truth. row_ids (integer()) Row ids predicted observations, .e. row ids test set. truth (factor()) True (observed) labels. See note manual construction. response (character() | factor()) Vector predicted class labels. One element observation test set. Character vectors automatically converted factors. See note manual construction. prob (matrix()) Numeric matrix posterior class probabilities one column class one row observation test set. Columns must named class labels, row names automatically removed. prob provided, response , class labels calculated probabilities using max.col() ties.method set \"random\". check (logical(1)) TRUE, performs argument checks predict type conversions.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"method-set-threshold-","dir":"Reference","previous_headings":"","what":"Method set_threshold()","title":"Prediction Object for Classification — PredictionClassif","text":"Sets prediction response based provided threshold. See section thresholding information.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Prediction Object for Classification — PredictionClassif","text":"","code":"PredictionClassif$set_threshold(threshold, ties_method = \"random\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prediction Object for Classification — PredictionClassif","text":"threshold (numeric()). ties_method (character(1)) One \"random\", \"first\" \"last\" (c.f. max.col()) determine deal tied probabilities.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Prediction Object for Classification — PredictionClassif","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Prediction Object for Classification — PredictionClassif","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Prediction Object for Classification — PredictionClassif","text":"","code":"PredictionClassif$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prediction Object for Classification — PredictionClassif","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionClassif.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prediction Object for Classification — PredictionClassif","text":"","code":"task = tsk(\"penguins\") learner = lrn(\"classif.rpart\", predict_type = \"prob\") learner$train(task) p = learner$predict(task) p$predict_types #> [1] \"response\" \"prob\" head(as.data.table(p)) #> row_ids truth response prob.Adelie prob.Chinstrap prob.Gentoo #> #> 1: 1 Adelie Adelie 0.9668874 0.03311258 0 #> 2: 2 Adelie Adelie 0.9668874 0.03311258 0 #> 3: 3 Adelie Adelie 0.9668874 0.03311258 0 #> 4: 4 Adelie Adelie 0.9668874 0.03311258 0 #> 5: 5 Adelie Adelie 0.9668874 0.03311258 0 #> 6: 6 Adelie Adelie 0.9668874 0.03311258 0 # confusion matrix p$confusion #> truth #> response Adelie Chinstrap Gentoo #> Adelie 146 5 0 #> Chinstrap 6 63 1 #> Gentoo 0 0 123 # change threshold th = c(0.05, 0.9, 0.05) names(th) = task$class_names # new predictions p$set_threshold(th)$response #> [1] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [11] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [21] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [31] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [41] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [51] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [61] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [71] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [81] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [91] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [101] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [111] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [121] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [131] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [141] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [151] Adelie Adelie Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [161] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [171] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [181] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [191] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [201] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [211] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [221] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [231] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [241] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [251] Adelie Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [261] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo #> [271] Gentoo Gentoo Gentoo Gentoo Gentoo Gentoo Adelie Adelie Adelie Adelie #> [281] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [291] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [301] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [311] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [321] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [331] Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie Adelie #> [341] Adelie Adelie Adelie Adelie #> Levels: Adelie Chinstrap Gentoo p$score(measures = msr(\"classif.ce\")) #> classif.ce #> 0.2005814"},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionData.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to PredictionData — PredictionData","title":"Convert to PredictionData — PredictionData","text":"Objects type PredictionData serve intermediate representation objects type Prediction. internal data structure, implemented optimize runtime solve issues emerging serializing R6 objects. End-users typically need worry details, package developers advised continue reading technical information. Unlike mlr3 objects, PredictionData relies S3 class system. following operations must supported extend mlr3 new task types: as_prediction_data() converts objects class PredictionData, e.g. objects type Prediction. as_prediction() converts objects class Prediction, e.g. objects type PredictionData. check_prediction_data() called return value predict method Learner perform assertions type conversions. Returns update object class PredictionData. is_missing_prediction_data() used fallback learner (see Learner) impute missing predictions. Returns vector row ids need imputation.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to PredictionData — PredictionData","text":"","code":"create_empty_prediction_data(task, learner) check_prediction_data(pdata, ...) is_missing_prediction_data(pdata, ...) filter_prediction_data(pdata, row_ids, ...) # S3 method for class 'PredictionDataClassif' check_prediction_data(pdata, train_task, ...) # S3 method for class 'PredictionDataClassif' is_missing_prediction_data(pdata, ...) # S3 method for class 'PredictionDataClassif' c(..., keep_duplicates = TRUE) # S3 method for class 'PredictionDataRegr' check_prediction_data(pdata, ...) # S3 method for class 'PredictionDataRegr' is_missing_prediction_data(pdata, ...) # S3 method for class 'PredictionDataRegr' c(..., keep_duplicates = TRUE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to PredictionData — PredictionData","text":"task (Task). learner (Learner). pdata (PredictionData) Named list inheriting \"PredictionData\". ... (one PredictionData objects). row_ids integer() Row indices. train_task (Task) Task used training learner. keep_duplicates (logical(1)) TRUE, combined PredictionData object filtered duplicated row ids (starting last).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":null,"dir":"Reference","previous_headings":"","what":"Prediction Object for Regression — PredictionRegr","title":"Prediction Object for Regression — PredictionRegr","text":"object wraps predictions returned learner class LearnerRegr, .e. predicted response standard error. Additionally, probability distributions implemented package distr6 supported.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"Prediction Object for Regression — PredictionRegr","text":"mlr3::Prediction -> PredictionRegr","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Prediction Object for Regression — PredictionRegr","text":"response (numeric()) Access stored predicted response. se (numeric()) Access stored standard error. quantiles (matrix()) Matrix predicted quantiles. Observations rows, quantile (ascending order) columns. distr (VectorDistribution) Access stored vector distribution. Requires package distr6(repository https://raphaels1.r-universe.dev) .","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Prediction Object for Regression — PredictionRegr","text":"mlr3::Prediction$filter() mlr3::Prediction$format() mlr3::Prediction$help() mlr3::Prediction$obs_loss() mlr3::Prediction$print() mlr3::Prediction$score()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Prediction Object for Regression — PredictionRegr","text":"PredictionRegr$new() PredictionRegr$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Prediction Object for Regression — PredictionRegr","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prediction Object for Regression — PredictionRegr","text":"","code":"PredictionRegr$new( task = NULL, row_ids = task$row_ids, truth = task$truth(), response = NULL, se = NULL, quantiles = NULL, distr = NULL, check = TRUE )"},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prediction Object for Regression — PredictionRegr","text":"task (TaskRegr) Task, used extract defaults row_ids truth. row_ids (integer()) Row ids predicted observations, .e. row ids test set. truth (numeric()) True (observed) response. response (numeric()) Vector numeric response values. One element observation test set. se (numeric()) Numeric vector predicted standard errors. One element observation test set. quantiles (matrix()) Numeric matrix predicted quantiles. One row per observation, one column per quantile. distr (VectorDistribution)VectorDistribution package distr6 (repository https://raphaels1.r-universe.dev). individual distribution vector represents random variable 'survival time' individual observation. check (logical(1)) TRUE, performs argument checks predict type conversions.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Prediction Object for Regression — PredictionRegr","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Prediction Object for Regression — PredictionRegr","text":"","code":"PredictionRegr$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prediction Object for Regression — PredictionRegr","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/PredictionRegr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prediction Object for Regression — PredictionRegr","text":"","code":"task = tsk(\"ames_housing\") learner = lrn(\"regr.featureless\", predict_type = \"se\") p = learner$train(task)$predict(task) p$predict_types #> [1] \"response\" \"se\" head(as.data.table(p)) #> row_ids truth response se #> #> 1: 1 215000 180796.1 79886.69 #> 2: 2 105000 180796.1 79886.69 #> 3: 3 172000 180796.1 79886.69 #> 4: 4 244000 180796.1 79886.69 #> 5: 5 189900 180796.1 79886.69 #> 6: 6 195500 180796.1 79886.69"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":null,"dir":"Reference","previous_headings":"","what":"Container for Results of resample() — ResampleResult","title":"Container for Results of resample() — ResampleResult","text":"result container object returned resample(). Note stored objects accessed reference. modify object without cloning first. ResampleResults can visualized via mlr3viz's autoplot() function.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"s-methods","dir":"Reference","previous_headings":"","what":"S3 Methods","title":"Container for Results of resample() — ResampleResult","text":".data.table(rr, reassemble_learners = TRUE, convert_predictions = TRUE, predict_sets = \"test\") ResampleResult -> data.table::data.table() Returns tabular view internal data. c(...) (ResampleResult, ...) -> BenchmarkResult Combines multiple objects convertible BenchmarkResult new BenchmarkResult.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Container for Results of resample() — ResampleResult","text":"task_type (character(1)) Task type objects ResampleResult, e.g. \"classif\" \"regr\". NA empty ResampleResults. uhash (character(1)) Unique hash object. iters (integer(1)) Number resampling iterations stored ResampleResult. task (Task) task resample() operated . learner (Learner) Learner prototype resample() operated . list trained learners, see methods $learners(). resampling (Resampling) Instantiated Resampling object stores splits training test. learners (list Learner) List trained learners, sorted resampling iteration. warnings (data.table::data.table()) table warning messages. Column names \"iteration\" \"msg\". Note can multiple rows per resampling iteration multiple warnings recorded. errors (data.table::data.table()) table error messages. Column names \"iteration\" \"msg\". Note can multiple rows per resampling iteration multiple errors recorded.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Container for Results of resample() — ResampleResult","text":"ResampleResult$new() ResampleResult$format() ResampleResult$print() ResampleResult$help() ResampleResult$prediction() ResampleResult$predictions() ResampleResult$score() ResampleResult$obs_loss() ResampleResult$aggregate() ResampleResult$filter() ResampleResult$discard() ResampleResult$marshal() ResampleResult$unmarshal() ResampleResult$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Container for Results of resample() — ResampleResult","text":"Creates new instance R6 class. alternative construction method provided as_resample_result().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$new(data = ResultData$new(), view = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"data (ResultData | data.table()) object type ResultData, either extracted another ResampleResult, another BenchmarkResult, manually constructed as_result_data(). view (character()) Single uhash ResultData operate . Used internally optimizations.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"Container for Results of resample() — ResampleResult","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Container for Results of resample() — ResampleResult","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$print(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-help-","dir":"Reference","previous_headings":"","what":"Method help()","title":"Container for Results of resample() — ResampleResult","text":"Opens corresponding help page referenced field $man.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$help()"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-prediction-","dir":"Reference","previous_headings":"","what":"Method prediction()","title":"Container for Results of resample() — ResampleResult","text":"Combined Prediction individual resampling iterations, provided predict sets. Note , per default, performance measures operate object directly, instead prediction objects resampling iterations separately, combine performance scores aggregate function respective Measure (macro averaging). calculate performance prediction object directly, called micro averaging.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$prediction(predict_sets = \"test\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"predict_sets (character()) Subset {\"train\", \"test\"}.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Results of resample() — ResampleResult","text":"Prediction empty list() predictions available.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-predictions-","dir":"Reference","previous_headings":"","what":"Method predictions()","title":"Container for Results of resample() — ResampleResult","text":"List prediction objects, sorted resampling iteration. multiple sets given, combined single one iteration. evaluate performance returned prediction objects average , called macro averaging. micro averaging, operate combined prediction object returned $prediction().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$predictions(predict_sets = \"test\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"predict_sets (character()) Subset {\"train\", \"test\", \"internal_valid\"}.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Results of resample() — ResampleResult","text":"List Prediction objects, one per element predict_sets. list empty list()s predictions available.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-score-","dir":"Reference","previous_headings":"","what":"Method score()","title":"Container for Results of resample() — ResampleResult","text":"Returns table one row resampling iteration, including involved objects: Task, Learner, Resampling, iteration number (integer(1)), (enabled) one Prediction predict set Learner. Additionally, column individual (per resampling iteration) performance added Measure measures, named id respective measure id. measures NULL, measures defaults return value default_measures().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$score( measures = NULL, ids = TRUE, conditions = FALSE, predictions = TRUE )"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"measures (Measure | list Measure) Measure(s) calculate. ids (logical(1)) ids TRUE, extra columns ids objects (\"task_id\", \"learner_id\", \"resampling_id\") added returned table. allow subset conveniently. conditions (logical(1)) Adds condition messages (\"warnings\", \"errors\") extra list columns character vectors returned table predictions (logical(1)) Additionally return prediction objects, one column predict_set learner. Columns named \"prediction_train\", \"prediction_test\" \"prediction_internal_valid\", present.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Results of resample() — ResampleResult","text":"data.table::data.table().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-obs-loss-","dir":"Reference","previous_headings":"","what":"Method obs_loss()","title":"Container for Results of resample() — ResampleResult","text":"Calculates observation-wise loss via loss function set Measure's field obs_loss. Returns data.table() columns matching Prediction object plus one additional numeric column measure, named respective measure id. observation-wise loss function measure, column filled NA values. Note measures RMSE, $obs_loss, require additional transformation aggregation, example taking square-root.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$obs_loss(measures = NULL, predict_sets = \"test\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"measures (Measure | list Measure) Measure(s) calculate. predict_sets (character()) predict sets.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-aggregate-","dir":"Reference","previous_headings":"","what":"Method aggregate()","title":"Container for Results of resample() — ResampleResult","text":"Calculates aggregates performance values provided measures, according respective aggregation function Measure. measures NULL, measures defaults return value default_measures().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$aggregate(measures = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"measures (Measure | list Measure) Measure(s) calculate.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Results of resample() — ResampleResult","text":"Named numeric().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-filter-","dir":"Reference","previous_headings":"","what":"Method filter()","title":"Container for Results of resample() — ResampleResult","text":"Subsets ResampleResult, reducing keep iterations specified iters.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$filter(iters)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"iters (integer()) Resampling iterations keep.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Results of resample() — ResampleResult","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-discard-","dir":"Reference","previous_headings":"","what":"Method discard()","title":"Container for Results of resample() — ResampleResult","text":"Shrinks ResampleResult discarding parts internally stored data. Note certain operations might stop work, e.g. extracting importance values learners calculating measures requiring task's data.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$discard(backends = FALSE, models = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-9","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"backends (logical(1)) TRUE, DataBackend removed stored Tasks. models (logical(1)) TRUE, stored model removed Learners.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"Container for Results of resample() — ResampleResult","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-marshal-","dir":"Reference","previous_headings":"","what":"Method marshal()","title":"Container for Results of resample() — ResampleResult","text":"Marshals stored models.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-11","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$marshal(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-10","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"... () Additional arguments passed marshal_model().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-unmarshal-","dir":"Reference","previous_headings":"","what":"Method unmarshal()","title":"Container for Results of resample() — ResampleResult","text":"Unmarshals stored models.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-12","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$unmarshal(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-11","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"... () Additional arguments passed unmarshal_model().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Container for Results of resample() — ResampleResult","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"usage-13","dir":"Reference","previous_headings":"","what":"Usage","title":"Container for Results of resample() — ResampleResult","text":"","code":"ResampleResult$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"arguments-12","dir":"Reference","previous_headings":"","what":"Arguments","title":"Container for Results of resample() — ResampleResult","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResampleResult.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Container for Results of resample() — ResampleResult","text":"","code":"task = tsk(\"penguins\") learner = lrn(\"classif.rpart\") resampling = rsmp(\"cv\", folds = 3) rr = resample(task, learner, resampling) print(rr) #> with 3 resampling iterations #> task_id learner_id resampling_id iteration prediction_test warnings #> penguins classif.rpart cv 1 0 #> penguins classif.rpart cv 2 0 #> penguins classif.rpart cv 3 0 #> errors #> 0 #> 0 #> 0 # combined predictions and predictions for each fold separately rr$prediction() #> for 344 observations: #> row_ids truth response #> 2 Adelie Adelie #> 9 Adelie Adelie #> 13 Adelie Adelie #> --- --- --- #> 337 Chinstrap Gentoo #> 340 Chinstrap Gentoo #> 342 Chinstrap Chinstrap rr$predictions() #> [[1]] #> for 115 observations: #> row_ids truth response #> 2 Adelie Adelie #> 9 Adelie Adelie #> 13 Adelie Adelie #> --- --- --- #> 321 Chinstrap Chinstrap #> 334 Chinstrap Chinstrap #> 335 Chinstrap Chinstrap #> #> [[2]] #> for 115 observations: #> row_ids truth response #> 3 Adelie Adelie #> 5 Adelie Adelie #> 6 Adelie Adelie #> --- --- --- #> 341 Chinstrap Adelie #> 343 Chinstrap Gentoo #> 344 Chinstrap Chinstrap #> #> [[3]] #> for 114 observations: #> row_ids truth response #> 1 Adelie Adelie #> 4 Adelie Adelie #> 15 Adelie Adelie #> --- --- --- #> 337 Chinstrap Gentoo #> 340 Chinstrap Gentoo #> 342 Chinstrap Chinstrap #> # folds scored separately, then aggregated (macro) rr$aggregate(msr(\"classif.acc\")) #> classif.acc #> 0.9273837 # predictions first combined, then scored (micro) rr$prediction()$score(msr(\"classif.acc\")) #> classif.acc #> 0.9273256 # check for warnings and errors rr$warnings #> Empty data.table (0 rows and 2 cols): iteration,msg rr$errors #> Empty data.table (0 rows and 2 cols): iteration,msg"},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":null,"dir":"Reference","previous_headings":"","what":"Resampling Class — Resampling","title":"Resampling Class — Resampling","text":"abstract base class resampling objects like ResamplingCV ResamplingBootstrap. objects class define task partitioned resampling (e.g., resample() benchmark()), using set hyperparameters number folds cross-validation. Resampling objects can instantiated Task, applies strategy task manifests fixed partition row_ids Task. Predefined resamplings stored dictionary mlr_resamplings, e.g. cv bootstrap.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"stratification","dir":"Reference","previous_headings":"","what":"Stratification","title":"Resampling Class — Resampling","text":"derived classes support stratified sampling. stratification variables assumed discrete must stored Task column role \"stratum\". case multiple stratification variables, combination values stratification variables forms strata. First, observations divided subpopulations based one multiple stratification variables (assumed discrete), c.f. task$strata. Second, sampling performed k subpopulations separately. subgroup divided iter training sets iter test sets derived Resampling. sets merged based iteration number: training sets subpopulations iteration 1 combined, training sets iteration 2, . done test sets. merged sets can accessed via $train_set() $test_set(), respectively. Note procedure can lead set sizes slightly different without stratification.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"grouping-blocking","dir":"Reference","previous_headings":"","what":"Grouping / Blocking","title":"Resampling Class — Resampling","text":"derived classes support grouping observations. grouping variable assumed discrete must stored Task column role \"group\". Observations group treated like \"block\" observations must kept together. observations either go together training set together test set. sampling performed derived Resampling grouping variable. Next, grouping information replaced respective row ids generate training test sets. sets can accessed via $train_set() $test_set(), respectively.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Resampling Class — Resampling","text":"label (character(1)) Label object. Can used tables, plot text output instead ID. param_set (paradox::ParamSet) Set hyperparameters. instance () instantiate(), instance stored slot arbitrary format. Note grouping variable present Task, Resampling may operate group ids internally instead row ids (may lead confusion). advised work directly instance, instead use getters $train_set() $test_set(). task_hash (character(1)) hash Task passed r$instantiate(). task_phash (character(1)) phash Task passed r$instantiate(). hash task without features. task_nrow (integer(1)) number observations Task passed r$instantiate(). duplicated_ids (logical(1)) TRUE, duplicated rows can occur within single training set within single test set. E.g., TRUE Bootstrap, FALSE cross-validation. used internally. man (character(1)) String format [pkg]::[topic] pointing manual page object. Defaults NA, can set child classes.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Resampling Class — Resampling","text":"id (character(1)) Identifier object. Used tables, plot text output. is_instantiated (logical(1)) TRUE resampling instantiated. hash (character(1)) Hash (unique identifier) object. object instantiated yet, NA_character_ returned. hash calculated based class name, id, parameter set, instance.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Resampling Class — Resampling","text":"Resampling$new() Resampling$format() Resampling$print() Resampling$help() Resampling$instantiate() Resampling$train_set() Resampling$test_set() Resampling$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Resampling Class — Resampling","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Resampling Class — Resampling","text":"","code":"Resampling$new( id, param_set = ps(), duplicated_ids = FALSE, label = NA_character_, man = NA_character_ )"},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Resampling Class — Resampling","text":"id (character(1)) Identifier new instance. param_set (paradox::ParamSet) Set hyperparameters. duplicated_ids (logical(1)) Set TRUE resampling strategy may duplicated row ids single training set test set. Note object typically constructed via derived classes, e.g. ResamplingCV ResamplingHoldout. label (character(1)) Label new instance. man (character(1)) String format [pkg]::[topic] pointing manual page object. referenced help package can opened via method $help().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"Resampling Class — Resampling","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Resampling Class — Resampling","text":"","code":"Resampling$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Resampling Class — Resampling","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Resampling Class — Resampling","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Resampling Class — Resampling","text":"","code":"Resampling$print(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Resampling Class — Resampling","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"method-help-","dir":"Reference","previous_headings":"","what":"Method help()","title":"Resampling Class — Resampling","text":"Opens corresponding help page referenced field $man.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Resampling Class — Resampling","text":"","code":"Resampling$help()"},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"method-instantiate-","dir":"Reference","previous_headings":"","what":"Method instantiate()","title":"Resampling Class — Resampling","text":"Materializes fixed training test splits given task stores r$instance arbitrary format.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Resampling Class — Resampling","text":"","code":"Resampling$instantiate(task)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Resampling Class — Resampling","text":"task (Task) Task used instantiation.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Resampling Class — Resampling","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"method-train-set-","dir":"Reference","previous_headings":"","what":"Method train_set()","title":"Resampling Class — Resampling","text":"Returns row ids -th training set.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Resampling Class — Resampling","text":"","code":"Resampling$train_set(i)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Resampling Class — Resampling","text":"(integer(1)) Iteration.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Resampling Class — Resampling","text":"(integer()) row ids.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"method-test-set-","dir":"Reference","previous_headings":"","what":"Method test_set()","title":"Resampling Class — Resampling","text":"Returns row ids -th test set.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Resampling Class — Resampling","text":"","code":"Resampling$test_set(i)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Resampling Class — Resampling","text":"(integer(1)) Iteration.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Resampling Class — Resampling","text":"(integer()) row ids.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Resampling Class — Resampling","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Resampling Class — Resampling","text":"","code":"Resampling$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"Resampling Class — Resampling","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Resampling.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Resampling Class — Resampling","text":"","code":"r = rsmp(\"subsampling\") # Default parametrization r$param_set$values #> $ratio #> [1] 0.6666667 #> #> $repeats #> [1] 30 #> # Do only 3 repeats on 10% of the data r$param_set$values = list(ratio = 0.1, repeats = 3) r$param_set$values #> $ratio #> [1] 0.1 #> #> $repeats #> [1] 3 #> # Instantiate on penguins task task = tsk(\"penguins\") r$instantiate(task) # Extract train/test sets train_set = r$train_set(1) print(train_set) #> [1] 42 75 33 106 32 249 85 300 190 96 40 79 224 199 270 304 89 259 279 #> [20] 343 317 123 318 195 255 188 49 284 205 337 233 307 31 230 intersect(train_set, r$test_set(1)) #> integer(0) # Another example: 10-fold CV r = rsmp(\"cv\")$instantiate(task) r$train_set(1) #> [1] 10 12 15 22 79 97 104 126 133 135 136 137 139 141 159 166 172 183 #> [19] 184 186 188 225 228 237 250 253 264 271 275 279 298 312 326 329 340 5 #> [37] 6 20 28 42 47 58 72 80 81 82 107 117 119 123 130 164 168 169 #> [55] 185 191 197 209 215 227 234 244 249 266 270 276 280 300 311 316 4 7 #> [73] 16 33 48 51 52 54 59 67 70 88 103 121 138 155 173 176 179 196 #> [91] 201 204 239 261 267 284 290 299 304 305 308 328 330 337 339 19 34 35 #> [109] 44 77 84 85 90 92 93 109 112 116 124 145 158 162 200 203 206 207 #> [127] 212 213 221 226 241 245 274 277 287 289 301 310 322 2 23 24 32 41 #> [145] 61 71 74 83 101 105 106 128 143 144 149 153 154 193 195 218 220 230 #> [163] 247 248 257 268 272 286 303 313 314 324 332 18 25 31 40 50 62 65 #> [181] 69 96 114 122 125 131 140 156 165 174 175 194 217 251 258 263 269 281 #> [199] 285 288 294 297 327 331 333 334 343 17 27 29 56 57 89 94 98 100 #> [217] 102 108 120 146 147 170 181 182 205 211 216 219 222 223 231 256 265 282 #> [235] 291 295 309 319 341 342 344 14 21 30 38 39 45 53 60 66 73 75 #> [253] 95 111 132 163 171 199 202 232 235 236 242 252 254 262 283 293 296 302 #> [271] 307 318 321 323 325 3 8 9 36 46 49 63 64 76 78 110 113 129 #> [289] 134 142 148 157 160 161 180 187 189 192 224 229 240 243 255 278 306 317 #> [307] 320 336 338 # Stratification task = tsk(\"pima\") prop.table(table(task$truth())) # moderately unbalanced #> #> pos neg #> 0.3489583 0.6510417 task$col_roles$stratum = task$target_names r = rsmp(\"subsampling\") r$instantiate(task) prop.table(table(task$truth(r$train_set(1)))) # roughly same proportion #> #> pos neg #> 0.3496094 0.6503906"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":null,"dir":"Reference","previous_headings":"","what":"ResultData — ResultData","title":"ResultData — ResultData","text":"Internal object store results list data.tables, arranged star schema. advised directly work data structure may changed future without warnings. main motivation data structure necessity avoid storing duplicated R6 objects. usually problem single R session, serialization via serialize() (used save()/saveRDS() parallelization) leads objects unreasonable memory requirements.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"ResultData — ResultData","text":"data (list()) List data.table::data.table(), arranged star schema. operate directly list.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"ResultData — ResultData","text":"task_type (character(1)) Returns task type stored objects, e.g. \"classif\" \"regr\". Returns NULL ResultData empty.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"ResultData — ResultData","text":"ResultData$new() ResultData$uhashes() ResultData$iterations() ResultData$tasks() ResultData$learners() ResultData$learner_states() ResultData$resamplings() ResultData$predictions() ResultData$prediction() ResultData$combine() ResultData$sweep() ResultData$marshal() ResultData$unmarshal() ResultData$discard() ResultData$as_data_table() ResultData$logs() ResultData$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"ResultData — ResultData","text":"Creates new instance R6 class. alternative construction method provided as_result_data().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$new(data = NULL, store_backends = TRUE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"data (data.table::data.table()) | NULL) initialize object , use as_result_data() instead. store_backends (logical(1)) set FALSE, backends Tasks provided data removed.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-uhashes-","dir":"Reference","previous_headings":"","what":"Method uhashes()","title":"ResultData — ResultData","text":"Returns unique hashes (uhash values) included ResampleResults.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$uhashes(view = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results .","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"character().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-iterations-","dir":"Reference","previous_headings":"","what":"Method iterations()","title":"ResultData — ResultData","text":"Returns number recorded iterations / experiments.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$iterations(view = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results .","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"integer(1).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-tasks-","dir":"Reference","previous_headings":"","what":"Method tasks()","title":"ResultData — ResultData","text":"Returns table included Tasks.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$tasks(view = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results .","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"data.table() columns \"task_hash\" (character()) \"task\" (Task).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-learners-","dir":"Reference","previous_headings":"","what":"Method learners()","title":"ResultData — ResultData","text":"Returns table included Learners.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$learners(view = NULL, states = TRUE, reassemble = TRUE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results . states (logical(1)) TRUE, returns learner iteration/experiment ResultData object. FALSE, returns exemplary learner (without state) ResampleResult. reassemble (logical(1)) Reassemble learners, .e. re-set state hyperparameters stored separately returning learners.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"data.table() columns \"learner_hash\" (character()) \"learner\" (Learner).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-learner-states-","dir":"Reference","previous_headings":"","what":"Method learner_states()","title":"ResultData — ResultData","text":"Returns list states included Learners without reassembling learners. @return list list()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$learner_states(view = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results .","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-resamplings-","dir":"Reference","previous_headings":"","what":"Method resamplings()","title":"ResultData — ResultData","text":"Returns table included Resamplings.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$resamplings(view = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results .","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"data.table() columns \"resampling_hash\" (character()) \"resampling\" (Resampling).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-predictions-","dir":"Reference","previous_headings":"","what":"Method predictions()","title":"ResultData — ResultData","text":"Returns list Prediction objects.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$predictions(view = NULL, predict_sets = \"test\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results . predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"list() Prediction.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-prediction-","dir":"Reference","previous_headings":"","what":"Method prediction()","title":"ResultData — ResultData","text":"Returns combined Prediction objects.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$prediction(view = NULL, predict_sets = \"test\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results . predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-6","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"Prediction.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-combine-","dir":"Reference","previous_headings":"","what":"Method combine()","title":"ResultData — ResultData","text":"Combines multiple ResultData objects, modifying self -place.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$combine(rdata)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-9","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"rdata (ResultData).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-7","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"self (invisibly).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-sweep-","dir":"Reference","previous_headings":"","what":"Method sweep()","title":"ResultData — ResultData","text":"Updates ResultData object, removing rows tables referenced fact table anymore. E.g., can called filtering/subsetting fact table.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$sweep()"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-8","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"Modified self (invisibly).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-marshal-","dir":"Reference","previous_headings":"","what":"Method marshal()","title":"ResultData — ResultData","text":"Marshals stored learner models. nothing models already marshaled.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-11","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$marshal(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-10","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"... () Additional arguments passed marshal_model().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-unmarshal-","dir":"Reference","previous_headings":"","what":"Method unmarshal()","title":"ResultData — ResultData","text":"Unmarshals stored learner models. nothing models marshaled.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-12","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$unmarshal(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-11","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"... () Additional arguments passed unmarshal_model().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-discard-","dir":"Reference","previous_headings":"","what":"Method discard()","title":"ResultData — ResultData","text":"Shrinks object discarding parts stored data.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-13","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$discard(backends = FALSE, models = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-12","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"backends (logical(1)) TRUE, DataBackend removed stored Tasks. models (logical(1)) TRUE, stored model removed Learners.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-9","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"Modified self (invisibly).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-as-data-table-","dir":"Reference","previous_headings":"","what":"Method as_data_table()","title":"ResultData — ResultData","text":"Combines internal tables single flat data.table().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-14","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$as_data_table( view = NULL, reassemble_learners = TRUE, convert_predictions = TRUE, predict_sets = \"test\" )"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-13","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results . reassemble_learners (logical(1)) Reassemble tasks? convert_predictions (logical(1)) Convert PredictionData Prediction? predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\". predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-logs-","dir":"Reference","previous_headings":"","what":"Method logs()","title":"ResultData — ResultData","text":"Get table recorded learner logs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-15","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$logs(view = NULL, condition)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-14","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"view character(1) Single uhash restrict results . condition (character(1)) condition extract. One \"message\", \"warning\" \"error\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"returns-10","dir":"Reference","previous_headings":"","what":"Returns","title":"ResultData — ResultData","text":"data.table::data.table().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"ResultData — ResultData","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"usage-16","dir":"Reference","previous_headings":"","what":"Usage","title":"ResultData — ResultData","text":"","code":"ResultData$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"arguments-15","dir":"Reference","previous_headings":"","what":"Arguments","title":"ResultData — ResultData","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ResultData.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ResultData — ResultData","text":"","code":"# table overview print(ResultData$new()$data) #> $fact #> Key: #> Empty data.table (0 rows and 8 cols): uhash,iteration,learner_state,prediction,learner_hash,task_hash... #> #> $uhashes #> Empty data.table (0 rows and 1 cols): uhash #> #> $tasks #> Key: #> Empty data.table (0 rows and 2 cols): task_hash,task #> #> $learners #> Key: #> Empty data.table (0 rows and 2 cols): learner_phash,learner #> #> $resamplings #> Key: #> Empty data.table (0 rows and 2 cols): resampling_hash,resampling #> #> $learner_components #> Key: #> Empty data.table (0 rows and 2 cols): learner_hash,learner_param_vals #>"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":null,"dir":"Reference","previous_headings":"","what":"Task Class — Task","title":"Task Class — Task","text":"abstract base class TaskSupervised TaskUnsupervised. TaskClassif TaskRegr inherit TaskSupervised. supervised tasks implemented mlr3proba, unsupervised cluster tasks package mlr3cluster. Tasks serve two purposes: Tasks wrap DataBackend, object transparently interface different data storage types. Tasks store meta-information, role individual columns DataBackend. example, classification task single column must marked target column, others features. Predefined (toy) tasks stored dictionary mlr_tasks, e.g. penguins ames_housing. toy tasks can found dictionary loading mlr3data.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"s-methods","dir":"Reference","previous_headings":"","what":"S3 methods","title":"Task Class — Task","text":".data.table(t) Task -> data.table::data.table() Returns complete data data.table::data.table(). head(t) Calls head() task's data. summary(t) Calls summary() task's data.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"task-mutators","dir":"Reference","previous_headings":"","what":"Task mutators","title":"Task Class — Task","text":"following methods change task -place: modification lists $col_roles $row_roles. provides different \"view\" data without altering data . may affects, e.g., $data, $nrow, $ncol, n_features, row_ids, $feature_names. Altering $col_roles may affect, e.g., $data, $ncol, $n_features, $feature_names. Altering $row_roles may affect, e.g., $data, $nrow, $row_ids. Modification column row roles via $set_col_roles() $set_row_roles(), respectively. alternative directly accessing $col_roles $row_roles, side effects. $select() $filter() subset set active features rows $col_roles $row_roles, respectively. $cbind() $rbind() change task -place binding new columns rows data. $rename() changes column names. $set_levels() $droplevels() update field $col_info() automatically repair factor levels querying data $data().","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Task Class — Task","text":"label (character(1)) Label object. Can used tables, plot text output instead ID. task_type (character(1)) Task type, e.g. \"classif\" \"regr\". complete list possible task types (depending loaded packages), see mlr_reflections$task_types$type. backend (DataBackend) Abstract interface data task. col_info (data.table::data.table()) Table 4 columns, mainly internal purposes: \"id\" (character()) stores name column. \"type\" (character()) holds storage type variable, e.g. integer, numeric character. See mlr_reflections$task_feature_types complete list allowed types. \"levels\" (list()) stores vector distinct values (levels) ordered unordered factor variables. \"label\" (character()) stores vector prettier, formated column names. \"fix_factor_levels\" (logical()) stores flags determine levels respective variable need reordered querying data DataBackend. Note columns DataBackend, also columns selected role, listed table. man (character(1)) String format [pkg]::[topic] pointing manual page object. Defaults NA, can set child classes. extra_args (named list()) Additional arguments set construction. Required convert_task(). mlr3_version (package_version) Package version mlr3 used create task.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Task Class — Task","text":"id (character(1)) Identifier object. Used tables, plot text output. internal_valid_task (Task integer() NULL) Optional validation task can, e.g., used early stopping learners XGBoost. See also $validate field Learner. integers assigned removed primary task internal validation task ids created primary task using ids. assigning new task, always cloned. hash (character(1)) Hash (unique identifier) object. hash calculated based complete task object $row_ids. internal validation task set, hash recalculated. phash (character(1)) Hash (unique identifier) partial object, excluding components varied systematically feature selection ($col_roles). row_ids (positive integer()) Returns row ids DataBackend observations role \"use\". row_names (data.table::data.table()) Returns table two columns: \"row_id\" (integer()), \"row_name\" (character()). feature_names (character()) Returns column names role == \"feature\". Note vector determines default order columns task$data(cols = NULL, ...). However, recommended rely order columns, instead always address columns name. default order well defined operations, e.g. task$cbind() processing via mlr3pipelines. target_names (character()) Returns column names role \"target\". properties (character()) Set task properties. Possible properties stored mlr_reflections$task_properties. following properties currently standardized understood tasks mlr3: \"strata\": task resampled using one stratification variables (role \"stratum\"). \"groups\": task comes grouping/blocking information (role \"group\"). \"weights\": task comes observation weights (role \"weight\"). Note listed properties calculated $col_roles may set explicitly. row_roles (named list()) row (observation) can arbitrary number roles learning task: \"use\": Use train / predict / resampling. row_roles named list whose elements named row role element integer() vector row ids. alter roles, just modify list, e.g. R's set functions (intersect(), setdiff(), union(), ...). col_roles (named list()) column can one following groups fulfill different roles: \"feature\": Regular feature used model fitting process. \"target\": Target variable. tasks accept single target column. \"name\": Row names / observation labels. used plots. Can queried $row_names. single column can associated role. \"order\": Data returned $data() ordered column (columns). Columns must sortable order(). \"group\": resampling, observations value variable role \"group\" marked \"belonging together\". resampling iteration, observations group exclusively assigned either training set test set. single column can associated role. \"stratum\": Stratification variables. Multiple discrete columns may role. \"weight\": Observation weights. one numeric column may role. col_roles named list whose elements named column role element character() vector column names. alter roles, just modify list, e.g. R's set functions (intersect(), setdiff(), union(), ...). method $set_col_roles provides convenient alternative assign columns roles. nrow (integer(1)) Returns total number rows role \"use\". ncol (integer(1)) Returns total number columns role \"target\" \"feature\". n_features (integer(1)) Returns total number columns role \"feature\" (.e. number \"active\" features task). feature_types (data.table::data.table()) Returns table columns id type id column names \"active\" features task type storage type. data_formats (character()) Supported data format. Always \"data.table\".. deprecated removed future. strata (data.table::data.table()) task columns designated role \"stratum\", returns table one subpopulation per row two columns: N (integer()) number observations subpopulation, row_id (list integer()) list column row ids respective subpopulation. Returns NULL stratification variable. See Resampling information stratification. groups (data.table::data.table()) task column designated role \"group\", table two columns: row_id (integer()), grouping variable group (vector()). Returns NULL grouping column. See Resampling information grouping. order (data.table::data.table()) task least one column designated role \"order\", table two columns: row_id (integer()), ordering vector order (integer()). Returns NULL order column. weights (data.table::data.table()) task column designated role \"weight\", table two columns: row_id (integer()), observation weights weight (numeric()). Returns NULL weight column. labels (named character()) Retrieve labels (prettier formated names) columns. Internally queries column label table field col_info. Columns ids referenced name vector, labels actual string values. Assigning column update task reference. provide character vector labels, named column ids. remove label, set NA. Alternatively, can provide data.frame() two columns \"id\" \"label\". col_hashes (named character) Hash (unique identifier) columns except primary_key: character vector, named columns element refers . Columns different Tasks DataBackends agreeing col_hashes always represent data, given rows selected. reverse necessarily true: can columns content different col_hashes.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Task Class — Task","text":"Task$new() Task$divide() Task$help() Task$format() Task$print() Task$data() Task$formula() Task$head() Task$levels() Task$missings() Task$filter() Task$select() Task$rbind() Task$cbind() Task$rename() Task$set_row_roles() Task$set_col_roles() Task$set_levels() Task$droplevels() Task$add_strata() Task$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Task Class — Task","text":"Creates new instance R6 class. Note object typically constructed via derived classes, e.g. TaskClassif TaskRegr.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$new(id, task_type, backend, label = NA_character_, extra_args = list())"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"id (character(1)) Identifier new instance. task_type (character(1)) Type task, e.g. \"regr\" \"classif\". Must element mlr_reflections$task_types$type. backend (DataBackend) Either DataBackend, object convertible DataBackend as_data_backend(). E.g., data.frame() converted DataBackendDataTable. label (character(1)) Label new instance. extra_args (named list()) Named list constructor arguments, required converting task types via convert_task().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-divide-","dir":"Reference","previous_headings":"","what":"Method divide()","title":"Task Class — Task","text":"Deprecated.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$divide(ratio = NULL, ids = NULL, remove = TRUE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"ratio (numeric(1)) proportion datapoints use validation data. ids (integer()) row ids use validation data. remove (logical(1)) TRUE (default), row_ids removed primary task's active \"use\" rows, ensuring disjoint split train validation data.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Modified Self.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-help-","dir":"Reference","previous_headings":"","what":"Method help()","title":"Task Class — Task","text":"Opens corresponding help page referenced field $man.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$help()"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"Task Class — Task","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Task Class — Task","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$print(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-data-","dir":"Reference","previous_headings":"","what":"Method data()","title":"Task Class — Task","text":"Returns slice data DataBackend data.table. Rows default observations role \"use\", columns default features roles \"target\" \"feature\". rows cols specified exist DataBackend, exception raised. Rows columns returned order specified via arguments rows cols. rows NULL, rows returned order task$row_ids. cols NULL, column order defaults c(task$target_names, task$feature_names). Note recommended rely order columns, instead always address columns respective column name.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$data(rows = NULL, cols = NULL, data_format, ordered = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering. cols (character()) Vector column names. data_format (character(1)) Deprecated. Ignored, removed future. ordered (logical(1)) TRUE, data ordered according columns column role \"order\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Depending DataBackend, usually data.table::data.table().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-formula-","dir":"Reference","previous_headings":"","what":"Method formula()","title":"Task Class — Task","text":"Constructs formula(), e.g. [target] ~ [feature_1] + [feature_2] + ... + [feature_k], using features provided argument rhs (defaults columns role \"feature\", symbolized \".\"). Note currently possible change formula. However, mlr3pipelines provides pipe operator interfacing stats::model.matrix() purpose: \"modelmatrix\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$formula(rhs = \".\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"rhs (character(1)) Right hand side formula. Defaults \".\" (features task).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"formula().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-head-","dir":"Reference","previous_headings":"","what":"Method head()","title":"Task Class — Task","text":"Get first n observations role \"use\" columns role \"target\" \"feature\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$head(n = 6L)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"n (integer(1)).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"data.table::data.table() n rows.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-levels-","dir":"Reference","previous_headings":"","what":"Method levels()","title":"Task Class — Task","text":"Returns distinct values columns referenced cols storage type \"factor\" \"ordered\". Argument cols defaults columns role \"target\" \"feature\". Note function ignores row roles, returns levels available DataBackend. update stored level information, e.g. subsetting task $filter(), call $droplevels().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$levels(cols = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-7","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"cols (character()) Vector column names.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"named list().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-missings-","dir":"Reference","previous_headings":"","what":"Method missings()","title":"Task Class — Task","text":"Returns number missing observations columns referenced cols. Considers active rows row role \"use\". Argument cols defaults columns role \"target\" \"feature\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-9","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$missings(cols = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-8","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"cols (character()) Vector column names.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Named integer().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-filter-","dir":"Reference","previous_headings":"","what":"Method filter()","title":"Task Class — Task","text":"Subsets task, keeping rows specified via row ids rows. operation mutates task -place. See section task mutators information.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-10","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$filter(rows)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-9","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-6","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-select-","dir":"Reference","previous_headings":"","what":"Method select()","title":"Task Class — Task","text":"Subsets task, keeping features specified via column names cols. Note deselect target column, obvious reasons. operation mutates task -place. See section task mutators information.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-11","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$select(cols)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-10","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"cols (character()) Vector column names.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-7","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-rbind-","dir":"Reference","previous_headings":"","what":"Method rbind()","title":"Task Class — Task","text":"Adds additional rows DataBackend stored $backend. New row ids automatically created, unless data column whose name matches primary key DataBackend (task$backend$primary_key). case name clashes row ids, rows data higher precedence virtually overwrite rows DataBackend. columns roles \"target\", \"feature\", \"weight\", \"group\", \"stratum\", \"order\" must present data. Columns present data DataBackend task discarded. operation mutates task -place. See section task mutators information.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-12","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$rbind(data)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-11","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"data (data.frame()).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-8","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-cbind-","dir":"Reference","previous_headings":"","what":"Method cbind()","title":"Task Class — Task","text":"Adds additional columns DataBackend stored $backend. row ids must provided column data (column name matching primary key name DataBackend). column missing, assumed rows exactly order $row_ids. case name clashes column names data DataBackend, columns data higher precedence virtually overwrite columns DataBackend. operation mutates task -place. See section task mutators information.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-13","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$cbind(data)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-12","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"data (data.frame()).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-rename-","dir":"Reference","previous_headings":"","what":"Method rename()","title":"Task Class — Task","text":"Renames columns mapping column names old new column names new (element-wise). operation mutates task -place. See section task mutators information.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-14","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$rename(old, new)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-13","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"old (character()) Old names. new (character()) New names.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-9","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-set-row-roles-","dir":"Reference","previous_headings":"","what":"Method set_row_roles()","title":"Task Class — Task","text":"Modifies roles $row_roles -place.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-15","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$set_row_roles(rows, roles = NULL, add_to = NULL, remove_from = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-14","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"rows (integer()) Row ids change roles . roles (character()) Exclusively set rows specified roles (remove roles). add_to (character()) Add rows row ids rows roles specified add_to. Rows keep previous roles. remove_from (character()) Remove rows row ids rows roles specified remove_from. row roles preserved.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Task Class — Task","text":"Roles first set exclusively (argument roles), added (argument add_to) finally removed (argument remove_from) different roles. Duplicated row ids explicitly allowed, can add replicate observation repeating row_id.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-10","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-set-col-roles-","dir":"Reference","previous_headings":"","what":"Method set_col_roles()","title":"Task Class — Task","text":"Modifies roles $col_roles -place. See $col_roles list possible roles.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-16","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$set_col_roles(cols, roles = NULL, add_to = NULL, remove_from = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-15","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"cols (character()) Column names change roles . roles (character()) Exclusively set columns specified roles (remove roles). add_to (character()) Add columns column names cols roles specified add_to. Columns keep previous roles. remove_from (character()) Remove columns columns names cols roles specified remove_from. column roles preserved.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"details-1","dir":"Reference","previous_headings":"","what":"Details","title":"Task Class — Task","text":"Roles first set exclusively (argument roles), added (argument add_to) finally removed (argument remove_from) different roles. Duplicated columns removed role. tasks allow one target, target column set $set_col_roles(). Use $col_roles field swap target column.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-11","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Returns object , modified reference. need explicitly $clone() object beforehand want keeps object previous state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-set-levels-","dir":"Reference","previous_headings":"","what":"Method set_levels()","title":"Task Class — Task","text":"Set levels columns type factor ordered field col_info. can add, remove reorder levels, affecting data returned $data() $levels(). just want remove unused levels, use $droplevels() instead. Note factor levels present data listed task valid levels converted missing values.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-17","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$set_levels(levels)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-16","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"levels (named list() character()) List character vectors new levels, named column names.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-12","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Modified self.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-droplevels-","dir":"Reference","previous_headings":"","what":"Method droplevels()","title":"Task Class — Task","text":"Updates cache stored factor levels, removing levels present current set active rows. cols defaults columns storage type \"factor\" \"ordered\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-18","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$droplevels(cols = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-17","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"cols (character()) Vector column names.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-13","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"Modified self.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-add-strata-","dir":"Reference","previous_headings":"","what":"Method add_strata()","title":"Task Class — Task","text":"Cuts numeric variables new factors columns added task role \"stratum\". ensures training test splits contain observations bins. columns named \"..stratum_[col_name]\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-19","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$add_strata(cols, bins = 3L)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-18","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"cols (character()) Names columns operate . bins (integer()) Number bins cut (passed cut() breaks). Replicated length cols.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"returns-14","dir":"Reference","previous_headings":"","what":"Returns","title":"Task Class — Task","text":"self (invisibly).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Task Class — Task","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"usage-20","dir":"Reference","previous_headings":"","what":"Usage","title":"Task Class — Task","text":"","code":"Task$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"arguments-19","dir":"Reference","previous_headings":"","what":"Arguments","title":"Task Class — Task","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/Task.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Task Class — Task","text":"","code":"# We use the inherited class TaskClassif here, # because the base class `Task` is not intended for direct use task = TaskClassif$new(\"penguings\", palmerpenguins::penguins, target = \"species\") task$nrow #> [1] 344 task$ncol #> [1] 8 task$feature_names #> [1] \"bill_depth_mm\" \"bill_length_mm\" \"body_mass_g\" #> [4] \"flipper_length_mm\" \"island\" \"sex\" #> [7] \"year\" task$formula() #> species ~ . #> NULL # de-select \"year\" task$select(setdiff(task$feature_names, \"year\")) task$feature_names #> [1] \"bill_depth_mm\" \"bill_length_mm\" \"body_mass_g\" #> [4] \"flipper_length_mm\" \"island\" \"sex\" # Add new column \"foo\" task$cbind(data.frame(foo = 1:344)) head(task) #> species bill_depth_mm bill_length_mm body_mass_g flipper_length_mm island #> #> 1: Adelie 18.7 39.1 3750 181 Torgersen #> 2: Adelie 17.4 39.5 3800 186 Torgersen #> 3: Adelie 18.0 40.3 3250 195 Torgersen #> 4: Adelie NA NA NA NA Torgersen #> 5: Adelie 19.3 36.7 3450 193 Torgersen #> 6: Adelie 20.6 39.3 3650 190 Torgersen #> sex foo #> #> 1: male 1 #> 2: female 2 #> 3: female 3 #> 4: 4 #> 5: female 5 #> 6: male 6"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":null,"dir":"Reference","previous_headings":"","what":"Classification Task — TaskClassif","title":"Classification Task — TaskClassif","text":"task specializes Task TaskSupervised classification problems. target column assumed factor ordered factor. task_type set \"classif\". Additional task properties include: \"twoclass\": task binary classification problem. \"multiclass\": task multiclass classification problem. recommended use as_task_classif() construction. Predefined tasks stored dictionary mlr_tasks.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"super-classes","dir":"Reference","previous_headings":"","what":"Super classes","title":"Classification Task — TaskClassif","text":"mlr3::Task -> mlr3::TaskSupervised -> TaskClassif","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Classification Task — TaskClassif","text":"class_names (character()) Returns class labels target column. positive (character(1)) Stores positive class binary classification tasks, NA multiclass tasks. switch positive class, assign level field. negative (character(1)) Stores negative class binary classification tasks, NA multiclass tasks.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Classification Task — TaskClassif","text":"mlr3::Task$add_strata() mlr3::Task$cbind() mlr3::Task$data() mlr3::Task$divide() mlr3::Task$filter() mlr3::Task$format() mlr3::Task$formula() mlr3::Task$head() mlr3::Task$help() mlr3::Task$levels() mlr3::Task$missings() mlr3::Task$print() mlr3::Task$rbind() mlr3::Task$rename() mlr3::Task$select() mlr3::Task$set_col_roles() mlr3::Task$set_levels() mlr3::Task$set_row_roles()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Classification Task — TaskClassif","text":"TaskClassif$new() TaskClassif$truth() TaskClassif$droplevels() TaskClassif$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Classification Task — TaskClassif","text":"Creates new instance R6 class. function as_task_classif() provides alternative way construct classification tasks.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Classification Task — TaskClassif","text":"","code":"TaskClassif$new( id, backend, target, positive = NULL, label = NA_character_, extra_args = list() )"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Classification Task — TaskClassif","text":"id (character(1)) Identifier new instance. backend (DataBackend) Either DataBackend, object convertible DataBackend as_data_backend(). E.g., data.frame() converted DataBackendDataTable. target (character(1)) Name target column. positive (character(1)) binary classification: Name positive class. levels target columns reordered accordingly, first element $class_names positive class, second element negative class. label (character(1)) Label new instance. extra_args (named list()) Named list constructor arguments, required converting task types via convert_task().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"method-truth-","dir":"Reference","previous_headings":"","what":"Method truth()","title":"Classification Task — TaskClassif","text":"True response specified row_ids. Format depends task type. Defaults rows role \"use\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Classification Task — TaskClassif","text":"","code":"TaskClassif$truth(rows = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Classification Task — TaskClassif","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Classification Task — TaskClassif","text":"factor().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"method-droplevels-","dir":"Reference","previous_headings":"","what":"Method droplevels()","title":"Classification Task — TaskClassif","text":"Updates cache stored factor levels, removing levels present current set active rows. cols defaults columns storage type \"factor\" \"ordered\". Also updates task property \"twoclass\"/\"multiclass\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Classification Task — TaskClassif","text":"","code":"TaskClassif$droplevels(cols = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Classification Task — TaskClassif","text":"cols (character()) Vector column names.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Classification Task — TaskClassif","text":"Modified self.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Classification Task — TaskClassif","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Classification Task — TaskClassif","text":"","code":"TaskClassif$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Classification Task — TaskClassif","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskClassif.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Classification Task — TaskClassif","text":"","code":"data(\"Sonar\", package = \"mlbench\") task = as_task_classif(Sonar, target = \"Class\", positive = \"M\") task$task_type #> [1] \"classif\" task$formula() #> Class ~ . #> NULL task$truth() #> [1] R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R #> [38] R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R #> [75] R R R R R R R R R R R R R R R R R R R R R R R M M M M M M M M M M M M M M #> [112] M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M #> [149] M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M M #> [186] M M M M M M M M M M M M M M M M M M M M M M M #> Levels: M R task$class_names #> [1] \"M\" \"R\" task$positive #> [1] \"M\" task$data(rows = 1:3, cols = task$feature_names[1:2]) #> V1 V10 #> #> 1: 0.0200 0.2111 #> 2: 0.0453 0.2872 #> 3: 0.0262 0.6194"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":null,"dir":"Reference","previous_headings":"","what":"TaskGenerator Class — TaskGenerator","title":"TaskGenerator Class — TaskGenerator","text":"Creates Task arbitrary size. Predefined task generators stored dictionary mlr_task_generators, e.g. xor.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"TaskGenerator Class — TaskGenerator","text":"id (character(1)) Identifier object. Used tables, plot text output. label (character(1)) Label object. Can used tables, plot text output instead ID. task_type (character(1)) Task type, e.g. \"classif\" \"regr\". complete list possible task types (depending loaded packages), see mlr_reflections$task_types$type. param_set (paradox::ParamSet) Set hyperparameters. packages (character(1)) Set required packages. packages loaded, attached. man (character(1)) String format [pkg]::[topic] pointing manual page object. Defaults NA, can set child classes.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"TaskGenerator Class — TaskGenerator","text":"TaskGenerator$new() TaskGenerator$format() TaskGenerator$print() TaskGenerator$generate() TaskGenerator$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"TaskGenerator Class — TaskGenerator","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"TaskGenerator Class — TaskGenerator","text":"","code":"TaskGenerator$new( id, task_type, packages = character(), param_set = ps(), label = NA_character_, man = NA_character_ )"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"TaskGenerator Class — TaskGenerator","text":"id (character(1)) Identifier new instance. task_type (character(1)) Type task, e.g. \"regr\" \"classif\". Must element mlr_reflections$task_types$type. packages (character()) Set required packages. warning signaled constructor least one packages installed, loaded (attached) later -demand via requireNamespace(). param_set (paradox::ParamSet) Set hyperparameters. label (character(1)) Label new instance. man (character(1)) String format [pkg]::[topic] pointing manual page object. referenced help package can opened via method $help().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"method-format-","dir":"Reference","previous_headings":"","what":"Method format()","title":"TaskGenerator Class — TaskGenerator","text":"Helper print outputs.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"TaskGenerator Class — TaskGenerator","text":"","code":"TaskGenerator$format(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"TaskGenerator Class — TaskGenerator","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"TaskGenerator Class — TaskGenerator","text":"Printer.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"TaskGenerator Class — TaskGenerator","text":"","code":"TaskGenerator$print(...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"TaskGenerator Class — TaskGenerator","text":"... (ignored).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"method-generate-","dir":"Reference","previous_headings":"","what":"Method generate()","title":"TaskGenerator Class — TaskGenerator","text":"Creates task type task_type n observations, possibly using additional settings stored param_set.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"TaskGenerator Class — TaskGenerator","text":"","code":"TaskGenerator$generate(n)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"TaskGenerator Class — TaskGenerator","text":"n (integer(1)) Number rows generate.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"TaskGenerator Class — TaskGenerator","text":"Task.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"TaskGenerator Class — TaskGenerator","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"TaskGenerator Class — TaskGenerator","text":"","code":"TaskGenerator$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskGenerator.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"TaskGenerator Class — TaskGenerator","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":null,"dir":"Reference","previous_headings":"","what":"Regression Task — TaskRegr","title":"Regression Task — TaskRegr","text":"task specializes Task TaskSupervised regression problems. target column assumed numeric. task_type set \"regr\". recommended use as_task_regr() construction. Predefined tasks stored dictionary mlr_tasks.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"super-classes","dir":"Reference","previous_headings":"","what":"Super classes","title":"Regression Task — TaskRegr","text":"mlr3::Task -> mlr3::TaskSupervised -> TaskRegr","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Regression Task — TaskRegr","text":"mlr3::Task$add_strata() mlr3::Task$cbind() mlr3::Task$data() mlr3::Task$divide() mlr3::Task$droplevels() mlr3::Task$filter() mlr3::Task$format() mlr3::Task$formula() mlr3::Task$head() mlr3::Task$help() mlr3::Task$levels() mlr3::Task$missings() mlr3::Task$print() mlr3::Task$rbind() mlr3::Task$rename() mlr3::Task$select() mlr3::Task$set_col_roles() mlr3::Task$set_levels() mlr3::Task$set_row_roles()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Regression Task — TaskRegr","text":"TaskRegr$new() TaskRegr$truth() TaskRegr$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Regression Task — TaskRegr","text":"Creates new instance R6 class. function as_task_regr() provides alternative way construct regression tasks.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression Task — TaskRegr","text":"","code":"TaskRegr$new(id, backend, target, label = NA_character_, extra_args = list())"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression Task — TaskRegr","text":"id (character(1)) Identifier new instance. backend (DataBackend) Either DataBackend, object convertible DataBackend as_data_backend(). E.g., data.frame() converted DataBackendDataTable. target (character(1)) Name target column. label (character(1)) Label new instance. extra_args (named list()) Named list constructor arguments, required converting task types via convert_task().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"method-truth-","dir":"Reference","previous_headings":"","what":"Method truth()","title":"Regression Task — TaskRegr","text":"True response specified row_ids. Format depends task type. Defaults rows role \"use\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression Task — TaskRegr","text":"","code":"TaskRegr$truth(rows = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression Task — TaskRegr","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Regression Task — TaskRegr","text":"numeric().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Regression Task — TaskRegr","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression Task — TaskRegr","text":"","code":"TaskRegr$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression Task — TaskRegr","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskRegr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Regression Task — TaskRegr","text":"","code":"task = as_task_regr(palmerpenguins::penguins, target = \"bill_length_mm\") task$task_type #> [1] \"regr\" task$formula() #> bill_length_mm ~ . #> NULL task$truth() #> [1] 39.1 39.5 40.3 NA 36.7 39.3 38.9 39.2 34.1 42.0 37.8 37.8 41.1 38.6 34.6 #> [16] 36.6 38.7 42.5 34.4 46.0 37.8 37.7 35.9 38.2 38.8 35.3 40.6 40.5 37.9 40.5 #> [31] 39.5 37.2 39.5 40.9 36.4 39.2 38.8 42.2 37.6 39.8 36.5 40.8 36.0 44.1 37.0 #> [46] 39.6 41.1 37.5 36.0 42.3 39.6 40.1 35.0 42.0 34.5 41.4 39.0 40.6 36.5 37.6 #> [61] 35.7 41.3 37.6 41.1 36.4 41.6 35.5 41.1 35.9 41.8 33.5 39.7 39.6 45.8 35.5 #> [76] 42.8 40.9 37.2 36.2 42.1 34.6 42.9 36.7 35.1 37.3 41.3 36.3 36.9 38.3 38.9 #> [91] 35.7 41.1 34.0 39.6 36.2 40.8 38.1 40.3 33.1 43.2 35.0 41.0 37.7 37.8 37.9 #> [106] 39.7 38.6 38.2 38.1 43.2 38.1 45.6 39.7 42.2 39.6 42.7 38.6 37.3 35.7 41.1 #> [121] 36.2 37.7 40.2 41.4 35.2 40.6 38.8 41.5 39.0 44.1 38.5 43.1 36.8 37.5 38.1 #> [136] 41.1 35.6 40.2 37.0 39.7 40.2 40.6 32.1 40.7 37.3 39.0 39.2 36.6 36.0 37.8 #> [151] 36.0 41.5 46.1 50.0 48.7 50.0 47.6 46.5 45.4 46.7 43.3 46.8 40.9 49.0 45.5 #> [166] 48.4 45.8 49.3 42.0 49.2 46.2 48.7 50.2 45.1 46.5 46.3 42.9 46.1 44.5 47.8 #> [181] 48.2 50.0 47.3 42.8 45.1 59.6 49.1 48.4 42.6 44.4 44.0 48.7 42.7 49.6 45.3 #> [196] 49.6 50.5 43.6 45.5 50.5 44.9 45.2 46.6 48.5 45.1 50.1 46.5 45.0 43.8 45.5 #> [211] 43.2 50.4 45.3 46.2 45.7 54.3 45.8 49.8 46.2 49.5 43.5 50.7 47.7 46.4 48.2 #> [226] 46.5 46.4 48.6 47.5 51.1 45.2 45.2 49.1 52.5 47.4 50.0 44.9 50.8 43.4 51.3 #> [241] 47.5 52.1 47.5 52.2 45.5 49.5 44.5 50.8 49.4 46.9 48.4 51.1 48.5 55.9 47.2 #> [256] 49.1 47.3 46.8 41.7 53.4 43.3 48.1 50.5 49.8 43.5 51.5 46.2 55.1 44.5 48.8 #> [271] 47.2 NA 46.8 50.4 45.2 49.9 46.5 50.0 51.3 45.4 52.7 45.2 46.1 51.3 46.0 #> [286] 51.3 46.6 51.7 47.0 52.0 45.9 50.5 50.3 58.0 46.4 49.2 42.4 48.5 43.2 50.6 #> [301] 46.7 52.0 50.5 49.5 46.4 52.8 40.9 54.2 42.5 51.0 49.7 47.5 47.6 52.0 46.9 #> [316] 53.5 49.0 46.2 50.9 45.5 50.9 50.8 50.1 49.0 51.5 49.8 48.1 51.4 45.7 50.7 #> [331] 42.5 52.2 45.2 49.3 50.2 45.6 51.9 46.8 45.7 55.8 43.5 49.6 50.8 50.2 task$data(rows = 1:3, cols = task$feature_names[1:2]) #> bill_depth_mm body_mass_g #> #> 1: 18.7 3750 #> 2: 17.4 3800 #> 3: 18.0 3250"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":null,"dir":"Reference","previous_headings":"","what":"Supervised Task — TaskSupervised","title":"Supervised Task — TaskSupervised","text":"abstract base class task objects like TaskClassif TaskRegr. extends Task methods handle target columns. Supervised tasks probabilistic regression (including survival analysis) can found mlr3proba.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"Supervised Task — TaskSupervised","text":"mlr3::Task -> TaskSupervised","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Supervised Task — TaskSupervised","text":"mlr3::Task$add_strata() mlr3::Task$cbind() mlr3::Task$data() mlr3::Task$divide() mlr3::Task$droplevels() mlr3::Task$filter() mlr3::Task$format() mlr3::Task$formula() mlr3::Task$head() mlr3::Task$help() mlr3::Task$levels() mlr3::Task$missings() mlr3::Task$print() mlr3::Task$rbind() mlr3::Task$rename() mlr3::Task$select() mlr3::Task$set_col_roles() mlr3::Task$set_levels() mlr3::Task$set_row_roles()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Supervised Task — TaskSupervised","text":"TaskSupervised$new() TaskSupervised$truth() TaskSupervised$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Supervised Task — TaskSupervised","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Supervised Task — TaskSupervised","text":"","code":"TaskSupervised$new( id, task_type, backend, target, label = NA_character_, extra_args = list() )"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Supervised Task — TaskSupervised","text":"id (character(1)) Identifier new instance. task_type (character(1)) Type task, e.g. \"regr\" \"classif\". Must element mlr_reflections$task_types$type. backend (DataBackend) Either DataBackend, object convertible DataBackend as_data_backend(). E.g., data.frame() converted DataBackendDataTable. target (character(1)) Name target column. label (character(1)) Label new instance. extra_args (named list()) Named list constructor arguments, required converting task types via convert_task().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"method-truth-","dir":"Reference","previous_headings":"","what":"Method truth()","title":"Supervised Task — TaskSupervised","text":"True response specified row_ids. Format depends task type. Defaults rows role \"use\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Supervised Task — TaskSupervised","text":"","code":"TaskSupervised$truth(rows = NULL)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Supervised Task — TaskSupervised","text":"rows (positive integer()) Vector row indices. Always refers complete data set, even filtering.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Supervised Task — TaskSupervised","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Supervised Task — TaskSupervised","text":"","code":"TaskSupervised$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Supervised Task — TaskSupervised","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskSupervised.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Supervised Task — TaskSupervised","text":"","code":"TaskSupervised$new(\"penguins\", task_type = \"classif\", backend = palmerpenguins::penguins, target = \"species\") #> (344 x 8) #> * Target: species #> * Properties: - #> * Features (7): #> - int (3): body_mass_g, flipper_length_mm, year #> - dbl (2): bill_depth_mm, bill_length_mm #> - fct (2): island, sex"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":null,"dir":"Reference","previous_headings":"","what":"Unsupervised Task — TaskUnsupervised","title":"Unsupervised Task — TaskUnsupervised","text":"abstract base class unsupervised tasks cluster tasks mlr3cluster mlr3spatial.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"super-class","dir":"Reference","previous_headings":"","what":"Super class","title":"Unsupervised Task — TaskUnsupervised","text":"mlr3::Task -> TaskUnsupervised","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Unsupervised Task — TaskUnsupervised","text":"mlr3::Task$add_strata() mlr3::Task$cbind() mlr3::Task$data() mlr3::Task$divide() mlr3::Task$droplevels() mlr3::Task$filter() mlr3::Task$format() mlr3::Task$formula() mlr3::Task$head() mlr3::Task$help() mlr3::Task$levels() mlr3::Task$missings() mlr3::Task$print() mlr3::Task$rbind() mlr3::Task$rename() mlr3::Task$select() mlr3::Task$set_col_roles() mlr3::Task$set_levels() mlr3::Task$set_row_roles()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Unsupervised Task — TaskUnsupervised","text":"TaskUnsupervised$new() TaskUnsupervised$clone()","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Unsupervised Task — TaskUnsupervised","text":"Creates new instance R6 class.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unsupervised Task — TaskUnsupervised","text":"","code":"TaskUnsupervised$new( id, task_type = \"unsupervised\", backend, label = NA_character_, extra_args = list() )"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unsupervised Task — TaskUnsupervised","text":"id (character(1)) Identifier new instance. task_type (character(1)) Type task, e.g. \"regr\" \"classif\". Must element mlr_reflections$task_types$type. backend (DataBackend) Either DataBackend, object convertible DataBackend as_data_backend(). E.g., data.frame() converted DataBackendDataTable. label (character(1)) Label new instance. extra_args (named list()) Named list constructor arguments, required converting task types via convert_task().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Unsupervised Task — TaskUnsupervised","text":"objects class cloneable method.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Unsupervised Task — TaskUnsupervised","text":"","code":"TaskUnsupervised$clone(deep = FALSE)"},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unsupervised Task — TaskUnsupervised","text":"deep Whether make deep clone.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/TaskUnsupervised.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unsupervised Task — TaskUnsupervised","text":"","code":"TaskUnsupervised$new(\"penguins\", task_type = \"regr\", backend = palmerpenguins::penguins) #> (344 x 8) #> * Target: - #> * Properties: - #> * Features (8): #> - int (3): body_mass_g, flipper_length_mm, year #> - fct (3): island, sex, species #> - dbl (2): bill_depth_mm, bill_length_mm"},{"path":"https://mlr3.mlr-org.com/dev/reference/ames_housing.html","id":null,"dir":"Reference","previous_headings":"","what":"House Sales in Ames, Iowa — ames_housing","title":"House Sales in Ames, Iowa — ames_housing","text":"regression task predict house sale prices Ames, Iowa. processed version AmesHousing::make_ames() package. Contains 80 features 2930 observations. Target column \"Sale_Price\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ames_housing.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"House Sales in Ames, Iowa — ames_housing","text":"R6::R6Class inheriting TaskRegr.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/ames_housing.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"House Sales in Ames, Iowa — ames_housing","text":"","code":"mlr_tasks$get(\"ames_housing\") tsk(\"ames_housing\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/ames_housing.html","id":"meta-information","dir":"Reference","previous_headings":"","what":"Meta Information","title":"House Sales in Ames, Iowa — ames_housing","text":"Task type: “regr” Dimensions: 2930x81 Properties: - Missings: FALSE Target: “Sale_Price” Features: “Alley”, “Bedroom_AbvGr”, “Bldg_Type”, “BsmtFin_SF_1”, “BsmtFin_SF_2”, “BsmtFin_Type_1”, “BsmtFin_Type_2”, “Bsmt_Cond”, “Bsmt_Exposure”, “Bsmt_Full_Bath”, “Bsmt_Half_Bath”, “Bsmt_Qual”, “Bsmt_Unf_SF”, “Central_Air”, “Condition_1”, “Condition_2”, “Electrical”, “Enclosed_Porch”, “Exter_Cond”, “Exter_Qual”, “Exterior_1st”, “Exterior_2nd”, “Fence”, “Fireplace_Qu”, “Fireplaces”, “First_Flr_SF”, “Foundation”, “Full_Bath”, “Functional”, “Garage_Area”, “Garage_Cars”, “Garage_Cond”, “Garage_Finish”, “Garage_Qual”, “Garage_Type”, “Gr_Liv_Area”, “Half_Bath”, “Heating”, “Heating_QC”, “House_Style”, “Kitchen_AbvGr”, “Kitchen_Qual”, “Land_Contour”, “Land_Slope”, “Latitude”, “Longitude”, “Lot_Area”, “Lot_Config”, “Lot_Frontage”, “Lot_Shape”, “Low_Qual_Fin_SF”, “MS_SubClass”, “MS_Zoning”, “Mas_Vnr_Area”, “Mas_Vnr_Type”, “Misc_Feature”, “Misc_Val”, “Mo_Sold”, “Neighborhood”, “Open_Porch_SF”, “Overall_Cond”, “Overall_Qual”, “Paved_Drive”, “Pool_Area”, “Pool_QC”, “Roof_Matl”, “Roof_Style”, “Sale_Condition”, “Sale_Type”, “Screen_Porch”, “Second_Flr_SF”, “Street”, “Three_season_porch”, “TotRms_AbvGrd”, “Total_Bsmt_SF”, “Utilities”, “Wood_Deck_SF”, “Year_Built”, “Year_Remod_Add”, “Year_Sold”","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/as_benchmark_result.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to BenchmarkResult — as_benchmark_result","title":"Convert to BenchmarkResult — as_benchmark_result","text":"Convert object BenchmarkResult.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_benchmark_result.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to BenchmarkResult — as_benchmark_result","text":"","code":"as_benchmark_result(x, ...) # S3 method for class 'BenchmarkResult' as_benchmark_result(x, ...) # S3 method for class 'ResampleResult' as_benchmark_result(x, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_benchmark_result.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to BenchmarkResult — as_benchmark_result","text":"x () Object convert. ... () Additional arguments.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_benchmark_result.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to BenchmarkResult — as_benchmark_result","text":"(BenchmarkResult).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_data_backend.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a Data Backend — as_data_backend.Matrix","title":"Create a Data Backend — as_data_backend.Matrix","text":"Wraps DataBackend around data. mlr3 ships methods data.frame (converted DataBackendDataTable Matrix package Matrix (converted DataBackendMatrix). Additional methods implemented package mlr3db, e.g. connect real DBMS like PostgreSQL (via dbplyr) DuckDB (via DBI/duckdb).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_data_backend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a Data Backend — as_data_backend.Matrix","text":"","code":"# S3 method for class 'Matrix' as_data_backend(data, primary_key = NULL, dense = NULL, ...) as_data_backend(data, primary_key = NULL, ...) # S3 method for class 'data.frame' as_data_backend(data, primary_key = NULL, keep_rownames = FALSE, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_data_backend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a Data Backend — as_data_backend.Matrix","text":"data (data.frame()) input data.frame(). Automatically converted data.table::data.table(). primary_key (character(1) | integer()) Name primary key column, integer vector row ids. dense (data.frame()). Dense data. ... () Additional arguments passed respective DataBackend method. keep_rownames (logical(1) | character(1)) TRUE single string, keeps row names data new column. column named like provided string, defaulting \"..rownames\" keep_rownames == TRUE. Note created column used regular feature task unless manually change column role. Also see data.table::.data.table().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_data_backend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a Data Backend — as_data_backend.Matrix","text":"DataBackend.","code":""},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/as_data_backend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a Data Backend — as_data_backend.Matrix","text":"","code":"# create a new backend using the penguins data: as_data_backend(palmerpenguins::penguins) #> (344x9) #> species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g #> #> Adelie Torgersen 39.1 18.7 181 3750 #> Adelie Torgersen 39.5 17.4 186 3800 #> Adelie Torgersen 40.3 18.0 195 3250 #> Adelie Torgersen NA NA NA NA #> Adelie Torgersen 36.7 19.3 193 3450 #> Adelie Torgersen 39.3 20.6 190 3650 #> sex year ..row_id #> #> male 2007 1 #> female 2007 2 #> female 2007 3 #> 2007 4 #> female 2007 5 #> male 2007 6 #> [...] (338 rows omitted)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_learner.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a Learner — as_learner","title":"Convert to a Learner — as_learner","text":"Convert object Learner list Learner.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_learner.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a Learner — as_learner","text":"","code":"as_learner(x, ...) # S3 method for class 'Learner' as_learner(x, clone = FALSE, discard_state = FALSE, ...) as_learners(x, ...) # Default S3 method as_learners(x, ...) # S3 method for class 'list' as_learners(x, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_learner.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a Learner — as_learner","text":"x () Object convert. ... () Additional arguments. clone (logical(1)) TRUE, ensures returned object input x. discard_state (logical(1)) Whether discard state.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_learner.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to a Learner — as_learner","text":"Learner.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_measure.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a Measure — as_measure","title":"Convert to a Measure — as_measure","text":"Convert object Measure list Measure.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_measure.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a Measure — as_measure","text":"","code":"as_measure(x, ...) # S3 method for class '`NULL`' as_measure(x, task_type = NULL, ...) # S3 method for class 'Measure' as_measure(x, clone = FALSE, ...) as_measures(x, ...) # Default S3 method as_measures(x, ...) # S3 method for class '`NULL`' as_measures(x, task_type = NULL, ...) # S3 method for class 'list' as_measures(x, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_measure.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a Measure — as_measure","text":"x () Object convert. ... () Additional arguments. task_type (character(1)) Used x NULL construct default measure respective task type. default measures stored mlr_reflections$default_measures. clone (logical(1)) TRUE, ensures returned object input x.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_measure.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to a Measure — as_measure","text":"Measure.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a Prediction — as_prediction","title":"Convert to a Prediction — as_prediction","text":"Convert object Prediction list Prediction.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a Prediction — as_prediction","text":"","code":"as_prediction(x, check = FALSE, ...) # S3 method for class 'Prediction' as_prediction(x, check = FALSE, ...) # S3 method for class 'PredictionDataClassif' as_prediction(x, check = FALSE, ...) # S3 method for class 'PredictionDataRegr' as_prediction(x, check = FALSE, ...) as_predictions(x, predict_sets = \"test\", ...) # S3 method for class 'list' as_predictions(x, predict_sets = \"test\", ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a Prediction — as_prediction","text":"x () Object convert. check (logical(1)) Perform argument checks type conversions? ... () Additional arguments. predict_sets (character()) Prediction sets operate , used aggregate() extract matching predict_sets ResampleResult. Multiple predict sets calculated respective Learner resample()/benchmark(). Must non-empty subset {\"train\", \"test\", \"internal_valid\"}. multiple sets provided, first combined single prediction object. Default \"test\".","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to a Prediction — as_prediction","text":"Prediction.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_classif.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a Classification Prediction — as_prediction_classif","title":"Convert to a Classification Prediction — as_prediction_classif","text":"Convert object PredictionClassif.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_classif.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a Classification Prediction — as_prediction_classif","text":"","code":"as_prediction_classif(x, ...) # S3 method for class 'PredictionClassif' as_prediction_classif(x, ...) # S3 method for class 'data.frame' as_prediction_classif(x, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_classif.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a Classification Prediction — as_prediction_classif","text":"x () Object convert. ... () Additional arguments.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_classif.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to a Classification Prediction — as_prediction_classif","text":"PredictionClassif.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_classif.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert to a Classification Prediction — as_prediction_classif","text":"","code":"# create a prediction object task = tsk(\"penguins\") learner = lrn(\"classif.rpart\", predict_type = \"prob\") learner$train(task) p = learner$predict(task) # convert to a data.table tab = as.data.table(p) # convert back to a Prediction as_prediction_classif(tab) #> for 344 observations: #> row_ids truth response prob.Adelie prob.Chinstrap prob.Gentoo #> 1 Adelie Adelie 0.96688742 0.03311258 0.00000000 #> 2 Adelie Adelie 0.96688742 0.03311258 0.00000000 #> 3 Adelie Adelie 0.96688742 0.03311258 0.00000000 #> --- --- --- --- --- --- #> 342 Chinstrap Chinstrap 0.06349206 0.92063492 0.01587302 #> 343 Chinstrap Chinstrap 0.28571429 0.71428571 0.00000000 #> 344 Chinstrap Chinstrap 0.06349206 0.92063492 0.01587302 # split data.table into a list of data.tables tabs = split(tab, tab$truth) # convert back to list of predictions preds = lapply(tabs, as_prediction_classif) # calculate performance in each group sapply(preds, function(p) p$score()) #> Adelie.classif.ce Chinstrap.classif.ce Gentoo.classif.ce #> 0.039473684 0.073529412 0.008064516"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_data.html","id":null,"dir":"Reference","previous_headings":"","what":"PredictionData — as_prediction_data","title":"PredictionData — as_prediction_data","text":"Convert object PredictionData list PredictionData.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"PredictionData — as_prediction_data","text":"","code":"as_prediction_data(x, task, row_ids = task$row_ids, check = TRUE, ...) # S3 method for class 'Prediction' as_prediction_data(x, task, row_ids = task$row_ids, check = TRUE, ...) # S3 method for class 'PredictionData' as_prediction_data(x, task, row_ids = task$row_ids, check = TRUE, ...) # S3 method for class 'list' as_prediction_data( x, task, row_ids = task$row_ids, check = TRUE, ..., train_task )"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"PredictionData — as_prediction_data","text":"x () Object convert. task (Task). row_ids integer() Row indices. check (logical(1)) Perform argument checks type conversions? ... () Additional arguments. train_task (Task) Task used training learner.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"PredictionData — as_prediction_data","text":"PredictionData.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_regr.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a Regression Prediction — as_prediction_regr","title":"Convert to a Regression Prediction — as_prediction_regr","text":"Convert object PredictionRegr.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_regr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a Regression Prediction — as_prediction_regr","text":"","code":"as_prediction_regr(x, ...) # S3 method for class 'PredictionRegr' as_prediction_regr(x, ...) # S3 method for class 'data.frame' as_prediction_regr(x, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_regr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a Regression Prediction — as_prediction_regr","text":"x () Object convert. ... () Additional arguments.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_regr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to a Regression Prediction — as_prediction_regr","text":"PredictionRegr.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_prediction_regr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert to a Regression Prediction — as_prediction_regr","text":"","code":"# create a prediction object task = tsk(\"mtcars\") learner = lrn(\"regr.rpart\") learner$train(task) p = learner$predict(task) # convert to a data.table tab = as.data.table(p) # convert back to a Prediction as_prediction_regr(tab) #> for 32 observations: #> row_ids truth response #> 1 21.0 18.26429 #> 2 21.0 18.26429 #> 3 22.8 26.66364 #> --- --- --- #> 30 19.7 18.26429 #> 31 15.0 13.41429 #> 32 21.4 26.66364 # split data.table into a list of data.tables tabs = split(tab, cut(tab$truth, 3)) # convert back to list of predictions preds = lapply(tabs, as_prediction_regr) # calculate performance in each group sapply(preds, function(p) p$score()) #> (10.4,18.2].regr.mse (18.2,26.1].regr.mse (26.1,33.9].regr.mse #> 4.278393 9.122466 22.719322"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_resample_result.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to ResampleResult — as_resample_result","title":"Convert to ResampleResult — as_resample_result","text":"Convert object ResampleResult. S3 method list expects argument x list Prediction objects relevant objects (Task, Learners, instantiated Resampling) must provided, . flexible way manually create ResampleResult implemented as_result_data().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_resample_result.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to ResampleResult — as_resample_result","text":"","code":"as_resample_result(x, ...) # S3 method for class 'ResampleResult' as_resample_result(x, ...) # S3 method for class 'ResultData' as_resample_result(x, view = NULL, ...) # S3 method for class 'list' as_resample_result(x, task, learners, resampling, store_backends = TRUE, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_resample_result.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to ResampleResult — as_resample_result","text":"x () Object convert. ... () Currently used. view (character()) See construction argument view ResampleResult. task (Task). learners (list trained Learners). resampling (Resampling). store_backends (logical(1)) set FALSE, backends Tasks provided data removed.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_resample_result.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to ResampleResult — as_resample_result","text":"(ResampleResult).","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_resampling.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a Resampling — as_resampling","title":"Convert to a Resampling — as_resampling","text":"Convert object Resampling list Resampling.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_resampling.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a Resampling — as_resampling","text":"","code":"as_resampling(x, ...) # S3 method for class 'Resampling' as_resampling(x, clone = FALSE, ...) as_resamplings(x, ...) # Default S3 method as_resamplings(x, ...) # S3 method for class 'list' as_resamplings(x, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_resampling.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a Resampling — as_resampling","text":"x () Object convert. ... () Additional arguments. clone (logical(1)) TRUE, ensures returned object input x.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_result_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to ResultData — as_result_data","title":"Convert to ResultData — as_result_data","text":"function allows construct convert ResultData object, result container used ResampleResult BenchmarkResult. ResampleResult BenchmarkResult can initialized returned object. Note ResampleResults can converted BenchmarkResult as_benchmark_result() multiple BenchmarkResults can combined larger BenchmarkResult $combine() method BenchmarkResult.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_result_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to ResultData — as_result_data","text":"","code":"as_result_data( task, learners, resampling, iterations, predictions, learner_states = NULL, store_backends = TRUE )"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_result_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to ResultData — as_result_data","text":"task (Task). learners (list trained Learners). resampling (Resampling). iterations (integer()). predictions (list list Predictions). learner_states (list()) Learner states. provided, states learners automatically extracted. store_backends (logical(1)) set FALSE, backends Tasks provided data removed.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_result_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to ResultData — as_result_data","text":"ResultData object can passed constructor ResampleResult.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_result_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert to ResultData — as_result_data","text":"","code":"task = tsk(\"penguins\") learner = lrn(\"classif.rpart\") resampling = rsmp(\"cv\", folds = 2)$instantiate(task) iterations = seq_len(resampling$iters) # manually train two learners. # store learners and predictions learners = list() predictions = list() for (i in iterations) { l = learner$clone(deep = TRUE) learners[[i]] = l$train(task, row_ids = resampling$train_set(i)) predictions[[i]] = list(test = l$predict(task, row_ids = resampling$test_set(i))) } rdata = as_result_data(task, learners, resampling, iterations, predictions) ResampleResult$new(rdata) #> with 2 resampling iterations #> task_id learner_id resampling_id iteration prediction_test warnings #> penguins classif.rpart cv 1 0 #> penguins classif.rpart cv 2 0 #> errors #> 0 #> 0"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a Task — as_task","title":"Convert to a Task — as_task","text":"Convert object Task list Task.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a Task — as_task","text":"","code":"as_task(x, ...) # S3 method for class 'Task' as_task(x, clone = FALSE, ...) as_tasks(x, ...) # Default S3 method as_tasks(x, ...) # S3 method for class 'list' as_tasks(x, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a Task — as_task","text":"x () Object convert. ... () Additional arguments. clone (logical(1)) TRUE, ensures returned object input x.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_classif.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a Classification Task — as_task_classif","title":"Convert to a Classification Task — as_task_classif","text":"Convert object TaskClassif. S3 generic. mlr3 ships methods following objects: TaskClassif: ensure identity formula, data.frame(), matrix(), Matrix::Matrix() DataBackend: provides alternative constructor TaskClassif. TaskRegr: Calls convert_task(). Note target column converted factor(), possible.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_classif.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a Classification Task — as_task_classif","text":"","code":"as_task_classif(x, ...) # S3 method for class 'TaskClassif' as_task_classif(x, clone = FALSE, ...) # S3 method for class 'data.frame' as_task_classif( x, target = NULL, id = deparse1(substitute(x)), positive = NULL, label = NA_character_, ... ) # S3 method for class 'matrix' as_task_classif( x, target, id = deparse1(substitute(x)), label = NA_character_, ... ) # S3 method for class 'Matrix' as_task_classif( x, target, id = deparse1(substitute(x)), label = NA_character_, ... ) # S3 method for class 'DataBackend' as_task_classif( x, target = NULL, id = deparse1(substitute(x)), positive = NULL, label = NA_character_, ... ) # S3 method for class 'TaskRegr' as_task_classif( x, target = NULL, drop_original_target = FALSE, drop_levels = TRUE, ... ) # S3 method for class 'formula' as_task_classif( x, data, id = deparse1(substitute(data)), positive = NULL, label = NA_character_, ... )"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_classif.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a Classification Task — as_task_classif","text":"x () Object convert. ... () Additional arguments. clone (logical(1)) TRUE, ensures returned object input x. target (character(1)) Name target column. id (character(1)) Id new task. Defaults (deparsed substituted) name data argument. positive (character(1)) Level positive class. See TaskClassif. label (character(1)) Label new instance. drop_original_target (logical(1)) FALSE (default), original target added feature. Otherwise original target dropped. drop_levels (logical(1)) TRUE (default), unused levels new target variable dropped. data (data.frame()) Data frame containing columns referenced formula x.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_classif.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to a Classification Task — as_task_classif","text":"TaskClassif.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_classif.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert to a Classification Task — as_task_classif","text":"","code":"as_task_classif(palmerpenguins::penguins, target = \"species\") #> (344 x 8) #> * Target: species #> * Properties: multiclass #> * Features (7): #> - int (3): body_mass_g, flipper_length_mm, year #> - dbl (2): bill_depth_mm, bill_length_mm #> - fct (2): island, sex"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_regr.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to a Regression Task — as_task_regr","title":"Convert to a Regression Task — as_task_regr","text":"Convert object TaskRegr. S3 generic. mlr3 ships methods following objects: TaskRegr: ensure identity formula, data.frame(), matrix(), Matrix::Matrix() DataBackend: provides alternative constructor TaskRegr. TaskClassif: Calls convert_task().","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_regr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to a Regression Task — as_task_regr","text":"","code":"as_task_regr(x, ...) # S3 method for class 'TaskRegr' as_task_regr(x, clone = FALSE, ...) # S3 method for class 'data.frame' as_task_regr( x, target = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) # S3 method for class 'matrix' as_task_regr( x, target = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) # S3 method for class 'Matrix' as_task_regr( x, target = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) # S3 method for class 'DataBackend' as_task_regr( x, target = NULL, id = deparse1(substitute(x)), label = NA_character_, ... ) # S3 method for class 'TaskClassif' as_task_regr( x, target = NULL, drop_original_target = FALSE, drop_levels = TRUE, ... ) # S3 method for class 'formula' as_task_regr( x, data, id = deparse1(substitute(data)), label = NA_character_, ... )"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_regr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to a Regression Task — as_task_regr","text":"x () Object convert. ... () Additional arguments. clone (logical(1)) TRUE, ensures returned object input x. target (character(1)) Name target column. id (character(1)) Id new task. Defaults (deparsed substituted) name data argument. label (character(1)) Label new instance. drop_original_target (logical(1)) FALSE (default), original target added feature. Otherwise original target dropped. drop_levels (logical(1)) TRUE (default), unused levels new target variable dropped. data (data.frame()) Data frame containing columns referenced formula x.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_regr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to a Regression Task — as_task_regr","text":"TaskRegr.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_regr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert to a Regression Task — as_task_regr","text":"","code":"as_task_regr(datasets::mtcars, target = \"mpg\") #> (32 x 11) #> * Target: mpg #> * Properties: - #> * Features (10): #> - dbl (10): am, carb, cyl, disp, drat, gear, hp, qsec, vs, wt"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_unsupervised.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to an Unsupervised Task — as_task_unsupervised","title":"Convert to an Unsupervised Task — as_task_unsupervised","text":"Convert object TaskUnsupervised list TaskUnsupervised.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_unsupervised.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to an Unsupervised Task — as_task_unsupervised","text":"","code":"as_task_unsupervised(x, ...) # S3 method for class 'Task' as_task_unsupervised(x, clone = FALSE, ...) # S3 method for class 'data.frame' as_task_unsupervised( x, id = deparse1(substitute(x)), label = NA_character_, ... ) # S3 method for class 'DataBackend' as_task_unsupervised( x, id = deparse1(substitute(x)), label = NA_character_, ... ) as_tasks_unsupervised(x, ...) # S3 method for class 'list' as_tasks_unsupervised(x, clone = FALSE, ...) # S3 method for class 'Task' as_tasks_unsupervised(x, clone = FALSE, ...)"},{"path":"https://mlr3.mlr-org.com/dev/reference/as_task_unsupervised.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to an Unsupervised Task — as_task_unsupervised","text":"x () Object convert. ... () Additional arguments. clone (logical(1)) TRUE, ensures returned object input x. id (character(1)) Id new task. Defaults (deparsed substituted) name data argument. label (character(1)) Label new instance.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/auto_convert.html","id":null,"dir":"Reference","previous_headings":"","what":"Column Auto-Converter — auto_convert","title":"Column Auto-Converter — auto_convert","text":"Set rules automatically convert column types. used rbind-ing Tasks, also pipe operators mlr3pipelines. rules stored functions mlr_reflections$auto_converters.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/auto_convert.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Column Auto-Converter — auto_convert","text":"","code":"auto_convert(value, id, type, levels)"},{"path":"https://mlr3.mlr-org.com/dev/reference/auto_convert.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Column Auto-Converter — auto_convert","text":"value () New values convert order match type. id (character(1)) Name column, used error messages. type (character(1)) Type convert values . levels (character() | NULL) Levels use conversion factor ordered.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/auto_convert.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Column Auto-Converter — auto_convert","text":"Vector value converted type type.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":null,"dir":"Reference","previous_headings":"","what":"Benchmark Multiple Learners on Multiple Tasks — benchmark","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"Runs benchmark arbitrary combinations tasks (Task), learners (Learner), resampling strategies (Resampling), possibly parallel. large-scale benchmarking recommend use mlr3batchmark package. package runs benchmark experiments high-performance computing clusters handles failed experiments.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"","code":"benchmark( design, store_models = FALSE, store_backends = TRUE, encapsulate = NA_character_, allow_hotstart = FALSE, clone = c(\"task\", \"learner\", \"resampling\"), unmarshal = TRUE )"},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"design (data.frame()) Data frame (data.table::data.table()) three columns: \"task\", \"learner\", \"resampling\". row defines resampling providing Task, Learner instantiated Resampling strategy. helper function benchmark_grid() can assist generating exhaustive design (see examples) instantiate Resamplings per Task. Additionally, can set additional column 'param_values', see benchmark_grid(). store_models (logical(1)) Store fitted model resulting object= Set TRUE want analyse models want extract information like variable importance. store_backends (logical(1)) Keep DataBackend Task ResampleResult? Set TRUE performance measures require Task, analyse results conveniently. Set FALSE reduce file size memory footprint serialization. current default TRUE, eventually changed future release. encapsulate (character(1)) NA, enables encapsulation setting field Learner$encapsulate one supported values: \"none\" (disable encapsulation), \"try\" (captures errors output printed console logged), \"evaluate\" (execute via evaluate) \"callr\" (start external session via callr). NA, encapsulation changed, .e. settings individual learner active. Additionally, encapsulation set \"evaluate\" \"callr\", fallback learner set featureless learner learner already fallback configured. allow_hotstart (logical(1)) Determines learner(s) hot started trained models $hotstart_stack. See also HotstartStack. clone (character()) Select input objects cloned proceeding providing set possible values \"task\", \"learner\" \"resampling\" Task, Learner Resampling, respectively. Per default, input objects cloned. unmarshal Learner Whether unmarshal learners marshaled execution. TRUE models stored unmarshaled form. FALSE, learners (need marshaling) stored marshaled form.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"BenchmarkResult.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"fitted models discarded predictions scored order reduce memory consumption. need access models later analysis, set store_models TRUE.","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":"predict-sets","dir":"Reference","previous_headings":"","what":"Predict Sets","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"want compare performance learner training performance test set, configure Learner predict multiple sets setting field predict_sets c(\"train\", \"test\") (default \"test\"). set yields separate Prediction object resampling. next step, configure measures operate respective Prediction object: (list ) created measures can finally passed $aggregate() $score().","code":"m1 = msr(\"classif.ce\", id = \"ce.train\", predict_sets = \"train\") m2 = msr(\"classif.ce\", id = \"ce.test\", predict_sets = \"test\")"},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":"parallelization","dir":"Reference","previous_headings":"","what":"Parallelization","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"function can parallelized future package. One job one resampling iteration, jobs send apply function future.apply single batch. select parallel backend, use future::plan(). parallelization can found book: https://mlr3book.mlr-org.com/chapters/chapter10/advanced_technical_aspects_of_mlr3.html","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":"progress-bars","dir":"Reference","previous_headings":"","what":"Progress Bars","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"function supports progress bars via package progressr. Simply wrap function call progressr::with_progress() enable . Alternatively, call progressr::handlers() global = TRUE enable progress bars globally. recommend progress package backend can enabled progressr::handlers(\"progress\").","code":""},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":"logging","dir":"Reference","previous_headings":"","what":"Logging","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"mlr3 uses lgr package logging. lgr supports multiple log levels can queried getOption(\"lgr.log_levels\"). suppress output reduce verbosity, can lower log default level \"info\" \"warn\": get additional log output debugging, increase log level \"debug\" \"trace\": log file data base, see documentation lgr::lgr-package.","code":"lgr::get_logger(\"mlr3\")$set_threshold(\"warn\") lgr::get_logger(\"mlr3\")$set_threshold(\"debug\")"},{"path":[]},{"path":"https://mlr3.mlr-org.com/dev/reference/benchmark.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Benchmark Multiple Learners on Multiple Tasks — benchmark","text":"","code":"# benchmarking with benchmark_grid() tasks = lapply(c(\"penguins\", \"sonar\"), tsk) learners = lapply(c(\"classif.featureless\", \"classif.rpart\"), lrn) resamplings = rsmp(\"cv\", folds = 3) design = benchmark_grid(tasks, learners, resamplings) print(design) #> task learner resampling #> #> 1: penguins classif.featureless cv #> 2: penguins classif.rpart cv #> 3: sonar classif.featureless cv #> 4: sonar classif.rpart cv set.seed(123) bmr = benchmark(design) ## Data of all resamplings head(as.data.table(bmr)) #> uhash task #> #> 1: abf787e0-59dd-4916-8212-6a77036e6265 #> 2: abf787e0-59dd-4916-8212-6a77036e6265 #> 3: abf787e0-59dd-4916-8212-6a77036e6265 #> 4: 5d035978-0665-42a1-8cab-c43d11efd7c8 #> 5: 5d035978-0665-42a1-8cab-c43d11efd7c8 #> 6: 5d035978-0665-42a1-8cab-c43d11efd7c8 #> learner resampling iteration #> #> 1: 1 #> 2: 2 #> 3: 3 #> 4: 1 #> 5: 2 #> 6: 3 #> prediction #> #> 1: #> 2: #> 3: #> 4: #> 5: #> 6: ## Aggregated performance values aggr = bmr$aggregate() print(aggr) #> nr task_id learner_id resampling_id iters classif.ce #> #> 1: 1 penguins classif.featureless cv 3 0.55819985 #> 2: 2 penguins classif.rpart cv 3 0.05230104 #> 3: 3 sonar classif.featureless cv 3 0.46632160 #> 4: 4 sonar classif.rpart cv 3 0.37950311 #> Hidden columns: resample_result ## Extract predictions of first resampling result rr = aggr$resample_result[[1]] as.data.table(rr$prediction()) #> row_ids truth response #> #> 1: 1 Adelie Adelie #> 2: 10 Adelie Adelie #> 3: 11 Adelie Adelie #> 4: 13 Adelie Adelie #> 5: 14 Adelie Adelie #> --- #> 340: 331 Chinstrap Adelie #> 341: 332 Chinstrap Adelie #> 342: 334 Chinstrap Adelie #> 343: 336 Chinstrap Adelie #> 344: 339 Chinstrap Adelie # Benchmarking with a custom design: # - fit classif.featureless on penguins with a 3-fold CV # - fit classif.rpart on sonar using a holdout tasks = list(tsk(\"penguins\"), tsk(\"sonar\")) learners = list(lrn(\"classif.featureless\"), lrn(\"classif.rpart\")) resamplings = list(rsmp(\"cv\", folds = 3), rsmp(\"holdout\")) design = data.table::data.table( task = tasks, learner = learners, resampling = resamplings ) ## Instantiate resamplings design$resampling = Map( function(task, resampling) resampling$clone()$instantiate(task), task = design$task, resampling = design$resampling ) ## Run benchmark bmr = benchmark(design) print(bmr) #>