-
Extracts kernel principle components from data. Only affects numerical features.
+
Extracts kernel principal components from data. Only affects numerical features.
See kernlab::kpca for details.
@@ -140,6 +140,9 @@ The parameters are the parameters inherited from PipeOpTaskPreproc
, as well as:
numsplits
:: numeric(1)
+
The parameters are the parameters inherited from PipeOpTaskPreproc
, as well as:
@@ -126,6 +126,9 @@
See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_randomprojection.html b/reference/mlr_pipeops_randomprojection.html
index f52de3ca1..54fa25bbf 100644
--- a/reference/mlr_pipeops_randomprojection.html
+++ b/reference/mlr_pipeops_randomprojection.html
@@ -149,6 +149,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_randomresponse.html b/reference/mlr_pipeops_randomresponse.html
index 81d39ef8f..fc3fb2997 100644
--- a/reference/mlr_pipeops_randomresponse.html
+++ b/reference/mlr_pipeops_randomresponse.html
@@ -168,6 +168,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_regravg.html b/reference/mlr_pipeops_regravg.html
index 485b24896..f509f80f5 100644
--- a/reference/mlr_pipeops_regravg.html
+++ b/reference/mlr_pipeops_regravg.html
@@ -155,6 +155,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_removeconstants.html b/reference/mlr_pipeops_removeconstants.html
index 6296e9350..4db45b1f8 100644
--- a/reference/mlr_pipeops_removeconstants.html
+++ b/reference/mlr_pipeops_removeconstants.html
@@ -136,6 +136,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_renamecolumns.html b/reference/mlr_pipeops_renamecolumns.html
index 18910cacf..f8aeb2c5a 100644
--- a/reference/mlr_pipeops_renamecolumns.html
+++ b/reference/mlr_pipeops_renamecolumns.html
@@ -140,6 +140,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_replicate.html b/reference/mlr_pipeops_replicate.html
index db9c5fccf..313c4da93 100644
--- a/reference/mlr_pipeops_replicate.html
+++ b/reference/mlr_pipeops_replicate.html
@@ -136,6 +136,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_rowapply.html b/reference/mlr_pipeops_rowapply.html
index d5102bdac..964797d31 100644
--- a/reference/mlr_pipeops_rowapply.html
+++ b/reference/mlr_pipeops_rowapply.html
@@ -139,6 +139,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_scale.html b/reference/mlr_pipeops_scale.html
index 1b0f85e0b..f09590239 100644
--- a/reference/mlr_pipeops_scale.html
+++ b/reference/mlr_pipeops_scale.html
@@ -147,6 +147,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_scalemaxabs.html b/reference/mlr_pipeops_scalemaxabs.html
index 57b87796d..49d62c94c 100644
--- a/reference/mlr_pipeops_scalemaxabs.html
+++ b/reference/mlr_pipeops_scalemaxabs.html
@@ -126,6 +126,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_scalerange.html b/reference/mlr_pipeops_scalerange.html
index ad722cf56..f25d491ed 100644
--- a/reference/mlr_pipeops_scalerange.html
+++ b/reference/mlr_pipeops_scalerange.html
@@ -135,6 +135,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_select.html b/reference/mlr_pipeops_select.html
index 216d60e1c..caab86451 100644
--- a/reference/mlr_pipeops_select.html
+++ b/reference/mlr_pipeops_select.html
@@ -139,6 +139,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_smote.html b/reference/mlr_pipeops_smote.html
index a1faecdb1..80b7e09ab 100644
--- a/reference/mlr_pipeops_smote.html
+++ b/reference/mlr_pipeops_smote.html
@@ -153,6 +153,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_smotenc.html b/reference/mlr_pipeops_smotenc.html
index 0861555a0..cb40a9fb2 100644
--- a/reference/mlr_pipeops_smotenc.html
+++ b/reference/mlr_pipeops_smotenc.html
@@ -166,6 +166,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_spatialsign.html b/reference/mlr_pipeops_spatialsign.html
index c1f57e7e2..862880021 100644
--- a/reference/mlr_pipeops_spatialsign.html
+++ b/reference/mlr_pipeops_spatialsign.html
@@ -122,6 +122,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_subsample.html b/reference/mlr_pipeops_subsample.html
index fbd08bc57..3a6c0863b 100644
--- a/reference/mlr_pipeops_subsample.html
+++ b/reference/mlr_pipeops_subsample.html
@@ -149,6 +149,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_targetinvert.html b/reference/mlr_pipeops_targetinvert.html
index 83c3d937d..9d34089f1 100644
--- a/reference/mlr_pipeops_targetinvert.html
+++ b/reference/mlr_pipeops_targetinvert.html
@@ -145,6 +145,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_targetmutate.html b/reference/mlr_pipeops_targetmutate.html
index 1bd8b7bfb..31d8e9b61 100644
--- a/reference/mlr_pipeops_targetmutate.html
+++ b/reference/mlr_pipeops_targetmutate.html
@@ -148,6 +148,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
@@ -237,8 +240,8 @@ Examples#> assert_list(inputs, len = 1L, types = "Prediction")
#> list(private$.invert(inputs[[1L]], predict_phase_state))
#> }
-#> <bytecode: 0x55e469976130>
-#> <environment: 0x55e4699f7200>
+#> <bytecode: 0x55ba05f14dc0>
+#> <environment: 0x55ba05f118c0>
#>
#> $output
#> <TaskRegr:boston_housing> (506 x 18): Boston Housing Prices
diff --git a/reference/mlr_pipeops_targettrafoscalerange.html b/reference/mlr_pipeops_targettrafoscalerange.html
index 17bc4f3d4..b5dd26fc4 100644
--- a/reference/mlr_pipeops_targettrafoscalerange.html
+++ b/reference/mlr_pipeops_targettrafoscalerange.html
@@ -140,6 +140,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
@@ -224,8 +227,8 @@ Examples#> assert_list(inputs, len = 1L, types = "Prediction")
#> list(private$.invert(inputs[[1L]], predict_phase_state))
#> }
-#> <bytecode: 0x55e469976130>
-#> <environment: 0x55e46bab7248>
+#> <bytecode: 0x55ba05f14dc0>
+#> <environment: 0x55ba068403a0>
#>
#> $output
#> <TaskRegr:boston_housing> (506 x 18): Boston Housing Prices
diff --git a/reference/mlr_pipeops_textvectorizer.html b/reference/mlr_pipeops_textvectorizer.html
index a235e0cf2..ac215f56d 100644
--- a/reference/mlr_pipeops_textvectorizer.html
+++ b/reference/mlr_pipeops_textvectorizer.html
@@ -268,6 +268,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_threshold.html b/reference/mlr_pipeops_threshold.html
index d9d2ce76c..c66b08d9a 100644
--- a/reference/mlr_pipeops_threshold.html
+++ b/reference/mlr_pipeops_threshold.html
@@ -140,6 +140,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_tomek.html b/reference/mlr_pipeops_tomek.html
index 06cc3342b..73188c266 100644
--- a/reference/mlr_pipeops_tomek.html
+++ b/reference/mlr_pipeops_tomek.html
@@ -148,6 +148,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_tunethreshold.html b/reference/mlr_pipeops_tunethreshold.html
index 19477ca14..b42dce865 100644
--- a/reference/mlr_pipeops_tunethreshold.html
+++ b/reference/mlr_pipeops_tunethreshold.html
@@ -169,6 +169,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_unbranch.html b/reference/mlr_pipeops_unbranch.html
index 4722d6ccd..b0df3c6fb 100644
--- a/reference/mlr_pipeops_unbranch.html
+++ b/reference/mlr_pipeops_unbranch.html
@@ -144,6 +144,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_updatetarget.html b/reference/mlr_pipeops_updatetarget.html
index c3248454e..c158690f7 100644
--- a/reference/mlr_pipeops_updatetarget.html
+++ b/reference/mlr_pipeops_updatetarget.html
@@ -166,6 +166,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_vtreat.html b/reference/mlr_pipeops_vtreat.html
index 0f5454c30..97d781f49 100644
--- a/reference/mlr_pipeops_vtreat.html
+++ b/reference/mlr_pipeops_vtreat.html
@@ -194,6 +194,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_pipeops_yeojohnson.html b/reference/mlr_pipeops_yeojohnson.html
index ff954d206..172467847 100644
--- a/reference/mlr_pipeops_yeojohnson.html
+++ b/reference/mlr_pipeops_yeojohnson.html
@@ -142,6 +142,9 @@ See alsomlr_pipeops_encode,
mlr_pipeops_encodeimpact
,
mlr_pipeops_encodelmer
,
+mlr_pipeops_encodepl
,
+mlr_pipeops_encodeplquantiles
,
+mlr_pipeops_encodepltree
,
mlr_pipeops_featureunion
,
mlr_pipeops_filter
,
mlr_pipeops_fixfactors
,
diff --git a/reference/mlr_tasks_boston_housing.html b/reference/mlr_tasks_boston_housing.html
index 67f305988..230b4c578 100644
--- a/reference/mlr_tasks_boston_housing.html
+++ b/reference/mlr_tasks_boston_housing.html
@@ -55,10 +55,12 @@
Format
R6Class
object inheriting from TaskRegr
.
The BostonHousing2
dataset
-containing the corrected data from III F, Myrick A (1979).
+containing the corrected data from III AMF (1979).
“The Hedonic Price Approach to Measuring Demand for Neighborhood Characteristics.”
In The Economics of Neighborhood, 191–217.
Elsevier.
+doi:10.1016/B978-0-12-636250-3.50015-5
+.
as provided by the mlbench
package. See data description there.
diff --git a/search.json b/search.json
index a4531709b..8c89af4fe 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"ext-pipeopcopy","dir":"Articles","previous_headings":"","what":"General Case Example: PipeOpCopy","title":"Adding new PipeOps","text":"simple yet useful PipeOp PipeOpCopy, takes single input creates variable number output channels, receive copy input data. simple example showcases important steps defining custom PipeOp. show simplified version , PipeOpCopyTwo, creates exactly two copies input data.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"first-steps-inheriting-from-pipeop","dir":"Articles","previous_headings":"General Case Example: PipeOpCopy","what":"First Steps: Inheriting from PipeOp","title":"Adding new PipeOps","text":"first part creating custom PipeOp inheriting PipeOp. make mental note need implement .train() .predict() function, probably want initialize() well: Note, private methods, e.g. .train .predict etc prefixed ..","code":"PipeOpCopyTwo = R6::R6Class(\"PipeOpCopyTwo\", inherit = mlr3pipelines::PipeOp, public = list( initialize = function(id = \"copy.two\") { .... }, ), private == list( .train = function(inputs) { .... }, .predict = function(inputs) { .... } ) )"},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"channel-definitions","dir":"Articles","previous_headings":"General Case Example: PipeOpCopy","what":"Channel Definitions","title":"Adding new PipeOps","text":"need tell PipeOp layout channels: many , names going , types acceptable. done initialization PipeOp (using super$initialize call) giving input output data.table objects. must three columns: \"name\" column giving names input output channels, \"train\" \"predict\" column naming class objects expect training prediction input / output. special value classes \"*\", indicates class accepted; simple copy operator accepts kind input, useful. one input, two output channels. convention, name single channel \"input\" \"output\", group channels [\"input1\", \"input2\", …], unless reason give specific different names. Therefore, input data.table single row <\"input\", \"*\", \"*\">, output table two rows, <\"output1\", \"*\", \"*\"> <\"output2\", \"*\", \"*\">. given PipeOp creator. initialize() thus look follows:","code":"initialize = function(id = \"copy.two\") { input = data.table::data.table(name = \"input\", train = \"*\", predict = \"*\") # the following will create two rows and automatically fill the `train` # and `predict` cols with \"*\" output = data.table::data.table( name = c(\"output1\", \"output2\"), train = \"*\", predict = \"*\" ) super$initialize(id, input = input, output = output ) }"},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"train-and-predict","dir":"Articles","previous_headings":"General Case Example: PipeOpCopy","what":"Train and Predict","title":"Adding new PipeOps","text":".train() .predict() receive list input must give list return. According input output definitions, always get list single element input, need return list two elements. want create two copies, just create copies using c(inputs, inputs). Two things consider: .train() function must always modify self$state variable something NULL NO_OP. $state slot used signal PipeOp trained data, even state important PipeOp (case). Therefore, .train() set self$state = list(). necessary “clone” input make deep copies, don’t modify data. However, changing reference-passed object, example changing data Task, make deep copy first. PipeOp may never modify input object reference. .train() .predict() functions now:","code":".train = function(inputs) { self$state = list() c(inputs, inputs) } .predict = function(inputs) { c(inputs, inputs) }"},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"putting-it-together","dir":"Articles","previous_headings":"General Case Example: PipeOpCopy","what":"Putting it Together","title":"Adding new PipeOps","text":"whole definition thus becomes can create instance PipeOp, put graph, see happens train something:","code":"PipeOpCopyTwo = R6::R6Class(\"PipeOpCopyTwo\", inherit = mlr3pipelines::PipeOp, public = list( initialize = function(id = \"copy.two\") { super$initialize(id, input = data.table::data.table(name = \"input\", train = \"*\", predict = \"*\"), output = data.table::data.table(name = c(\"output1\", \"output2\"), train = \"*\", predict = \"*\") ) } ), private = list( .train = function(inputs) { self$state = list() c(inputs, inputs) }, .predict = function(inputs) { c(inputs, inputs) } ) ) library(\"mlr3pipelines\") poct = PipeOpCopyTwo$new() gr = Graph$new() gr$add_pipeop(poct) print(gr) ## Graph with 1 PipeOps: ## ID State sccssors prdcssors ##
## copy.two <> result = gr$train(task) str(result) ## List of 2 ## $ copy.two.output1:Classes 'TaskClassif', 'TaskSupervised', 'Task', 'R6' ## $ copy.two.output2:Classes 'TaskClassif', 'TaskSupervised', 'Task', 'R6' "},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"ext-pipe-preproc","dir":"Articles","previous_headings":"","what":"Special Case: Preprocessing","title":"Adding new PipeOps","text":"Many PipeOps perform operation exactly one Task, return exactly one Task. may even care “Target” / “Outcome” variable task, modification input data. However, usually important Task perform prediction data columns Task train. cases, auxiliary base class PipeOpTaskPreproc exists. inherits PipeOp , PipeOps use fall kind use-case named . inheriting PipeOpTaskPreproc, one must either implement private methods .train_task() .predict_task(), methods .train_dt(), .predict_dt(), depending whether wants operate Task object data data.tables. second case, one can optionally also overload .select_cols() method, chooses incoming Task’s features given .train_dt() / .predict_dt() functions. following show two examples: PipeOpDropNA, removes Task’s rows missing values training (implements .train_task() .predict_task()), PipeOpScale, scales Task’s numeric columns (implements .train_dt(), .predict_dt(), .select_cols()).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"example-pipeopdropna","dir":"Articles","previous_headings":"Special Case: Preprocessing","what":"Example: PipeOpDropNA","title":"Adding new PipeOps","text":"Dropping rows missing values may important training model can handle . mlr3 Tasks contain view underlying data, necessary modify data remove rows missing values. Instead, rows can removed using Task’s $filter method, modifies Task -place. done private method .train_task(). take care also set $state slot signal PipeOp trained. private method .predict_task() need anything; removing missing values prediction useful, since learners handle just ignore respective rows. Furthermore, mlr3 expects Learner always return just many predictions given input rows, PipeOp removes Task rows training can used inside GraphLearner. inherit PipeOpTaskPreproc, sets input output data.tables us accept single Task. thing initialize() therefore set id (can optionally changed user). complete PipeOpDropNA can therefore written follows. Note inherits PipeOpTaskPreproc, unlike PipeOpCopyTwo example : test PipeOp, create small task missing values: test feeding new Graph uses PipeOpDropNA.","code":"PipeOpDropNA = R6::R6Class(\"PipeOpDropNA\", inherit = mlr3pipelines::PipeOpTaskPreproc, public = list( initialize = function(id = \"drop.na\") { super$initialize(id) } ), private = list( .train_task = function(task) { self$state = list() featuredata = task$data(cols = task$feature_names) exclude = apply(is.na(featuredata), 1, any) task$filter(task$row_ids[!exclude]) }, .predict_task = function(task) { # nothing to be done task } ) ) smalliris = iris[(1:5) * 30, ] smalliris[1, 1] = NA smalliris[2, 2] = NA sitask = as_task_classif(smalliris, target = \"Species\") print(sitask$data()) ## Species Petal.Length Petal.Width Sepal.Length Sepal.Width ## ## 1: setosa 1.6 0.2 NA 3.2 ## 2: versicolor 3.9 1.4 5.2 NA ## 3: versicolor 4.0 1.3 5.5 2.5 ## 4: virginica 5.0 1.5 6.0 2.2 ## 5: virginica 5.1 1.8 5.9 3.0 gr = Graph$new() gr$add_pipeop(PipeOpDropNA$new()) filtered_task = gr$train(sitask)[[1]] print(filtered_task$data()) ## Species Petal.Length Petal.Width Sepal.Length Sepal.Width ## ## 1: versicolor 4.0 1.3 5.5 2.5 ## 2: virginica 5.0 1.5 6.0 2.2 ## 3: virginica 5.1 1.8 5.9 3.0"},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"example-pipeopscalealways","dir":"Articles","previous_headings":"Special Case: Preprocessing","what":"Example: PipeOpScaleAlways","title":"Adding new PipeOps","text":"often-applied preprocessing step simply center /scale data mean \\(0\\) standard deviation \\(1\\). fits PipeOpTaskPreproc pattern quite well. always replaces columns operates , require information task’s target, needs overload .train_dt() .predict_dt() functions. saves boilerplate-code getting correct feature columns task, replacing modification. scaling makes sense numeric features, want instruct PipeOpTaskPreproc give us numeric columns. overloading .select_cols() function: called class determine columns pass .train_dt() .predict_dt(). input Task transformed, return character vector features work . overloaded, uses columns; instead, set give us numeric columns. levels() data table given .train_dt() .predict_dt() may different Task’s levels, functions must also take levels argument named list column names indicating levels. working numeric data, argument can ignored, used instead levels(dt[[column]]) factorial character columns. first PipeOp using $state slot something useful: save centering offset scaling coefficient use $.predict()! simplicity, using hyperparameters always scale center data. Compare PipeOpScaleAlways operator one defined inside mlr3pipelines package, PipeOpScale. (Note observant: check PipeOpScale.R mlr3pipelines package, notice uses “get(\"type\")” “get(\"id\")” instead “type” “id”, static code checker CRAN otherwise complain references undefined variables. “problem” data.table exclusive mlr3pipelines.) can, , create new Graph uses PipeOp test . Compare resulting data original “iris” Task data printed beginning:","code":"PipeOpScaleAlways = R6::R6Class(\"PipeOpScaleAlways\", inherit = mlr3pipelines::PipeOpTaskPreproc, public = list( initialize = function(id = \"scale.always\") { super$initialize(id = id) } ), private = list( .select_cols = function(task) { task$feature_types[type == \"numeric\", id] }, .train_dt = function(dt, levels, target) { sc = scale(as.matrix(dt)) self$state = list( center = attr(sc, \"scaled:center\"), scale = attr(sc, \"scaled:scale\") ) sc }, .predict_dt = function(dt, levels) { t((t(dt) - self$state$center) / self$state$scale) } ) ) gr = Graph$new() gr$add_pipeop(PipeOpScaleAlways$new()) result = gr$train(task) result[[1]]$data() ## Species Petal.Length Petal.Width Sepal.Length Sepal.Width ## ## 1: setosa -1.3357516 -1.3110521 -0.89767388 1.01560199 ## 2: setosa -1.3357516 -1.3110521 -1.13920048 -0.13153881 ## 3: setosa -1.3923993 -1.3110521 -1.38072709 0.32731751 ## 4: setosa -1.2791040 -1.3110521 -1.50149039 0.09788935 ## 5: setosa -1.3357516 -1.3110521 -1.01843718 1.24503015 ## --- ## 146: virginica 0.8168591 1.4439941 1.03453895 -0.13153881 ## 147: virginica 0.7035638 0.9192234 0.55148575 -1.27867961 ## 148: virginica 0.8168591 1.0504160 0.79301235 -0.13153881 ## 149: virginica 0.9301544 1.4439941 0.43072244 0.78617383 ## 150: virginica 0.7602115 0.7880307 0.06843254 -0.13153881"},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"special-case-preprocessing-with-simple-train","dir":"Articles","previous_headings":"","what":"Special Case: Preprocessing with Simple Train","title":"Adding new PipeOps","text":"possible make even simplifications many PipeOps perform mostly operation training prediction. point Task preprocessing often modify training data mostly way prediction data (way may depend training data). Consider constant feature removal, example: goal remove features variance, single factor level. However, features get removed must decided training, may depend training data. Furthermore, actual process removing features training prediction. simplification make therefore private method .get_state(task) sets $state slot training, private method .transform(task), gets called training prediction. done PipeOpTaskPreprocSimple class. Just like PipeOpTaskPreproc, one can inherit overload functions get PipeOp performs preprocessing little boilerplate code. Just like PipeOpTaskPreproc, PipeOpTaskPreprocSimple offers possibility instead overload .get_state_dt(dt, levels) .transform_dt(dt, levels) methods (optionally, , .select_cols(task) function) operate data.table feature data instead whole Task. Even methods use PipeOpTaskPreprocSimple work similar way: PipeOpScaleAlways example shown also work paradigm.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"example-pipeopdropconst","dir":"Articles","previous_headings":"Special Case: Preprocessing with Simple Train","what":"Example: PipeOpDropConst","title":"Adding new PipeOps","text":"typical example preprocessing operation almost operation training prediction operation drops features depending criterion evaluated training. One simple example dropping constant features. mlr3 Task class offers flexible view underlying data, efficient drop columns task directly using $select() function, .get_state_dt(dt, levels) / .transform_dt(dt, levels) functions get used; instead overload .get_state(task) .transform(task) methods. .get_state() function’s result saved $state slot, want return something useful dropping features. choose save names columns nonzero variance. brevity, use length(unique(column)) > 1 check whether one distinct value present; sophisticated version tolerance parameter numeric values close . .transform() method evaluated training prediction, can rely $state slot present. call Task$select function columns chose keep. full PipeOp written follows: can tested using first five rows “Iris” Task, one feature (\"Petal.Width\") constant: can also see $state correctly set. Calling $.predict() graph, even different data (whole Iris Task!) still drop \"Petal.Width\" column, .","code":"PipeOpDropConst = R6::R6Class(\"PipeOpDropConst\", inherit = mlr3pipelines::PipeOpTaskPreprocSimple, public = list( initialize = function(id = \"drop.const\") { super$initialize(id = id) } ), private = list( .get_state = function(task) { data = task$data(cols = task$feature_names) nonconst = sapply(data, function(column) length(unique(column)) > 1) list(cnames = colnames(data)[nonconst]) }, .transform = function(task) { task$select(self$state$cnames) } ) ) irishead = task$clone()$filter(1:5) irishead$data() ## Species Petal.Length Petal.Width Sepal.Length Sepal.Width ## ## 1: setosa 1.4 0.2 5.1 3.5 ## 2: setosa 1.4 0.2 4.9 3.0 ## 3: setosa 1.3 0.2 4.7 3.2 ## 4: setosa 1.5 0.2 4.6 3.1 ## 5: setosa 1.4 0.2 5.0 3.6 gr = Graph$new()$add_pipeop(PipeOpDropConst$new()) dropped_task = gr$train(irishead)[[1]] dropped_task$data() ## Species Petal.Length Sepal.Length Sepal.Width ## ## 1: setosa 1.4 5.1 3.5 ## 2: setosa 1.4 4.9 3.0 ## 3: setosa 1.3 4.7 3.2 ## 4: setosa 1.5 4.6 3.1 ## 5: setosa 1.4 5.0 3.6 gr$pipeops$drop.const$state ## $cnames ## [1] \"Petal.Length\" \"Sepal.Length\" \"Sepal.Width\" ## ## $affected_cols ## [1] \"Petal.Length\" \"Petal.Width\" \"Sepal.Length\" \"Sepal.Width\" ## ## $intasklayout ## Key: ## id type ## ## 1: Petal.Length numeric ## 2: Petal.Width numeric ## 3: Sepal.Length numeric ## 4: Sepal.Width numeric ## ## $outtasklayout ## Key: ## id type ## ## 1: Petal.Length numeric ## 2: Sepal.Length numeric ## 3: Sepal.Width numeric ## ## $outtaskshell ## Empty data.table (0 rows and 4 cols): Species,Petal.Length,Sepal.Length,Sepal.Width dropped_predict = gr$predict(task)[[1]] dropped_predict$data() ## Species Petal.Length Sepal.Length Sepal.Width ## ## 1: setosa 1.4 5.1 3.5 ## 2: setosa 1.4 4.9 3.0 ## 3: setosa 1.3 4.7 3.2 ## 4: setosa 1.5 4.6 3.1 ## 5: setosa 1.4 5.0 3.6 ## --- ## 146: virginica 5.2 6.7 3.0 ## 147: virginica 5.0 6.3 2.5 ## 148: virginica 5.2 6.5 3.0 ## 149: virginica 5.4 6.2 3.4 ## 150: virginica 5.1 5.9 3.0"},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"example-pipeopscalealwayssimple","dir":"Articles","previous_headings":"Special Case: Preprocessing with Simple Train","what":"Example: PipeOpScaleAlwaysSimple","title":"Adding new PipeOps","text":"example show PipeOpTaskPreprocSimple can used working feature data form data.table. Instead calling scale() function, center scale values calculated directly saved $state slot. .transform_dt() function perform operation training prediction: subtract center divide scale value. PipeOpScaleAlways example , use .select_cols() work numeric columns. can compare PipeOp one show behaves .","code":"PipeOpScaleAlwaysSimple = R6::R6Class(\"PipeOpScaleAlwaysSimple\", inherit = mlr3pipelines::PipeOpTaskPreprocSimple, public = list( initialize = function(id = \"scale.always.simple\") { super$initialize(id = id) } ), private = list( .select_cols = function(task) { task$feature_types[type == \"numeric\", id] }, .get_state_dt = function(dt, levels, target) { list( center = sapply(dt, mean), scale = sapply(dt, sd) ) }, .transform_dt = function(dt, levels) { t((t(dt) - self$state$center) / self$state$scale) } ) ) gr = Graph$new()$add_pipeop(PipeOpScaleAlways$new()) result_posa = gr$train(task)[[1]] gr = Graph$new()$add_pipeop(PipeOpScaleAlwaysSimple$new()) result_posa_simple = gr$train(task)[[1]] result_posa$data() ## Species Petal.Length Petal.Width Sepal.Length Sepal.Width ## ## 1: setosa -1.3357516 -1.3110521 -0.89767388 1.01560199 ## 2: setosa -1.3357516 -1.3110521 -1.13920048 -0.13153881 ## 3: setosa -1.3923993 -1.3110521 -1.38072709 0.32731751 ## 4: setosa -1.2791040 -1.3110521 -1.50149039 0.09788935 ## 5: setosa -1.3357516 -1.3110521 -1.01843718 1.24503015 ## --- ## 146: virginica 0.8168591 1.4439941 1.03453895 -0.13153881 ## 147: virginica 0.7035638 0.9192234 0.55148575 -1.27867961 ## 148: virginica 0.8168591 1.0504160 0.79301235 -0.13153881 ## 149: virginica 0.9301544 1.4439941 0.43072244 0.78617383 ## 150: virginica 0.7602115 0.7880307 0.06843254 -0.13153881 result_posa_simple$data() ## Species Petal.Length Petal.Width Sepal.Length Sepal.Width ## ## 1: setosa -1.3357516 -1.3110521 -0.89767388 1.01560199 ## 2: setosa -1.3357516 -1.3110521 -1.13920048 -0.13153881 ## 3: setosa -1.3923993 -1.3110521 -1.38072709 0.32731751 ## 4: setosa -1.2791040 -1.3110521 -1.50149039 0.09788935 ## 5: setosa -1.3357516 -1.3110521 -1.01843718 1.24503015 ## --- ## 146: virginica 0.8168591 1.4439941 1.03453895 -0.13153881 ## 147: virginica 0.7035638 0.9192234 0.55148575 -1.27867961 ## 148: virginica 0.8168591 1.0504160 0.79301235 -0.13153881 ## 149: virginica 0.9301544 1.4439941 0.43072244 0.78617383 ## 150: virginica 0.7602115 0.7880307 0.06843254 -0.13153881"},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"ext-pipe-hyperpars","dir":"Articles","previous_headings":"","what":"Hyperparameters","title":"Adding new PipeOps","text":"mlr3pipelines uses paradox package define parameter spaces PipeOps. Parameters PipeOps can modify behavior certain ways, e.g. switch centering scaling PipeOpScale operator. unified interface makes possible parameters whole Graphs modify individual PipeOp’s behavior. Graphs, encapsulated GraphLearners, can even tuned using tuning functionality mlr3tuning. Hyperparameters declared initialization, calling PipeOp’s $initialize() function, giving param_set argument. param_set must ParamSet paradox package; see documentation information define parameter spaces. construction, ParamSet can accessed $param_set slot. possible modify ParamSet, using e.g. $add() $add_dep() functions, adding PipeOp, strongly advised . Hyperparameters can set queried $values slot. setting hyperparameters, automatically checked satisfy conditions set $param_set, necessary type check . aware always possible remove hyperparameter values. PipeOp initialized, usually parameter values—$values takes value list(). possible set initial parameter values $initialize() constructor; must done super$initialize() call corresponding ParamSet must supplied. setting $values checks current $param_set, fail $param_set set yet. using underlying library function (scale function PipeOpScale, say), usually “default” behaviour function parameter given. good practice use default behaviour whenever parameter set (removed). can easily done using mlr3misc library’s mlr3misc::invoke() function, functionality similar \".call()\".","code":""},{"path":"https://mlr3pipelines.mlr-org.com/articles/extending.html","id":"hyperparameter-example-pipeopscale","dir":"Articles","previous_headings":"Hyperparameters","what":"Hyperparameter Example: PipeOpScale","title":"Adding new PipeOps","text":"use hyperparameters can best shown example PipeOpScale, similar example , PipeOpScaleAlways. difference made presence hyperparameters. PipeOpScale constructs ParamSet $initialize function passes super$initialize function: user access can set get parameters. Types automatically checked: PipeOpScale handles parameters can seen $.train_dt method: gets relevant parameters $values slot uses mlr3misc::invoke() call. advantage calling scale() directly parameter given, default value \"scale()\" function used. Another change necessary compared PipeOpScaleAlways attributes \"scaled:scale\" \"scaled:center\" always present, depending parameters, possibly need set default values \\(1\\) \\(0\\), respectively. now even possible (bit pointless) call PipeOpScale scale center set FALSE, returns original dataset, unchanged.","code":"PipeOpScale$public_methods$initialize ## function (id = \"scale\", param_vals = list()) ## .__PipeOpScale__initialize(self = self, private = private, super = super, ## id = id, param_vals = param_vals) ## pss = po(\"scale\") print(pss$param_set) ## ## id class lower upper nlevels default value ## ## 1: center ParamLgl NA NA 2 TRUE [NULL] ## 2: scale ParamLgl NA NA 2 TRUE [NULL] ## 3: robust ParamLgl NA NA 2 FALSE ## 4: affect_columns ParamUty NA NA Inf [NULL] pss$param_set$values$center = FALSE print(pss$param_set$values) ## $center ## [1] FALSE ## ## $robust ## [1] FALSE pss$param_set$values$scale = \"TRUE\" # bad input is checked! ## Error in self$assert(xs, sanitize = TRUE): Assertion on 'xs' failed: scale: Must be of type 'logical flag', not 'character'. PipeOpScale$private_methods$.train_dt ## function (dt, levels, target) ## .__PipeOpScale__.train_dt(self = self, private = private, super = super, ## dt = dt, levels = levels, target = target) ## pss$param_set$values$scale = FALSE pss$param_set$values$center = FALSE gr = Graph$new() gr$add_pipeop(pss) result = gr$train(task) result[[1]]$data() ## Species Petal.Length Petal.Width Sepal.Length Sepal.Width ## ## 1: setosa 1.4 0.2 5.1 3.5 ## 2: setosa 1.4 0.2 4.9 3.0 ## 3: setosa 1.3 0.2 4.7 3.2 ## 4: setosa 1.5 0.2 4.6 3.1 ## 5: setosa 1.4 0.2 5.0 3.6 ## --- ## 146: virginica 5.2 2.3 6.7 3.0 ## 147: virginica 5.0 1.9 6.3 2.5 ## 148: virginica 5.2 2.0 6.5 3.0 ## 149: virginica 5.4 2.3 6.2 3.4 ## 150: virginica 5.1 1.8 5.9 3.0"},{"path":"https://mlr3pipelines.mlr-org.com/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Martin Binder. Author, maintainer. Florian Pfisterer. Author. Lennart Schneider. Author. Bernd Bischl. Author. Michel Lang. Author. Sebastian Fischer. Author. Susanne Dandl. Author. Keno Mersmann. Contributor. Maximilian Mücke. Contributor. Lona Koers. Contributor.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Binder M, Pfisterer F, Lang M, Schneider L, Kotthoff L, Bischl B (2021). “mlr3pipelines - Flexible Machine Learning Pipelines R.” Journal Machine Learning Research, 22(184), 1-7. https://jmlr.org/papers/v22/21-0281.html.","code":"@Article{mlr3pipelines, title = {{mlr3pipelines} - Flexible Machine Learning Pipelines in R}, author = {Martin Binder and Florian Pfisterer and Michel Lang and Lennart Schneider and Lars Kotthoff and Bernd Bischl}, journal = {Journal of Machine Learning Research}, year = {2021}, volume = {22}, number = {184}, pages = {1-7}, url = {https://jmlr.org/papers/v22/21-0281.html}, }"},{"path":"https://mlr3pipelines.mlr-org.com/index.html","id":"mlr3pipelines-","dir":"","previous_headings":"","what":"Preprocessing Operators and Pipelines for mlr3","title":"Preprocessing Operators and Pipelines for mlr3","text":"Package website: release | dev Dataflow Programming Machine Learning R.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/index.html","id":"what-is-mlr3pipelines","dir":"","previous_headings":"","what":"What is mlr3pipelines?","title":"Preprocessing Operators and Pipelines for mlr3","text":"Watch “WhyR 2020” Webinar Presentation Youtube introduction! Find slides . mlr3pipelines dataflow programming toolkit machine learning R utilising mlr3 package. Machine learning workflows can written directed “Graphs” represent data flows preprocessing, model fitting, ensemble learning units expressive intuitive language. Using methods mlr3tuning package, even possible simultaneously optimize parameters multiple processing units. principle, mlr3pipelines defining singular data model manipulation steps “PipeOps”: pipeops can combined together define machine learning pipelines. can wrapped GraphLearner behave like Learner mlr3. learner can used resampling, benchmarking, even tuning.","code":"pca = po(\"pca\") filter = po(\"filter\", filter = mlr3filters::flt(\"variance\"), filter.frac = 0.5) learner_po = po(\"learner\", learner = lrn(\"classif.rpart\")) graph = pca %>>% filter %>>% learner_po glrn = GraphLearner$new(graph) resample(tsk(\"iris\"), glrn, rsmp(\"cv\")) #> with 10 resampling iterations #> task_id learner_id resampling_id iteration warnings errors #> iris pca.variance.classif.rpart cv 1 0 0 #> iris pca.variance.classif.rpart cv 2 0 0 #> iris pca.variance.classif.rpart cv 3 0 0 #> iris pca.variance.classif.rpart cv 4 0 0 #> iris pca.variance.classif.rpart cv 5 0 0 #> iris pca.variance.classif.rpart cv 6 0 0 #> iris pca.variance.classif.rpart cv 7 0 0 #> iris pca.variance.classif.rpart cv 8 0 0 #> iris pca.variance.classif.rpart cv 9 0 0 #> iris pca.variance.classif.rpart cv 10 0 0"},{"path":"https://mlr3pipelines.mlr-org.com/index.html","id":"feature-overview","dir":"","previous_headings":"","what":"Feature Overview","title":"Preprocessing Operators and Pipelines for mlr3","text":"Single computational steps can represented -called PipeOps, can connected directed edges Graph. scope mlr3pipelines still growing; currently supported features : Simple data manipulation preprocessing operations, e.g. PCA, feature filtering Task subsampling speed outcome class imbalance handling mlr3 Learner operations prediction stacking Simultaneous path branching (data going ways) Alternative path branching (data going one specific way, controlled hyperparameters) Ensemble methods aggregation predictions","code":""},{"path":"https://mlr3pipelines.mlr-org.com/index.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"Preprocessing Operators and Pipelines for mlr3","text":"good way get mlr3pipelines following two vignettes: Sequential Pipelines Non-Sequential Pipelines Tuning","code":""},{"path":"https://mlr3pipelines.mlr-org.com/index.html","id":"bugs-questions-feedback","dir":"","previous_headings":"","what":"Bugs, Questions, Feedback","title":"Preprocessing Operators and Pipelines for mlr3","text":"mlr3pipelines free open source software project encourages participation feedback. issues, questions, suggestions feedback, please hesitate open “issue” GitHub page! case problems / bugs, often helpful provide “minimum working example” showcases behaviour (don’t worry bug obvious). Please understand resources project limited: response may sometimes delayed days, feature suggestions may rejected deemed tangential vision behind project.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/index.html","id":"citing-mlr3pipelines","dir":"","previous_headings":"","what":"Citing mlr3pipelines","title":"Preprocessing Operators and Pipelines for mlr3","text":"use mlr3pipelines, please cite JMLR article:","code":"@Article{mlr3pipelines, title = {{mlr3pipelines} - Flexible Machine Learning Pipelines in R}, author = {Martin Binder and Florian Pfisterer and Michel Lang and Lennart Schneider and Lars Kotthoff and Bernd Bischl}, journal = {Journal of Machine Learning Research}, year = {2021}, volume = {22}, number = {184}, pages = {1-7}, url = {https://jmlr.org/papers/v22/21-0281.html}, }"},{"path":"https://mlr3pipelines.mlr-org.com/index.html","id":"similar-projects","dir":"","previous_headings":"","what":"Similar Projects","title":"Preprocessing Operators and Pipelines for mlr3","text":"predecessor package mlrCPO-package, works mlr 2.x. packages provide, varying degree, preprocessing functionality machine learning domain specific language, caret package related recipes project, dplyr package.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfAtom.html","id":null,"dir":"Reference","previous_headings":"","what":"Atoms for CNF Formulas — CnfAtom","title":"Atoms for CNF Formulas — CnfAtom","text":"CnfAtom objects represent single statement used build CNF formulae. mostly intermediate, created using %among% operator CnfAtom() directly, combined CnfClause CnfFormula objects. CnfClause CnfFormula , however, contain CnfAtom objects directly, CnfAtoms contain indirect reference CnfSymbol referencing name CnfUniverse. furthermore contain set values. CnfAtom represents statement asserting given symbol takes one given values. set values empty, CnfAtom represents contradiction (FALSE). full domain symbol, CnfAtom represents tautology (TRUE). values can converted , , logical(1) values using .logical() .CnfAtom(). CnfAtom objects can negated using ! operator, return CnfAtom representing set membership complement symbol respect domain. CnfAtoms can furthermore combined using | operator form CnfClause, using & operator form CnfFormula. happens even resulting statement represented single CnfAtom. part CNF representation tooling, currently considered experimental; internal use.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfAtom.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Atoms for CNF Formulas — CnfAtom","text":"","code":"CnfAtom(symbol, values) e1 %among% e2 as.CnfAtom(x)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfAtom.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Atoms for CNF Formulas — CnfAtom","text":"symbol (CnfSymbol) symbol atom refers. values (character) values symbol can take. e1 (CnfSymbol) Left-hand side %among% operator. Passed symbol CnfAtom(). e2 (character) Right-hand side %among% operator. Passed values CnfAtom(). x () object coerced CnfAtom .CnfAtom. logical(1) CnfAtom currently supported.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfAtom.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Atoms for CNF Formulas — CnfAtom","text":"new CnfAtom object.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfAtom.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Atoms for CNF Formulas — CnfAtom","text":"preferred overload %% operator, currently easily possible R. therefore created %among% operator. internal representation CnfAtom may change future.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfAtom.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Atoms for CNF Formulas — CnfAtom","text":"","code":"u = CnfUniverse() X = CnfSymbol(u, \"X\", c(\"a\", \"b\", \"c\")) CnfAtom(X, c(\"a\", \"b\")) #> CnfAtom: X ∈ {a, b}. X %among% \"a\" #> CnfAtom: X ∈ {a}. X %among% character(0) #> CnfAtom: X %among% c(\"a\", \"b\", \"c\") #> CnfAtom: as.logical(X %among% character(0)) #> [1] FALSE #> attr(,\"universe\") #> CnfUniverse with variables: #> X: {a, b, c} as.CnfAtom(TRUE) #> CnfAtom: !(X %among% \"a\") #> CnfAtom: X ∈ {b, c}. X %among% \"a\" | X %among% \"b\" # creates a CnfClause #> CnfClause: #> X ∈ {a, b} X %among% \"a\" & X %among% c(\"a\", \"b\") # creates a CnfFormula #> CnfFormula: #> (X ∈ {a})"},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfClause.html","id":null,"dir":"Reference","previous_headings":"","what":"Clauses in CNF Formulas — CnfClause","title":"Clauses in CNF Formulas — CnfClause","text":"CnfClause disjunction CnfAtom objects. represents statement true least one atoms true. example form CnfClause objects can constructed explicitly, using CnfClause() constructor, implicitly, using | operator CnfAtoms CnfClause objects. CnfClause objects tautologies contradictions named lists; value ranges symbol can accessed using [[, clauses can subset using [ get clauses containing indicated symbols. However, get list CnfAtom objects, use .list(). Note simplified form clause containing contradiction empty list. Upon construction, CnfClause simplified (1) removing contradictions, (2) unifying atoms refer symbol, (3) evaluating TRUE atom TRUE. Note order atoms clause preserved. Using CnfClause() lists contain CnfClause objects create clause disjunction atoms clauses. CnfClause contains atoms, FALSE atoms, evaluates FALSE. contains least one atom always true, clause evaluates TRUE. values can converted , , logical(1) values using .logical() .CnfClause(). CnfClause objects can negated using ! operator, combined using & operator. operations return CnfFormula, even result principle represented single CnfClause. part CNF representation tooling, currently considered experimental; internal use.","code":"X %among% c(\"a\", \"b\", \"c\") | Y %among% c(\"d\", \"e\", \"f\") | ..."},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfClause.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clauses in CNF Formulas — CnfClause","text":"","code":"CnfClause(atoms) as.CnfClause(x)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfClause.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clauses in CNF Formulas — CnfClause","text":"atoms (list (CnfAtom | CnfClause)) list CnfAtom CnfClause objects. clause represents disjunction atoms. x () object coerced CnfClause .CnfClause. logical(1), CnfAtom, CnfClause currently supported.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfClause.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clauses in CNF Formulas — CnfClause","text":"new CnfClause object.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfClause.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Clauses in CNF Formulas — CnfClause","text":"undecided whether better idea .list() return named list unnamed one. Calling .list() CnfClause tautology returns tautology-atom, name. currently return named list clauses, makes subsetting name commute .list(). However, behaviour may change future.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfClause.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Clauses in CNF Formulas — CnfClause","text":"","code":"u = CnfUniverse() X = CnfSymbol(u, \"X\", c(\"a\", \"b\", \"c\")) Y = CnfSymbol(u, \"Y\", c(\"d\", \"e\", \"f\")) CnfClause(list(X %among% c(\"a\", \"b\"), Y %among% c(\"d\", \"e\"))) #> CnfClause: #> X ∈ {a, b} | Y ∈ {d, e} cls = X %among% c(\"a\", \"b\") | Y %among% c(\"d\", \"e\") cls #> CnfClause: #> X ∈ {a, b} | Y ∈ {d, e} as.list(cls) #> [[1]] #> CnfAtom: X ∈ {a, b}. #> #> [[2]] #> CnfAtom: Y ∈ {d, e}. #> as.CnfClause(X %among% c(\"a\", \"b\")) #> CnfClause: #> X ∈ {a, b} # The same symbols are unified X %among% \"a\" | Y %among% \"d\" | X %among% \"b\" #> CnfClause: #> X ∈ {a, b} | Y ∈ {d} # tautology evaluates to TRUE X %among% \"a\" | X %among% \"b\" | X %among% \"c\" #> CnfClause: TRUE # contradictions are removed X %among% \"a\" | Y %among% character(0) #> CnfClause: #> X ∈ {a} # create CnfFormula: !(X %among% \"a\" | Y %among% \"d\") #> CnfFormula: #> (X ∈ {b, c}) #> & (Y ∈ {e, f}) # also a CnfFormula, even if it contains a single clause: !CnfClause(list(X %among% \"a\")) #> CnfFormula: #> (X ∈ {b, c}) (X %among% c(\"a\", \"c\") | Y %among% \"d\") & (X %among% c(\"a\", \"b\") | Y %among% \"d\") #> CnfFormula: #> (X ∈ {a} | Y ∈ {d})"},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfFormula.html","id":null,"dir":"Reference","previous_headings":"","what":"CNF Formulas — CnfFormula","title":"CNF Formulas — CnfFormula","text":"CnfFormula conjunction CnfClause objects. represents statement true clauses true. example form CnfFormula objects can constructed explicitly, using CnfFormula() constructor, implicitly, using & operator CnfAtoms, CnfClauses, CnfFormula objects. get individual clauses formula, [[ used; instead, use .list(). Note simplified form formula containing tautology empty list. Upon construction, CnfFormula simplified using various heuristics. includes unit propagation, subsumption elimination, self/hidden subsumption elimination, hidden tautology elimination, resolution subsumption elimination (see examples). Note order clauses formula preserved. Using CnfFormula() lists contain CnfFormula objects create formula conjunction clauses formulas. may somewhat efficient applying & many times row. CnfFormula contains clauses, TRUE clauses, evaluates TRUE. contains least one clause , , always false, formula evaluates FALSE. contradictions clauses recognized, however. values can converted , , logical(1) values using .logical() .CnfFormula(). CnfFormula objects can negated using ! operator. Beware may lead exponential blow-number clauses. part CNF representation tooling, currently considered experimental; internal use.","code":"(X %among% \"a\" | Y %among% \"d\") & Z %among% \"g\""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfFormula.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"CNF Formulas — CnfFormula","text":"","code":"CnfFormula(clauses) as.CnfFormula(x)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfFormula.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"CNF Formulas — CnfFormula","text":"clauses (list CnfClause) list CnfClause objects. formula represents conjunction clauses. x () object coerced CnfFormula .CnfFormula. logical(1), CnfAtom, CnfClause, CnfFormula currently supported.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfFormula.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"CNF Formulas — CnfFormula","text":"new CnfFormula object.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfFormula.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"CNF Formulas — CnfFormula","text":"","code":"u = CnfUniverse() X = CnfSymbol(u, \"X\", c(\"a\", \"b\", \"c\")) Y = CnfSymbol(u, \"Y\", c(\"d\", \"e\", \"f\")) Z = CnfSymbol(u, \"Z\", c(\"g\", \"h\", \"i\")) frm = (X %among% c(\"a\", \"b\") | Y %among% c(\"d\", \"e\")) & Z %among% c(\"g\", \"h\") frm #> CnfFormula: #> (Z ∈ {g, h}) #> & (X ∈ {a, b} | Y ∈ {d, e}) # retrieve individual clauses as.list(frm) #> [[1]] #> CnfClause: #> Z ∈ {g, h} #> #> [[2]] #> CnfClause: #> X ∈ {a, b} | Y ∈ {d, e} #> # Negation of a formula # Note the parentheses, otherwise `!` would be applied to the first clause only. !((X %among% c(\"a\", \"b\") | Y %among% c(\"d\", \"e\")) & Z %among% c(\"g\", \"h\")) #> CnfFormula: #> (X ∈ {c} | Z ∈ {i}) #> & (Y ∈ {f} | Z ∈ {i}) ## unit propagation # The second clause can not be satisfied when X is \"b\", so \"b\" can be # removed from the possibilities in the first clause. (X %among% c(\"a\", \"b\") | Y %among% c(\"d\", \"e\")) & X %among% c(\"a\", \"c\") #> CnfFormula: #> (X ∈ {a, c}) #> & (X ∈ {a} | Y ∈ {d, e}) ## subsumption elimination # The first clause is a subset of the second clause; whenever the # first clause is satisfied, the second clause is satisfied as well, so the # second clause can be removed. (X %among% \"a\" | Y %among% c(\"d\", \"e\")) & (X %among% c(\"a\", \"b\") | Y %among% c(\"d\", \"e\") | Z %among% \"g\") #> CnfFormula: #> (X ∈ {a} | Y ∈ {d, e}) ## self subsumption elimination # If the first clause is satisfied but X is not \"a\", then Y must be \"e\". # The `Y %among% \"d\"` part of the first clause can therefore be removed. (X %among% c(\"a\", \"b\") | Y %among% \"d\") & (X %among% \"a\" | Y %among% \"e\") #> CnfFormula: #> (X ∈ {a, b}) #> & (X ∈ {a} | Y ∈ {e}) ## resolution subsumption elimination # The first two statements can only be satisfied if Y is either \"d\" or \"e\", # since when X is \"a\" then Y must be \"e\", and when X is \"b\" then Y must be \"d\". # The third statement is therefore implied by the first two, and can be # removed. (X %among% \"a\" | Y %among% \"d\") & (X %among% \"b\" | Y %among% \"e\") & (Y %among% c(\"d\", \"e\")) #> CnfFormula: #> (X ∈ {a} | Y ∈ {d}) #> & (X ∈ {b} | Y ∈ {e}) ## hidden tautology elimination / hidden subsumption elimination # When considering the first two clauses only, adding another atom # `Z %among% \"i\"` to the first clause would not change the formula, since # whenever Z is \"i\", the second clause would need to be satisfied in a way # that would also satisfy the first clause, making this atom redundant # (\"hidden literal addition\"). Considering the pairs of clause 1 and 3, and # clauses 1 and 4, one could likewise add `Z %among% \"g\"` and #' `Z %among% \"h\"`, respectively. This would reveal the first clausee to be # a \"hidden\" tautology: it is equivalent to a clause containing the # atom `Z %among% c(\"g\", \"h\", \"i\")` == TRUE. # Alternatively, one could perform \"hidden\" resolution subsumption using # clause 4 after having added the atom `Z %among% c(\"g\", \"i\")` to the first # clause by using clauses 2 and 3. (X %among% c(\"a\", \"b\") | Y %among% c(\"d\", \"e\")) & (X %among% \"a\" | Z %among% c(\"g\", \"h\")) & (X %among% \"b\" | Z %among% c(\"h\", \"i\")) & (Y %among% c(\"d\", \"e\") | Z %among% c(\"g\", \"i\")) #> CnfFormula: #> (X ∈ {a} | Z ∈ {g, h}) #> & (X ∈ {b} | Z ∈ {h, i}) #> & (Y ∈ {d, e} | Z ∈ {g, i}) ## Simple contradictions are recognized: (X %among% \"a\") & (X %among% \"b\") #> CnfFormula: FALSE # Tautologies are preserved (X %among% c(\"a\", \"b\", \"c\")) & (Y %among% c(\"d\", \"e\", \"f\")) #> CnfFormula: TRUE # But not all contradictions are recognized. # Builtin heuristic CnfFormula preprocessing is not a SAT solver. contradiction = (X %among% \"a\" | Y %among% \"d\") & (X %among% \"b\" | Y %among% \"e\") & (X %among% \"c\" | Y %among% \"f\") contradiction #> CnfFormula: FALSE # Negation of a contradiction results in a tautology, which is recognized # and simplified to TRUE. However, note that this operation (1) generally has # exponential complexity in the number of terms and (2) is currently also not # particularly well optimized !contradiction #> CnfFormula: TRUE"},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfSymbol.html","id":null,"dir":"Reference","previous_headings":"","what":"Symbols for CNF Formulas — CnfSymbol","title":"Symbols for CNF Formulas — CnfSymbol","text":"Representation Symbols used CNF formulas. Symbols name domain (set possible values), stored CnfUniverse. created, currently intended modify delete symbols. Symbols can used CNF formulas creating CnfAtom objects, either using %among% operator using CnfAtom() constructor explicitly. part CNF representation tooling, currently considered experimental; internal use.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfSymbol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Symbols for CNF Formulas — CnfSymbol","text":"","code":"CnfSymbol(universe, name, domain)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfSymbol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Symbols for CNF Formulas — CnfSymbol","text":"universe (CnfUniverse) universe symbol defined. name (character(1)) name symbol. domain (character) domain, .e. set possible values symbol. Must empty.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfSymbol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Symbols for CNF Formulas — CnfSymbol","text":"new CnfSymbol object.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfSymbol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Symbols for CNF Formulas — CnfSymbol","text":"","code":"u = CnfUniverse() X = CnfSymbol(u, \"X\", c(\"a\", \"b\", \"c\")) # Use symbols to create CnfAtom objects X %among% c(\"a\", \"b\") #> CnfAtom: X ∈ {a, b}. X %among% \"a\" #> CnfAtom: X ∈ {a}. X %among% character(0) #> CnfAtom: X %among% c(\"a\", \"b\", \"c\") #> CnfAtom: "},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfUniverse.html","id":null,"dir":"Reference","previous_headings":"","what":"Symbol Table for CNF Formulas — CnfUniverse","title":"Symbol Table for CNF Formulas — CnfUniverse","text":"symbol table CNF formulas. CnfUniverse -reference object stores domain symbol. Symbols created CnfSymbol() can retrieved $. Using [[ retrieves given symbol's domain. possible combine symbols (identical) universe. part CNF representation tooling, currently considered experimental; internal use.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfUniverse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Symbol Table for CNF Formulas — CnfUniverse","text":"","code":"CnfUniverse()"},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfUniverse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Symbol Table for CNF Formulas — CnfUniverse","text":"new CnfUniverse object.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/CnfUniverse.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Symbol Table for CNF Formulas — CnfUniverse","text":"","code":"u = CnfUniverse() X = CnfSymbol(u, \"X\", c(\"a\", \"b\", \"c\")) Y = CnfSymbol(u, \"Y\", c(\"d\", \"e\", \"f\")) u$X #> CnfSymbol 'X' with domain {a, b, c}. u[[\"Y\"]] #> [1] \"d\" \"e\" \"f\" X %among% c(\"a\", \"c\") #> CnfAtom: X ∈ {a, c}. u$X %among% c(\"a\", \"c\") #> CnfAtom: X ∈ {a, c}. Y %among% c(\"d\", \"e\", \"f\") #> CnfAtom: Y %among% character(0) #> CnfAtom: u$X %among% \"a\" | u$Y %among% \"d\" #> CnfClause: #> X ∈ {a} | Y ∈ {d}"},{"path":"https://mlr3pipelines.mlr-org.com/reference/Graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Graph Base Class — Graph","title":"Graph Base Class — Graph","text":"Graph representation machine learning pipeline graph. can trained, subsequently used prediction. Graph useful used together Learner objects encapsulated PipeOpLearner. case, Graph produces Prediction data $predict() phase can used Learner (using GraphLearner wrapper). However, Graph can also used without Learner objects simply perform preprocessing data, , principle, even need handle data can used general processes dependency structure (although PipeOps need written).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Graph.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Graph Base Class — Graph","text":"R6Class.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Graph.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Graph Base Class — Graph","text":"","code":"Graph$new()"},{"path":"https://mlr3pipelines.mlr-org.com/reference/Graph.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Graph Base Class — Graph","text":"Graph made list PipeOps, data.table edges. training prediction, Graph performs topological sorting PipeOps executes respective $train() $predict() functions order, moving PipeOp results along edges input PipeOps.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Graph.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Graph Base Class — Graph","text":"pipeops :: named list PipeOp Contains PipeOps Graph, named PipeOp's $ids. edges :: data.table columns src_id (character), src_channel (character), dst_id (character), dst_channel (character) Table connections PipeOps. data.table. src_id dst_id $ids PipeOps must present $pipeops list. src_channel dst_channel must respectively $output $input channel names respective PipeOps. is_trained :: logical(1) Graph, .e. PipeOps, trained, can Graph used prediction? lhs :: character Ids 'left-hand-side' PipeOps unconnected input channels therefore act Graph input layer. rhs :: character Ids 'right-hand-side' PipeOps unconnected output channels therefore act Graph output layer. input :: data.table columns name (character), train (character), predict (character), op.id (character), channel.name (character) Input channels Graph. channel lists name, input type training, input type prediction, PipeOp $id PipeOp channel pertains , channel name PipeOp knows . output :: data.table columns name (character), train (character), predict (character), op.id (character), channel.name (character) Output channels Graph. channel lists name, output type training, output type prediction, PipeOp $id PipeOp channel pertains , channel name PipeOp knows . packages :: character Set required packages various methods Graph, set union required packages contained PipeOp objects. state :: named list Get / Set $state members PipeOp. param_set :: ParamSet Parameters parameter constraints. Parameter values $param_set$values. union $param_sets PipeOps Graph. Parameter names seen Graph naming scheme .. Changing $param_set$values also propagates changes directly contained PipeOps alternative changing PipeOps $param_set$values directly. hash :: character(1) Stores checksum calculated Graph configuration, includes PipeOp hashes (therefore $param_set$values) hash $edges. phash :: character(1) Stores checksum calculated Graph configuration, includes PipeOp hashes except $param_set$values, hash $edges. keep_results :: logical(1) Whether store intermediate results PipeOp's $.result slot, mostly debugging purposes. Default FALSE. man :: character(1) Identifying string help page shows help().","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Graph.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Graph Base Class — Graph","text":"ids(sorted = FALSE) (logical(1)) -> character Get IDs PipeOps. order PipeOps added sorted FALSE, topologically sorted sorted TRUE. add_pipeop(op, clone = TRUE) (PipeOp | Learner | Filter | ..., logical(1)) -> self Mutates Graph adding PipeOp Graph. add edges, new PipeOp connected within Graph first. Instead supplying PipeOp directly, object can naturally converted PipeOp can also supplied, e.g. Learner Filter; see as_pipeop(). argument given op cloned clone TRUE (default); access Graph's PipeOps -reference, use $pipeops. Note $add_pipeop() relatively low-level operation, recommended build graphs using %>>%. add_edge(src_id, dst_id, src_channel = NULL, dst_channel = NULL) (character(1), character(1), character(1) | numeric(1) | NULL, character(1) | numeric(1) | NULL) -> self Add edge PipeOp src_id, channel src_channel (identified name number listed PipeOp's $output), PipeOp dst_id's channel dst_channel (identified name number listed PipeOp's $input). source destination PipeOp one input / output channel src_channel / dst_channel therefore unambiguous, can omitted (.e. left NULL). chain(gs, clone = TRUE) (list Graphs, logical(1)) -> self Takes list Graphs PipeOps (objects can automatically converted Graphs PipeOps, see as_graph() as_pipeop()) inputs joins serial Graph coming self, connecting using %>>%. plot(html = FALSE, horizontal = FALSE) (logical(1), logical(1)) -> NULL Plot Graph, using either igraph package (html = FALSE, default) visNetwork package html = TRUE producing htmlWidget. htmlWidget can rescaled using visOptions. html = FALSE, orientation plotted graph can controlled horizontal. print(dot = FALSE, dotname = \"dot\", fontsize = 24L) (logical(1), character(1), integer(1)) -> NULL Print representation Graph console. dot FALSE, output table one row contained PipeOp columns ID ($id PipeOp), State (short representation $state PipeOp), sccssors (PipeOps take input directly PipeOp line), prdcssors (PipeOps produce data read input PipeOp line). dot TRUE, print DOT representation Graph console. DOT output can named via argument dotname fontsize can also specified. set_names(old, new) (character, character) -> self Rename PipeOps: Change ID PipeOp identified old corresponding item new. used instead changing PipeOp's $id value directly! update_ids(prefix = \"\", postfix = \"\") (character, character) -> self Pre- postfix PipeOp's existing ids. prefix postfix default \"\", .e. changes. train(input, single_input = TRUE) (, logical(1)) -> named list Train Graph traversing Graphs' edges calling PipeOp's $train methods turn. Return named list outputs unconnected PipeOp -channel, named according Graph's $output name column. training, $state member PipeOps set $is_trained slot Graph (individual PipeOp) consequently set TRUE. single_input TRUE, input value sent unconnected PipeOp's input channel (listed Graph's $input). Typically, input Task, although dependent PipeOps Graph. single_input FALSE, input list length Graph's $input table rows; list item sent corresponding input channel Graph. input named list, names must correspond input channel names ($input$name) inputs sent channels name; otherwise sent channels order listed $input. predict(input, single_input = TRUE) (, logical(1)) -> list Predict Graph calling PipeOp's $train methods. Input output, well function single_input argument, analogous $train(). help(help_type) (character(1)) -> help file Displays help file concrete PipeOp instance. help_type one \"text\", \"html\", \"pdf\" behaves help_type argument R's help().","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/Graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Graph Base Class — Graph","text":"","code":"library(\"mlr3\") g = Graph$new()$ add_pipeop(PipeOpScale$new(id = \"scale\"))$ add_pipeop(PipeOpPCA$new(id = \"pca\"))$ add_edge(\"scale\", \"pca\") g$input #> name train predict op.id channel.name #> #> 1: scale.input Task Task scale input g$output #> name train predict op.id channel.name #> #> 1: pca.output Task Task pca output task = tsk(\"iris\") trained = g$train(task) trained[[1]]$data() #> Species PC1 PC2 PC3 PC4 #> #> 1: setosa -2.2571412 -0.47842383 0.12727962 -0.02408751 #> 2: setosa -2.0740130 0.67188269 0.23382552 -0.10266284 #> 3: setosa -2.3563351 0.34076642 -0.04405390 -0.02828231 #> 4: setosa -2.2917068 0.59539986 -0.09098530 0.06573534 #> 5: setosa -2.3818627 -0.64467566 -0.01568565 0.03580287 #> --- #> 146: virginica 1.8642579 -0.38567404 -0.25541818 -0.38795715 #> 147: virginica 1.5593565 0.89369285 0.02628330 -0.21945690 #> 148: virginica 1.5160915 -0.26817075 -0.17957678 -0.11877324 #> 149: virginica 1.3682042 -1.00787793 -0.93027872 -0.02604141 #> 150: virginica 0.9574485 0.02425043 -0.52648503 0.16253353 task$filter(1:10) predicted = g$predict(task) predicted[[1]]$data() #> Species PC1 PC2 PC3 PC4 #> #> 1: setosa -2.257141 -0.47842383 0.12727962 -0.024087508 #> 2: setosa -2.074013 0.67188269 0.23382552 -0.102662845 #> 3: setosa -2.356335 0.34076642 -0.04405390 -0.028282305 #> 4: setosa -2.291707 0.59539986 -0.09098530 0.065735340 #> 5: setosa -2.381863 -0.64467566 -0.01568565 0.035802870 #> 6: setosa -2.068701 -1.48420530 -0.02687825 -0.006586116 #> 7: setosa -2.435868 -0.04748512 -0.33435030 0.036652767 #> 8: setosa -2.225392 -0.22240300 0.08839935 0.024529919 #> 9: setosa -2.326845 1.11160370 -0.14459247 0.026769540 #> 10: setosa -2.177035 0.46744757 0.25291827 0.039766068"},{"path":"https://mlr3pipelines.mlr-org.com/reference/Multiplicity.html","id":null,"dir":"Reference","previous_headings":"","what":"Multiplicity — Multiplicity","title":"Multiplicity — Multiplicity","text":"Multiplicity class S3 object. function multiplicities indicate PipeOps executed multiple times multiple values. Multiplicity container, like list(), contains multiple values. message passed along edge Graph Multiplicity-object, PipeOp receives object usually called contained value. result calls , , packed Multiplicity sent along outgoing edge(s) PipeOp. means Multiplicity can cause multiple PipeOps row run multiple times, run element Multiplicity independent others. PipeOps return Multiplicity input Multiplicity (run code multiple times, entry). However, special PipeOps \"aware\" Multiplicity objects. may either create Multiplicity even though Multiplicity input (e.g. PipeOpReplicate PipeOpOVRSplit) – causing subsequent PipeOps run multiple times – collect Multiplicity, called even though input Multiplicity (e.g. PipeOpOVRUnite PipeOpFeatureUnion constructed collect_multiplicity argument set TRUE). combination mechanisms makes possible parts Graph called variably many times \"sandwiched\" Multiplicity creating collecting PipeOps. Whether PipeOp creates collects Multiplicity indicated $input $output slot (indicate names types /channels). train predict types input output surrounded square brackets (\"[\", \"]\"), channel handles Multiplicity explicitly. Depending function PipeOp, usually collect (input channel) create (output channel) Multiplicity. PipeOps without indicator Multiplicity agnostic blindly execute function multiple times given Multiplicity. PipeOp trained Multiplicity, $state slot set Multiplicity well; Multiplicity contains \"original\" $state resulting individual call PipeOP input Multiplicity's content. PipeOp trained Multiplicity, predict() argument must Multiplicity number elements.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Multiplicity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multiplicity — Multiplicity","text":"","code":"Multiplicity(...)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/Multiplicity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multiplicity — Multiplicity","text":"... Can anything.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Multiplicity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multiplicity — Multiplicity","text":"Multiplicity","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/NO_OP.html","id":null,"dir":"Reference","previous_headings":"","what":"No-Op Sentinel Used for Alternative Branching — NO_OP","title":"No-Op Sentinel Used for Alternative Branching — NO_OP","text":"Special data type -ops. Distinct NULL easier debugging distinction unintentional NULL returns.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/NO_OP.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"No-Op Sentinel Used for Alternative Branching — NO_OP","text":"","code":"NO_OP"},{"path":"https://mlr3pipelines.mlr-org.com/reference/NO_OP.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"No-Op Sentinel Used for Alternative Branching — NO_OP","text":"R6 object.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOp.html","id":null,"dir":"Reference","previous_headings":"","what":"PipeOp Base Class — PipeOp","title":"PipeOp Base Class — PipeOp","text":"PipeOp represents transformation given \"input\" given \"output\", two stages: \"training\" \"prediction\". can understood generalized function multiple inputs, also multiple outputs (well two stages). \"training\" stage used training machine learning pipeline fitting statistical model, \"predicting\" stage used making predictions new data. perform training, $train() function called takes inputs transforms , simultaneously storing information $state slot. prediction, $predict() function called, $state information can used influence transformation new data. PipeOp usually used Graph object, representation computational graph. can multiple input channels—think multiple arguments function, example averaging different models—, multiple output channels—transformation may return different objects, example different subsets Task. purpose Graph connect different outputs PipeOps inputs PipeOps. Input output channel information PipeOp defined $input $output slots; channel name, required type training, required type prediction. $train() $predict() function called list argument one entry declared channel (one exception, see next paragraph). list automatically type-checked channel $input passed private$.train() private$.predict() functions. data processed result list created. list type-checked declared output types channel. length types result list declared $output. special input channel name \"...\", creates vararg channel takes arbitrarily many arguments, type. $input table contains \"...\"-entry, input given $train() $predict() may longer number declared input channels. class abstract base class PipeOps used Graph inherit , intended instantiated.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOp.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"PipeOp Base Class — PipeOp","text":"Abstract R6Class.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOp.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"PipeOp Base Class — PipeOp","text":"id :: character(1) Identifier resulting object. See $id slot. param_set :: ParamSet | list expression Parameter space description. created subclass given super$initialize(). ParamSet, used PipeOp's ParamSet directly. Otherwise must list expressions e.g. created alist() evaluate ParamSets. ParamSet combined using ParamSetCollection. param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings given param_set. subclass param_vals parameter pass super$initialize(). Default list(). input :: data.table columns name (character), train (character), predict (character) Sets $input slot resulting object; see description . output :: data.table columns name (character), train (character), predict (character) Sets $output slot resulting object; see description . packages :: character Set required packages PipeOp's $train $predict methods. See $packages slot. Default character(0). tags ::character set tags associated PipeOp. Tags describe PipeOp's purpose. Can used filter .data.table(mlr_pipeops). Default \"abstract\", indicating abstract PipeOp.","code":"PipeOp$new(id, param_set = ps(), param_vals = list(), input, output, packages = character(0), tags = character(0))"},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOp.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"PipeOp Base Class — PipeOp","text":"PipeOp abstract class abstract functions private$.train() private$.predict(). create functional PipeOp class, two methods must implemented. functions receives named list according PipeOp's input channels, must return list (names ignored) values order output channels $output. private$.train() private$.predict() function called user; instead, $train() $predict() used. convenient usage add PipeOp Graph (possibly singleton Graph), using Graph's $train() / $predict() methods. private$.train() private$.predict() treat inputs read-. R6 objects, cloned manipulated -place. Objects, parts objects, changed, need cloned, legal return identical--reference objects multiple outputs.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOp.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"PipeOp Base Class — PipeOp","text":"id :: character ID PipeOp. IDs user-configurable, IDs PipeOps must unique within Graph. IDs PipeOps must changed part Graph, instead Graph's $set_names() method used. packages :: character Packages required PipeOp. Functions base R still called using :: (explicitly attached using require()) private$.train() private$.predict(), packages declared checked (possibly expensive) processing started within Graph. param_set :: ParamSet Parameters parameter constraints. Parameter values influence functioning $train / $predict $param_set$values slot; automatically checked parameter constraints $param_set. state :: | NULL Method-dependent state obtained training step, usually required prediction step. NULL PipeOp trained. $state slot can reliably modified $train(), private$.train() may theoretically executed different R-session (e.g. parallelization). $state furthermore always set something copy-semantics, since never cloned. limitation PipeOp mlr3pipelines, way system whole works, together GraphLearner mlr3. input :: data.table columns name (character), train (character), predict (character) Input channels PipeOp. Column name gives names (order) values list given $train() $predict(). Column train (S3) class input object must conform training, column predict (S3) class input object must conform prediction. Types checked PipeOp need checked private$.train() / private$.predict() code. special name \"...\", creates vararg input channel accepts variable number inputs. row train predict values enclosed square brackets (\"[\", \"]), channel Multiplicity-aware. PipeOp receives Multiplicity value channels, Multiplicity given .train() .predict() functions directly. Otherwise, Multiplicity transparently unpacked .train() .predict() functions called multiple times, Multiplicity element. type enclosed square brackets indicates Multiplicity containing values type accepted. See Multiplicity information. output :: data.table columns name (character), train (character), predict (character) Output channels PipeOp, order given list returned $train $predict functions. Column train (S3) class output object must conform training, column predict (S3) class output object must conform prediction. PipeOp checks values returned private$.train() private$.predict() types specifications. row train predict values enclosed square brackets (\"[\", \"]), signals channel emits Multiplicity indicated type. See Multiplicity information. innum :: numeric(1) Number input channels. equals nrow($input). outnum :: numeric(1) Number output channels. equals nrow($output). is_trained :: logical(1) Indicate whether PipeOp already trained can therefore used prediction. tags ::character set tags associated PipeOp. Tags describe PipeOp's purpose. Can used filter .data.table(mlr_pipeops). PipeOp tags inherited child classes can introduce additional tags. hash :: character(1) Checksum calculated PipeOp, depending PipeOp's class slots $id $param_set$values. PipeOp's functionality may change depending values, inherit $hash active binding calculate hash digest(list(super$hash, ), algo = \"xxhash64\"). phash :: character(1) Checksum calculated PipeOp, depending PipeOp's class slots $id ignoring $param_set$values. PipeOp's functionality may change depending values, inherit $hash active binding calculate hash digest(list(super$hash, ), algo = \"xxhash64\"). .result :: list Graph's $keep_results flag set TRUE, intermediate Results $train() $predict() saved slot, exactly returned functions. mainly debugging purposes done, requested, Graph backend ; done explicitly private$.train() private$.predict(). man :: character(1) Identifying string help page shows help(). properties :: character() properties pipeop. Currently supported values : \"validation\": PipeOp can make use $internal_valid_task mlr3::Task. example used PipeOpLearners wrap Learner property, see mlr3::Learner. PipeOps property, also $validate field, controls whether use validation task, well $internal_valid_scores field, allows access internal validation scores training. \"internal_tuning\": PipeOp able internally optimize hyperparameters. works analogously internal tuning implementation mlr3::Learner. PipeOps property also implement standardized accessor $internal_tuned_values least one parameter tagged \"internal_tuning\". example PipeOp PipeOpLearner wraps Learner \"internal_tuning\" property. Programatic access available properties possible via mlr_reflections$pipeops$properties.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOp.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"PipeOp Base Class — PipeOp","text":"train(input) (list) -> named list Train PipeOp inputs, transform output store learned $state. PipeOp already trained, already present $state overwritten. Input list typechecked $input train column. Return value list many entries $output rows, entry named $output name column class according $output train column. workhorse function training PipeOp private .train(input): (named list) -> list function. Abstract function must implemented concrete subclasses. private$.train() called $train() typechecking. must change $state value something non-NULL return list transformed data according $output train column. Names returned list ignored. private$.train() method called user; instead, $train() method used checking possibly type conversion. predict(input) (list) -> named list Predict new data input, possibly using stored $state. Input output specified $input $output way $train(), except predict column used type checking. workhorse function predicting using PipeOp .predict(input) (named list) -> list Abstract function must implemented concrete subclasses. private$.predict() called $predict() typechecking works analogously private$.train(). Unlike private$.train(), private$.predict() modify PipeOp way. Just private$.train(), private$.predict() called user; instead, $predict() method used. print() () -> NULL Prints PipeOps salient information: $id, $is_trained, $param_set$values, $input $output. help(help_type) (character(1)) -> help file Displays help file concrete PipeOp instance. help_type one \"text\", \"html\", \"pdf\" behaves help_type argument R's help().","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOp.html","id":"inheriting","dir":"Reference","previous_headings":"","what":"Inheriting","title":"PipeOp Base Class — PipeOp","text":"create PipeOp, need overload private$.train() private$.test() functions. likely also necessary overload $initialize() function additional initialization. $initialize() method least arguments id param_vals, passed super$initialize() unchanged. id useful default value, param_vals default value list(), meaning initialization hyperparameters. $initialize() method arguments, necessary also overload private$.additional_phash_input() function. function return either objects, hash objects, can change function behavior PipeOp independent class, id, $state, $param_set$values. last point particularly important: changing $param_set$values change return value private$.additional_phash_input().","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"PipeOp Base Class — PipeOp","text":"","code":"# example (bogus) PipeOp that returns the sum of two numbers during $train() # as well as a letter of the alphabet corresponding to that sum during $predict(). PipeOpSumLetter = R6::R6Class(\"sumletter\", inherit = PipeOp, # inherit from PipeOp public = list( initialize = function(id = \"posum\", param_vals = list()) { super$initialize(id, param_vals = param_vals, # declare \"input\" and \"output\" during construction here # training takes two 'numeric' and returns a 'numeric'; # prediction takes 'NULL' and returns a 'character'. input = data.table::data.table(name = c(\"input1\", \"input2\"), train = \"numeric\", predict = \"NULL\"), output = data.table::data.table(name = \"output\", train = \"numeric\", predict = \"character\") ) } ), private = list( # PipeOp deriving classes must implement .train and # .predict; each taking an input list and returning # a list as output. .train = function(input) { sum = input[[1]] + input[[2]] self$state = sum list(sum) }, .predict = function(input) { list(letters[self$state]) } ) ) posum = PipeOpSumLetter$new() print(posum) #> PipeOp: (not trained) #> values: #> Input channels : #> input1 [numeric,NULL], input2 [numeric,NULL] #> Output channels : #> output [numeric,character] posum$train(list(1, 2)) #> $output #> [1] 3 #> # note the name 'output' is the name of the output channel specified # in the $output data.table. posum$predict(list(NULL, NULL)) #> $output #> [1] \"c\" #>"},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpEnsemble.html","id":null,"dir":"Reference","previous_headings":"","what":"Ensembling Base Class — PipeOpEnsemble","title":"Ensembling Base Class — PipeOpEnsemble","text":"Parent class PipeOps aggregate predictions. Implements private$.train() private$.predict() methods necessary PipeOp requires deriving classes create private$weighted_avg_predictions() function.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpEnsemble.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Ensembling Base Class — PipeOpEnsemble","text":"Abstract R6Class inheriting PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpEnsemble.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Ensembling Base Class — PipeOpEnsemble","text":"Note: object typically constructed via derived class, e.g. PipeOpClassifAvg PipeOpRegrAvg. innum :: numeric(1) Determines number input channels. innum 0 (default), vararg input channel created can take arbitrary number inputs. collect_multiplicity :: logical(1) TRUE, input Multiplicity collecting channel. means, Multiplicity input, instead multiple normal inputs, accepted members aggregated. requires innum 0. Default FALSE. id :: character(1) Identifier resulting object. param_set :: ParamSet (\"Hyper\"-)Parameters form ParamSet resulting PipeOp. param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list(). packages :: character Set packages required PipeOp. packages loaded $train() $predict(), attached. Default character(0). prediction_type :: character(1) predict entry $input $output type specifications. \"Prediction\" (default) one subclasses, e.g. \"PredictionClassif\", correspond type accepted private$.train() private$.predict().","code":"PipeOpEnsemble$new(innum = 0, collect_multiplicity = FALSE, id, param_set = ps(), param_vals = list(), packages = character(0), prediction_type = \"Prediction\")"},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpEnsemble.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Ensembling Base Class — PipeOpEnsemble","text":"PipeOpEnsemble multiple input channels depending innum construction argument, named \"input1\", \"input2\", ... innum nonzero; innum 0, one vararg input channel named \"...\". input channels take NULL training take Prediction prediction. PipeOpEnsemble one output channel named \"output\", producing NULL training Prediction prediction. output prediction way weighted averaged representation input.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpEnsemble.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Ensembling Base Class — PipeOpEnsemble","text":"$state left empty (list()).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpEnsemble.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Ensembling Base Class — PipeOpEnsemble","text":"weights :: numeric Relative weights input predictions. length 1, ignored weighs inputs equally. Otherwise must length equal number connected inputs. Initialized 1 (equal weights).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpEnsemble.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Ensembling Base Class — PipeOpEnsemble","text":"commonality ensemble methods using PipeOpEnsemble take NULL-input training save empty $state. can used following set PipeOpLearner PipeOps perform (possibly weighted) prediction averaging. See e.g. PipeOpClassifAvg PipeOpRegrAvg inherit class. necessary use output preceding Learners \"training\" phase, PipeOpEnsemble used. fact, training time behaviour Learner important, one use PipeOpLearnerCV instead PipeOpLearner, ensemble can created Learner encapsulated PipeOpLearner. See LearnerClassifAvg LearnerRegrAvg examples.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpEnsemble.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Ensembling Base Class — PipeOpEnsemble","text":"fields inherited PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpEnsemble.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Ensembling Base Class — PipeOpEnsemble","text":"Methods inherited PipeOp well : weighted_avg_prediction(inputs, weights, row_ids, truth) (list Prediction, numeric, integer | character, list) -> NULL Create Predictions correspond weighted average incoming Predictions. called private$.predict() cleaned sanity-checked values: inputs guaranteed fit together, row_ids truth guaranteed one inputs, weights guaranteed length inputs. method abstract, must implemented deriving classes.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpImpute.html","id":null,"dir":"Reference","previous_headings":"","what":"Imputation Base Class — PipeOpImpute","title":"Imputation Base Class — PipeOpImpute","text":"Abstract base class feature imputation.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpImpute.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Imputation Base Class — PipeOpImpute","text":"Abstract R6Class object inheriting PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpImpute.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Imputation Base Class — PipeOpImpute","text":"id :: character(1) Identifier resulting object. See $id slot PipeOp. param_set :: ParamSet Parameter space description. created subclass given super$initialize(). param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings given param_set. subclass param_vals parameter pass super$initialize(). Default list(). whole_task_dependent :: logical(1) Whether context_columns parameter added lets user limit columns used imputation inference. generally FALSE imputation depends individual features (e.g. mode imputation), TRUE imputation depends features well (e.g. kNN-imputation). packages :: character Set required packages PipeOp's private$.train private$.predict methods. See $packages slot. Default character(0). task_type :: character(1) class Task accepted input returned output. generally character(1) identifying type Task, e.g. \"Task\", \"TaskClassif\" \"TaskRegr\" (another subclass introduced packages). Default \"Task\". feature_types :: character Feature types affected PipeOp. See private$.select_cols() information.","code":"PipeOpImpute$$new(id, param_set = ps(), param_vals = list(), whole_task_dependent = FALSE, packages = character(0), task_type = \"Task\")"},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpImpute.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Imputation Base Class — PipeOpImpute","text":"PipeOpImpute one input channel named \"input\", taking Task, subclass Task task_type construction argument given ; training prediction. PipeOpImpute one output channel named \"output\", producing Task, subclass; Task type input; training prediction. output Task modified input Task features imputed according private$.impute() function.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpImpute.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Imputation Base Class — PipeOpImpute","text":"$state named list; besides members added inheriting classes, members : affected_cols :: character Names features selected affect_columns parameter. context_cols :: character Names features selected context_columns parameter. intasklayout :: data.table Copy training Task's $feature_types slot. used prediction ensure prediction Task features, feature layout, feature types training. outtasklayout :: data.table Copy trained Task's $feature_types slot. used prediction ensure Task resulting prediction operation features, feature layout, feature types training. model :: named list Model used imputation. list named Task features, containing result private$.train_imputer() private$.train_nullmodel() function one. imputed_train :: character Names features imputed training. used ensure factor levels added training also added prediction. Note features imputed prediction training still inconsistent factor levels.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpImpute.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Imputation Base Class — PipeOpImpute","text":"affect_columns :: function | Selector | NULL columns PipeOpImpute operate . parameter must Selector function, takes Task argument returns character features use. See Selector example functions. Defaults NULL, selects features. context_columns :: function | Selector | NULL columns PipeOpImpute imputation may depend . parameter present constructor called whole_task_dependent argument set TRUE. parameter must Selector function, takes Task argument returns character features use. See Selector example functions. Defaults NULL, selects features.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpImpute.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Imputation Base Class — PipeOpImpute","text":"PipeOpImpute abstract class inheriting PipeOp makes implementing imputer PipeOps simple.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpImpute.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Imputation Base Class — PipeOpImpute","text":"Fields inherited PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpImpute.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Imputation Base Class — PipeOpImpute","text":"Methods inherited PipeOp, well : .select_cols(task) (Task) -> character Selects columns PipeOp operates . contrast affect_columns parameter. private$.select_cols() inheriting class determine columns operator function , e.g. based feature type, affect_columns way user limit columns PipeOpTaskPreproc operate . method can optionally overloaded inheriting PipeOpImpute; method overloaded, defaults selecting columns type indicated feature_types construction argument. .train_imputer(feature, type, context) (atomic, character(1), data.table) -> Abstract function must overloaded inheriting. Called feature selected affect_columns create model entry used private$.impute(). function called features least one non-missing value. .train_nullmodel(feature, type, context) (atomic, character(1), data.table) -> Like .train_imputer(), called feature contains missing values. abstract function , overloaded, gives default response 0 (integer, numeric), c(TRUE, FALSE) (logical), available levels (factor/ordered), empty string (character). .impute(feature, type, model, context) (atomic, character(1), , data.table) -> atomic Imputes features. model model created private$.train_imputer() Default behaviour assume model atomic vector values sampled impute missing values feature. model may attribute probabilities non-uniform sampling.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTargetTrafo.html","id":null,"dir":"Reference","previous_headings":"","what":"Target Transformation Base Class — PipeOpTargetTrafo","title":"Target Transformation Base Class — PipeOpTargetTrafo","text":"Base class handling target transformation operations. Target transformations different feature transformation \"inverted\" prediction. target transformed training phase information invert transformation sent along PipeOpTargetInvert inverts transformation prediction phase. inversion may need info training prediction data. Users can overload four private$-functions: .get_state() (optional), .transform() (mandatory), .train_invert() (optional), .invert() (mandatory).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTargetTrafo.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Target Transformation Base Class — PipeOpTargetTrafo","text":"Abstract R6Class inheriting PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTargetTrafo.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Target Transformation Base Class — PipeOpTargetTrafo","text":"id :: character(1) Identifier resulting object. See $id slot PipeOp. param_set :: ParamSet Parameter space description. created subclass given super$initialize(). param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings given param_set. subclass param_vals parameter pass super$initialize(). Default list(). task_type_in :: character(1) class Task accepted input. generally character(1) identifying type Task, e.g. \"Task\", \"TaskClassif\" \"TaskRegr\" (another subclass introduced packages). Default \"Task\". task_type_out :: character(1) class Task produced output. generally character(1) identifying type Task, e.g. \"Task\", \"TaskClassif\" \"TaskRegr\" (another subclass introduced packages). Default value task_type_in. packages :: character Set required packages PipeOp's methods. See $packages slot. Default character(0). tags :: character | NULL Tags resulting PipeOp. added tag \"target transform\". Default NULL.","code":"PipeOpTargetTrafo$new(id, param_set = ps(), param_vals = list() packages = character(0), task_type_in = \"Task\", task_type_out = task_type_in, tags = NULL)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTargetTrafo.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Target Transformation Base Class — PipeOpTargetTrafo","text":"PipeOpTargetTrafo one input channels named \"input\" taking Task (whatever class specified task_type construction) training prediction. PipeOpTargetTrafo two output channels named \"fun\" \"output\". training, \"fun\" returns NULL prediction, \"fun\" returns function can later used invert transformation done training according overloaded .train_invert() .invert() functions. \"output\" returns modified input Task (task_type) according overloaded transform() function training prediction.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTargetTrafo.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Target Transformation Base Class — PipeOpTargetTrafo","text":"$state named list returned explicitly user overloaded .get_state() function.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTargetTrafo.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Target Transformation Base Class — PipeOpTargetTrafo","text":"PipeOpTargetTrafo abstract class inheriting PipeOp. implements private$.train() private$.predict() functions. functions perform checks go call .get_state(), .transform(), .train_invert(). .invert() packaged sent along \"fun\" output applied Prediction PipeOpTargetInvert. subclass PipeOpTargetTrafo implement functions used combination PipeOpTargetInvert.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTargetTrafo.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Target Transformation Base Class — PipeOpTargetTrafo","text":"Fields inherited PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTargetTrafo.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Target Transformation Base Class — PipeOpTargetTrafo","text":"Methods inherited PipeOp, well : .get_state(task) (Task) -> list Called PipeOpTargetTrafo's implementation private$.train(). Takes single Task input returns list set $state. .get_state() called single time training right .transform() called. return value (.e. $state) contain info needed .transform() well .invert(). base implementation returns list() overloaded setting state desired. .transform(task, phase) (Task, character(1)) -> Task Called PipeOpTargetTrafo's implementation private$.train() private$.predict(). Takes single Task input modifies . typically consist calculating new target modifying Task using convert_task function. .transform() called training prediction target (needed also type) input Task must transformed times. Note unlike $.train(), argument list singular Task, return object also list singular Task. phase argument \"train\" training phase \"predict\" prediction phase can used enable different behaviour training prediction. phase \"train\", $state slot (previously set .get_state()) may also modified, alternatively addition overloading .get_state(). input cloned possible changed -place. function abstract overloaded inheriting classes. .train_invert(task) (Task) -> Called PipeOpTargetTrafo's implementation private$.predict(). Takes single Task input returns arbitrary value given predict_phase_state .invert(). modify input Task . base implementation returns list single element, $truth column Task, overloaded training-phase-dependent state desired. .invert(prediction, predict_phase_state) (Prediction, ) -> Prediction Takes Prediction predict_phase_state object input inverts prediction. function sent \"fun\" PipeOpTargetInvert. function abstract overloaded inheriting classes. Care taken predict_type Prediction inverted handled well. .invert_help(predict_phase_state) (predict_phase_state object) -> function Helper function packages .invert() can later used inversion.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreproc.html","id":null,"dir":"Reference","previous_headings":"","what":"Task Preprocessing Base Class — PipeOpTaskPreproc","title":"Task Preprocessing Base Class — PipeOpTaskPreproc","text":"Base class handling \"preprocessing\" operations. operations exactly one Task input one Task output, expect column layout Tasks input output . Prediction-behavior preprocessing operations always independent row input-Task. means prediction-operation preprocessing-PipeOps commute rbind(): Running prediction n-row Task result result rbind()-ing prediction-result n 1-row Tasks content. large majority cases, number order rows also changed prediction. Users must implement private$.train_task() private$.predict_task(), Task input return Task. Task , possible, manipulated -place, cloned. Alternatively, private$.train_dt() private$.predict_dt() functions can implemented, operate data.table objects instead. generally done data way altered (e.g. PCA changing columns principal components) columns added removed (e.g. feature selection) done Task-level private$.train_task(). private$.select_cols() function can overloaded private$.train_dt() private$.predict_dt() operate subsets Task's data, e.g. numerical columns. can_subset_cols argument constructor TRUE (default), hyperparameter affect_columns added, can limit columns Task modified PipeOpTaskPreproc using Selector function. Note functionality entirely independent private$.select_cols() functionality. PipeOpTaskPreproc useful operations behave differently training prediction. operations perform essentially operation need perform extra work build $state training, PipeOpTaskPreprocSimple class can used instead.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreproc.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Task Preprocessing Base Class — PipeOpTaskPreproc","text":"Abstract R6Class inheriting PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreproc.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Task Preprocessing Base Class — PipeOpTaskPreproc","text":"id :: character(1) Identifier resulting object. See $id slot PipeOp. param_set :: ParamSet Parameter space description. created subclass given super$initialize(). param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings given param_set. subclass param_vals parameter pass super$initialize(). Default list(). can_subset_cols :: logical(1) Whether affect_columns parameter added lets user limit columns modified PipeOpTaskPreproc. generally FALSE operation adds removes rows Task, TRUE otherwise. Default TRUE. packages :: character Set required packages PipeOp's private$.train() private$.predict() methods. See $packages slot. Default character(0). task_type :: character(1) class Task accepted input returned output. generally character(1) identifying type Task, e.g. \"Task\", \"TaskClassif\" \"TaskRegr\" (another subclass introduced packages). Default \"Task\". tags :: character | NULL Tags resulting PipeOp. added tag \"data transform\". Default NULL. feature_types :: character Feature types affected PipeOp. See private$.select_cols() information. Defaults available feature types.","code":"PipeOpTaskPreproc$new(id, param_set = ps(), param_vals = list(), can_subset_cols = TRUE, packages = character(0), task_type = \"Task\", tags = NULL, feature_types = mlr_reflections$task_feature_types)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreproc.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Task Preprocessing Base Class — PipeOpTaskPreproc","text":"PipeOpTaskPreproc one input channel named \"input\", taking Task, subclass Task task_type construction argument given ; training prediction. PipeOpTaskPreproc one output channel named \"output\", producing Task, subclass; Task type input; training prediction. output Task modified input Task according overloaded private$.train_task()/private$.predict_taks() private$.train_dt()/private$.predict_dt() functions.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreproc.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Task Preprocessing Base Class — PipeOpTaskPreproc","text":"$state named list; besides members added inheriting classes, members : affect_cols :: character Names features selected affect_columns parameter, present; names present features otherwise. intasklayout :: data.table Copy training Task's $feature_types slot. used prediction ensure prediction Task features, feature layout, feature types training. outtasklayout :: data.table Copy trained Task's $feature_types slot. used prediction ensure Task resulting prediction operation features, feature layout, feature types training. dt_columns :: character Names features selected private$.select_cols() call training. present private$.train_dt() functionality used, present private$.train_task() function overloaded instead. feature_types :: character Feature types affected PipeOp. See private$.select_cols() information.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreproc.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Task Preprocessing Base Class — PipeOpTaskPreproc","text":"affect_columns :: function | Selector | NULL columns PipeOpTaskPreproc operate . parameter present constructor called can_subset_cols argument set TRUE (default). parameter must Selector function, takes Task argument returns character features use. See Selector example functions. Defaults NULL, selects features.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreproc.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Task Preprocessing Base Class — PipeOpTaskPreproc","text":"PipeOpTaskPreproc abstract class inheriting PipeOp. implements private$.train() $.predict() functions. functions perform checks go call private$.train_task() private$.predict_task(). subclass PipeOpTaskPreproc may implement functions, implement private$.train_dt() private$.predict_dt() instead. works default implementations private$.train_task() private$.predict_task() call private$.train_dt() private$.predict_dt(), respectively. affect_columns functionality works unsetting columns removing \"col_role\" processing, adding afterwards setting col_role \"feature\".","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreproc.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Task Preprocessing Base Class — PipeOpTaskPreproc","text":"Fields inherited PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreproc.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Task Preprocessing Base Class — PipeOpTaskPreproc","text":"Methods inherited PipeOp, well : .train_task (Task) -> Task Called PipeOpTaskPreproc's implementation private$.train(). Takes single Task input modifies (ideally -place without cloning) storing information $state slot. Note unlike $.train(), argument list singular Task, return object also list singular Task. Also, contrary private$.train(), $state generated must list, PipeOpTaskPreproc add additional slots (see Section State). Care taken avoid name collisions $state elements added private$.train_task() PipeOpTaskPreproc. default function calls private$.train_dt() function, can overloaded perform operations Task directly. .predict_task (Task) -> Task Called PipeOpTaskPreproc's implementation $.predict(). Takes single Task input modifies (ideally -place without cloning) using information $state slot. Works analogously private$.train_task(). private$.predict_task() overloaded private$.train_task() overloaded (.e. private$.train_dt() used). .train_dt(dt, levels, target) (data.table, named list, ) -> data.table | data.frame | matrix Train PipeOpTaskPreproc dt, transform store state $state. transformed object must returned can converted data.table using .data.table. dt need copied deliberately, possible encouraged change -place. levels argument named list factor levels factorial character features. input Task inherits TaskSupervised, target argument contains $truth() information training Task; type depends Task type trained . method can overloaded inheriting PipeOpTaskPreproc, together private$.predict_dt() optionally private$.select_cols(); alternatively, private$.train_task() private$.predict_task() can overloaded. .predict_dt(dt, levels) (data.table, named list) -> data.table | data.frame | matrix Predict new data dt, possibly using stored $state. transformed object must returned can converted data.table using .data.table. dt need copied deliberately, possible encouraged change -place. levels argument named list factor levels factorial character features. method can overloaded inheriting PipeOpTaskPreproc, together private$.train_dt() optionally private$.select_cols(); alternatively, private$.train_task() private$.predict_task() can overloaded. .select_cols(task) (Task) -> character Selects columns PipeOp operates , private$.train_dt() private$.predict_dt() overloaded. function called private$.train_task() private$.predict_task() overloaded. contrast affect_columns parameter. private$.select_cols() inheriting class determine columns operator function , e.g. based feature type, affect_columns way user limit columns PipeOpTaskPreproc operate . method can optionally overloaded inheriting PipeOpTaskPreproc, together private$.train_dt() private$.predict_dt(); alternatively, private$.train_task() private$.predict_task() can overloaded. method overloaded, defaults selecting type indicated feature_types construction argument.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreprocSimple.html","id":null,"dir":"Reference","previous_headings":"","what":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","title":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","text":"Base class handling many \"preprocessing\" operations perform essentially operation training prediction. Instead implementing private$.train_task() private$.predict_task() operation, private$.get_state() private$.transform() operation needs defined, take one argument: Task. Alternatively, analogously PipeOpTaskPreproc approach offering private$.train_dt()/private$.predict_dt(), private$.get_state_dt() private$.transform_dt() functions may implemented. private$.get_state must change input value -place must return something written $state (must NULL), private$.transform() modify argument -place; called training prediction. inherits PipeOpTaskPreproc behaves essentially .","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreprocSimple.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","text":"Abstract R6Class inheriting PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreprocSimple.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","text":"(Construction identical PipeOpTaskPreproc.) id :: character(1) Identifier resulting object. See $id slot PipeOp. param_set :: ParamSet Parameter space description. created subclass given super$initialize(). param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings given param_set. subclass param_vals parameter pass super$initialize(). Default list(). can_subset_cols :: logical(1) Whether affect_columns parameter added lets user limit columns modified PipeOpTaskPreprocSimple. generally FALSE operation adds removes rows Task, TRUE otherwise. Default TRUE. packages :: character Set required packages PipeOp's private$.train() private$.predict() methods. See $packages slot. Default character(0). task_type :: character(1) class Task accepted input returned output. generally character(1) identifying type Task, e.g. \"Task\", \"TaskClassif\" \"TaskRegr\" (another subclass introduced packages). Default \"Task\".","code":"PipeOpTaskPreprocSimple$new(id, param_set = ps(), param_vals = list(), can_subset_cols = TRUE, packages = character(0), task_type = \"Task\")"},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreprocSimple.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","text":"Input output channels inherited PipeOpTaskPreproc. output training prediction Task, modified private$.transform() private$.transform_dt().","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreprocSimple.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","text":"$state named list $state elements inherited PipeOpTaskPreproc.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreprocSimple.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","text":"parameters parameters inherited PipeOpTaskPreproc.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreprocSimple.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","text":"PipeOpTaskPreprocSimple abstract class inheriting PipeOpTaskPreproc implementing private$.train_task() private$.predict_task() functions. subclass PipeOpTaskPreprocSimple may implement functions private$.get_state() private$.transform(), alternatively functions private$.get_state_dt() private$.transform_dt() (well private$.select_cols(), latter case). works default implementations private$.get_state() private$.transform() call private$.get_state_dt() private$.transform_dt().","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreprocSimple.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","text":"Fields inherited PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/PipeOpTaskPreprocSimple.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Simple Task Preprocessing Base Class — PipeOpTaskPreprocSimple","text":"Methods inherited PipeOpTaskPreproc, well : .get_state(task) (Task) -> named list Store create something stored $state training phase PipeOpTaskPreprocSimple. state can influence private$.transform() function. Note private$.get_state() must return state, store $state. strictly necessary implement either private$.get_state() private$.get_state_dt(); implemented, state stored list(). method can optionally overloaded inheriting PipeOpTaskPreprocSimple, together private$.transform(); alternatively, private$.get_state_dt() (optional) private$.transform_dt() (possibly private$.select_cols(), PipeOpTaskPreproc) can overloaded. .transform(task) (Task) -> Task Predict new data task, possibly using stored $state. task cloned, instead changed -place. method called training prediction phase, essentially behave independently phase. (incongruent functionality implemented, inherit PipeOpTaskPreproc, PipeOpTaskPreprocSimple.) method can overloaded inheriting PipeOpTaskPreprocSimple, optionally private$.get_state(); alternatively, private$.get_state_dt() (optional) private$.transform_dt() (possibly private$.select_cols(), PipeOpTaskPreproc) can overloaded. .get_state_dt(dt) (data.table) -> named list Create something stored $state training phase PipeOpTaskPreprocSimple. state can influence private$.transform_dt() function. Note private$.get_state_dt() must return state, store $state. neither private$.get_state() private$.get_state_dt() overloaded, state stored list(). method can optionally overloaded inheriting PipeOpTaskPreprocSimple, together private$.transform_dt() (optionally private$.select_cols(), PipeOpTaskPreproc); Alternatively, private$.get_state() (optional) private$.transform() can overloaded. .transform_dt(dt) (data.table) -> data.table | data.frame | matrix Predict new data dt, possibly using stored $state. transformed object must returned can converted data.table using .data.table. dt need copied deliberately, possible encouraged change -place. method called training prediction phase, essentially behave independently phase. (incongruent functionality implemented, inherit PipeOpTaskPreproc, PipeOpTaskPreprocSimple.) method can optionally overloaded inheriting PipeOpTaskPreprocSimple, together private$.transform_dt() (optionally private$.select_cols(), PipeOpTaskPreproc); Alternatively, private$.get_state() (optional) private$.transform() can overloaded.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/Selector.html","id":null,"dir":"Reference","previous_headings":"","what":"Selector Functions — Selector","title":"Selector Functions — Selector","text":"Selector function used different PipeOps, prominently PipeOpSelect many PipeOps inheriting PipeOpTaskPreproc, determine subset Tasks operate . Even though Selector function can written , preferable use Selector constructors shown . can called arguments create Selector, can given PipeOpSelect selector parameter, many PipeOpTaskPreprocs' affect_columns parameter. See examples usage.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Selector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Selector Functions — Selector","text":"","code":"selector_all() selector_none() selector_type(types) selector_grep(pattern, ignore.case = FALSE, perl = FALSE, fixed = FALSE) selector_name(feature_names, assert_present = FALSE) selector_invert(selector) selector_intersect(selector_x, selector_y) selector_union(selector_x, selector_y) selector_setdiff(selector_x, selector_y) selector_missing() selector_cardinality_greater_than(min_cardinality)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/Selector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Selector Functions — Selector","text":"types (character) Type feature select pattern (character(1)) grep pattern ignore.case (logical(1)) ignore case perl (logical(1)) perl regex fixed (logical(1)) fixed pattern instead regex feature_names (character) Select features exact name match. assert_present (logical(1)) Throw error feature_names present task operated . selector (Selector)Selector invert. selector_x (Selector) First Selector query. selector_y (Selector) Second Selector query. min_cardinality (integer) Minimum number levels required selected.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Selector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Selector Functions — Selector","text":"function: Selector function takes Task returns feature names processed.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Selector.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Selector Functions — Selector","text":"selector_all(): selector_all selects features. selector_none(): selector_none selects none features. selector_type(): selector_type selects features according type. Legal types listed mlr_reflections$task_feature_types. selector_grep(): selector_grep selects features names matching grep() pattern. selector_name(): selector_name selects features names matching exactly names listed. selector_invert(): selector_invert inverts given Selector: always selects features dropped Selector, drops features kept. selector_intersect(): selector_intersect selects intersection two Selectors: features selected Selectors selected end. selector_union(): selector_union selects union two Selectors: Features selected either Selector selected end. selector_setdiff(): selector_setdiff selects setdiff two Selectors: Features selected selector_x selected, unless also selected selector_y. selector_missing(): selector_missing selects features missing values. selector_cardinality_greater_than(): selector_cardinality_greater_than selects categorical features cardinality greater given threshold.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/Selector.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Selector Functions — Selector","text":"Selector function one input argument (commonly named task). function called Task PipeOp operating . return value function must character vector subset feature names present Task. example, Selector selects columns (selector_all()-Selector.) Selector selects columns names shorter four letters : Selector selects column \"Sepal.Length\" (iris task), present, preferable use Selector construction functions like select_type, select_grep etc. possible, instead writing custom Selectors.","code":"function(task) { task$feature_names } function(task) { task$feature_names[ nchar(task$feature_names) < 4 ] } function(task) { intersect(task$feature_names, \"Sepal.Length\") }"},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/Selector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Selector Functions — Selector","text":"","code":"library(\"mlr3\") iris_task = tsk(\"iris\") bh_task = tsk(\"boston_housing\") sela = selector_all() sela(iris_task) #> [1] \"Petal.Length\" \"Petal.Width\" \"Sepal.Length\" \"Sepal.Width\" sela(bh_task) #> [1] \"age\" \"b\" \"chas\" \"crim\" \"dis\" \"indus\" \"lat\" #> [8] \"lon\" \"lstat\" \"nox\" \"ptratio\" \"rad\" \"rm\" \"tax\" #> [15] \"town\" \"tract\" \"zn\" self = selector_type(\"factor\") self(iris_task) #> character(0) self(bh_task) #> [1] \"chas\" \"town\" selg = selector_grep(\"a.*i\") selg(iris_task) #> [1] \"Petal.Width\" \"Sepal.Width\" selg(bh_task) #> [1] \"ptratio\" selgi = selector_invert(selg) selgi(iris_task) #> [1] \"Petal.Length\" \"Sepal.Length\" selgi(bh_task) #> [1] \"age\" \"b\" \"chas\" \"crim\" \"dis\" \"indus\" \"lat\" \"lon\" \"lstat\" #> [10] \"nox\" \"rad\" \"rm\" \"tax\" \"town\" \"tract\" \"zn\" selgf = selector_union(selg, self) selgf(iris_task) #> [1] \"Petal.Width\" \"Sepal.Width\" selgf(bh_task) #> [1] \"ptratio\" \"chas\" \"town\""},{"path":"https://mlr3pipelines.mlr-org.com/reference/add_class_hierarchy_cache.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Class Hierarchy to the Cache — add_class_hierarchy_cache","title":"Add a Class Hierarchy to the Cache — add_class_hierarchy_cache","text":"Add class hierarchy class hierarchy cache. necessary whenever S3 class's class hierarchy important inferring compatibility types.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/add_class_hierarchy_cache.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Class Hierarchy to the Cache — add_class_hierarchy_cache","text":"","code":"add_class_hierarchy_cache(hierarchy)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/add_class_hierarchy_cache.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a Class Hierarchy to the Cache — add_class_hierarchy_cache","text":"hierarchy character class hierarchy add; correspond class() lowest object hierarchy.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/add_class_hierarchy_cache.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Class Hierarchy to the Cache — add_class_hierarchy_cache","text":"NULL","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/add_class_hierarchy_cache.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Class Hierarchy to the Cache — add_class_hierarchy_cache","text":"","code":"# This lets mlr3pipelines handle \"data.table\" as \"data.frame\". # This is an example and not necessary, because mlr3pipelines adds it by default. add_class_hierarchy_cache(c(\"data.table\", \"data.frame\"))"},{"path":"https://mlr3pipelines.mlr-org.com/reference/as.Multiplicity.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert an object to a Multiplicity — as.Multiplicity","title":"Convert an object to a Multiplicity — as.Multiplicity","text":"Convert object Multiplicity.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/as.Multiplicity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert an object to a Multiplicity — as.Multiplicity","text":"","code":"as.Multiplicity(x)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/as.Multiplicity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert an object to a Multiplicity — as.Multiplicity","text":"x () Object convert.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/as.Multiplicity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert an object to a Multiplicity — as.Multiplicity","text":"Multiplicity","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/as_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Conversion to mlr3pipelines Graph — as_graph","title":"Conversion to mlr3pipelines Graph — as_graph","text":"argument turned Graph possible. clone TRUE, deep copy made incoming object Graph ensure resulting object different reference incoming object. as_graph() S3 method can therefore implemented packages may add objects can naturally converted Graphs. default, as_graph() tries apply gunion() x list, recursively applies as_graph() list elements first create Graph one element x PipeOp can converted one using as_pipeop().","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/as_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conversion to mlr3pipelines Graph — as_graph","text":"","code":"as_graph(x, clone = FALSE)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/as_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conversion to mlr3pipelines Graph — as_graph","text":"x () Object convert. clone (logical(1)) Whether return (deep copied) clone x Graph.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/as_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Conversion to mlr3pipelines Graph — as_graph","text":"Graph x deep clone .","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/as_pipeop.html","id":null,"dir":"Reference","previous_headings":"","what":"Conversion to mlr3pipelines PipeOp — as_pipeop","title":"Conversion to mlr3pipelines PipeOp — as_pipeop","text":"argument turned PipeOp possible. clone TRUE, deep copy made incoming object PipeOp ensure resulting object different reference incoming object. as_pipeop() S3 method can therefore implemented packages may add objects can naturally converted PipeOps. Objects can converted example Learner (using PipeOpLearner) Filter (using PipeOpFilter).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/as_pipeop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conversion to mlr3pipelines PipeOp — as_pipeop","text":"","code":"as_pipeop(x, clone = FALSE)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/as_pipeop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conversion to mlr3pipelines PipeOp — as_pipeop","text":"x () Object convert. clone (logical(1)) Whether return (deep copied) clone x PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/as_pipeop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Conversion to mlr3pipelines PipeOp — as_pipeop","text":"PipeOp x deep clone .","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/assert_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Assertion for mlr3pipelines Graph — assert_graph","title":"Assertion for mlr3pipelines Graph — assert_graph","text":"Function checks given object Graph throws error .","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/assert_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assertion for mlr3pipelines Graph — assert_graph","text":"","code":"assert_graph(x)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/assert_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assertion for mlr3pipelines Graph — assert_graph","text":"x () Object check.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/assert_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assertion for mlr3pipelines Graph — assert_graph","text":"Graph invisible(x)","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/assert_pipeop.html","id":null,"dir":"Reference","previous_headings":"","what":"Assertion for mlr3pipelines PipeOp — assert_pipeop","title":"Assertion for mlr3pipelines PipeOp — assert_pipeop","text":"Function checks given object PipeOp throws error .","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/assert_pipeop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assertion for mlr3pipelines PipeOp — assert_pipeop","text":"","code":"assert_pipeop(x)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/assert_pipeop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assertion for mlr3pipelines PipeOp — assert_pipeop","text":"x () Object check.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/assert_pipeop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assertion for mlr3pipelines PipeOp — assert_pipeop","text":"PipeOp invisible(x)","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/chain_graphs.html","id":null,"dir":"Reference","previous_headings":"","what":"Chain a Series of Graphs — chain_graphs","title":"Chain a Series of Graphs — chain_graphs","text":"Takes arbitrary amount Graphs PipeOps (objects can automatically converted Graphs PipeOps, see as_graph() as_pipeop()) inputs joins serial Graph, connecting using %>>%. Care taken avoid unnecessarily cloning components. call chain_graphs(list(g1, g2, g3, g4, ...), in_place = FALSE) equivalent g1 %>>% g2 %>>!% g3 %>>!% g4 %>>!% .... call chain_graphs(list(g1, g2, g3, g4, ...), in_place = FALSE) equivalent g1 %>>!% g2 %>>!% g3 %>>!% g4 %>>!% ... (differing first operator %>>!% well).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/chain_graphs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Chain a Series of Graphs — chain_graphs","text":"","code":"chain_graphs(graphs, in_place = FALSE)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/chain_graphs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Chain a Series of Graphs — chain_graphs","text":"graphs list (Graph | PipeOp | NULL | ...) List elements Graphs joined. Elements must convertible Graph PipeOp using as_graph() as_pipeop(). NULL neutral element %>>% skipped. in_place (logical(1)) Whether try avoid cloning first element graphs, similar difference %>>!% %>>%. can avoided graphs[[1]] already Graph. Beware , chain_graphs() fails id collisions, graphs[[1]] possibly incompletely modified state in_place TRUE.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/chain_graphs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Chain a Series of Graphs — chain_graphs","text":"Graph resulting Graph, NULL non-null values graphs.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/filter_noop.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove NO_OPs from a List — filter_noop","title":"Remove NO_OPs from a List — filter_noop","text":"Remove NO_OP elements list.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/filter_noop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove NO_OPs from a List — filter_noop","text":"","code":"filter_noop(x)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/filter_noop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove NO_OPs from a List — filter_noop","text":"x list List filter.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/filter_noop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove NO_OPs from a List — filter_noop","text":"list: input list, NO_OP elements removed.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/grapes-greater-than-greater-than-grapes.html","id":null,"dir":"Reference","previous_headings":"","what":"PipeOp Composition Operator — %>>%","title":"PipeOp Composition Operator — %>>%","text":"operators creates connection \"pipes\" data source g1 sink g2. source sink can either Graph PipeOp (object can automatically converted Graph PipeOp, see as_graph() as_pipeop()). %>>% %>>!% try automatically match output channels g1 input channels g2; possible either number output channels g1 (given g1$output) equal number input channels g2 (given g2$input), g1 one output channel (.e. g1$output one line), g2 one input channel, vararg channel (.e. g2$input one line, name entry \"...\"). Connections channels created order occur g1 g2, respectively: g1's output channel 1 connected g2's input channel 1, channel 2 2 etc. %>>% always creates deep copies input arguments, modified reference afterwards. access individual PipeOps composition, use resulting Graph's $pipeops list. %>>!%, hand, tries avoid cloning first argument: Graph, Graph modified -place. %>>!% fails, leaves g1 incompletely modified state. therefore usually recommended use %>>%, since marginal gain performance using %>>!% often outweigh risk either modifying objects -reference modified getting graphs incompletely modified state. However, creating long Graphs, chaining %>>!% instead %>>% can give noticeable performance benefits %>>% makes number clone()-calls quadratic chain length, %>>!% linear. concat_graphs(g1, g2, in_place = FALSE) equivalent g1 %>>% g2. concat_graphs(g1, g2, in_place = TRUE) equivalent g1 %>>!% g2. arguments %>>% automatically converted Graphs using as_graph(); means objects either side may objects can automatically converted PipeOps (Learners Filters), can converted Graphs. means, particular, lists Graphs, PipeOps objects convertible , as_graph() automatically applies gunion() lists. See examples. first argument %>>!% Graph, cloned just %>>% used; %>>!% avoids clone() first argument Graph. Note g1 NULL, g2 converted Graph returned. Analogously, g2 NULL, g1 converted Graph returned.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/grapes-greater-than-greater-than-grapes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"PipeOp Composition Operator — %>>%","text":"","code":"g1 %>>% g2 concat_graphs(g1, g2, in_place = FALSE) g1 %>>!% g2"},{"path":"https://mlr3pipelines.mlr-org.com/reference/grapes-greater-than-greater-than-grapes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"PipeOp Composition Operator — %>>%","text":"g1 (Graph | PipeOp | Learner | Filter | list | ...) Graph / PipeOp / object-convertible--PipeOp put front g2. g2 (Graph | PipeOp | Learner | Filter | list | ...) Graph / PipeOp / object-convertible--PipeOp put g1. in_place (logical(1)) Whether try avoid cloning g1. g1 Graph, cloned regardless.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/grapes-greater-than-greater-than-grapes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"PipeOp Composition Operator — %>>%","text":"Graph: constructed Graph.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/grapes-greater-than-greater-than-grapes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"PipeOp Composition Operator — %>>%","text":"","code":"o1 = PipeOpScale$new() o2 = PipeOpPCA$new() o3 = PipeOpFeatureUnion$new(2) # The following two are equivalent: pipe1 = o1 %>>% o2 pipe2 = Graph$new()$ add_pipeop(o1)$ add_pipeop(o2)$ add_edge(o1$id, o2$id) # Note automatical gunion() of lists. # The following three are equivalent: graph1 = list(o1, o2) %>>% o3 graph2 = gunion(list(o1, o2)) %>>% o3 graph3 = Graph$new()$ add_pipeop(o1)$ add_pipeop(o2)$ add_pipeop(o3)$ add_edge(o1$id, o3$id, dst_channel = 1)$ add_edge(o2$id, o3$id, dst_channel = 2) pipe1 %>>!% o3 # modify pipe1 in-place #> Graph with 3 PipeOps: #> ID State sccssors prdcssors #> #> scale <> pca #> pca <> featureunion scale #> featureunion <> pca pipe1 # contains o1, o2, and o3 now. #> Graph with 3 PipeOps: #> ID State sccssors prdcssors #> #> scale <> pca #> pca <> featureunion scale #> featureunion <> pca o1 %>>!% o2 #> Graph with 2 PipeOps: #> ID State sccssors prdcssors #> #> scale <> pca #> pca <> scale o1 # not changed, becuase not a Graph. #> PipeOp: (not trained) #> values: #> Input channels : #> input [Task,Task] #> Output channels : #> output [Task,Task]"},{"path":"https://mlr3pipelines.mlr-org.com/reference/greplicate.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Disjoint Graph Union of Copies of a Graph — greplicate","title":"Create Disjoint Graph Union of Copies of a Graph — greplicate","text":"Create new Graph containing n copies input Graph / PipeOp. avoid ID collisions, PipeOp IDs suffixed _i ranges 1 n. function deprecated removed next version favor using pipeline_greplicate / ppl(\"greplicate\").","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/greplicate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Disjoint Graph Union of Copies of a Graph — greplicate","text":"","code":"greplicate(graph, n)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/greplicate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Disjoint Graph Union of Copies of a Graph — greplicate","text":"graph Graph Graph replicate. n integer(1) Number copies create.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/greplicate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Disjoint Graph Union of Copies of a Graph — greplicate","text":"Graph containing n copies input graph.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/gunion.html","id":null,"dir":"Reference","previous_headings":"","what":"Disjoint Union of Graphs — gunion","title":"Disjoint Union of Graphs — gunion","text":"Takes arbitrary amount Graphs PipeOps (objects can automatically converted Graphs PipeOps, see as_graph() as_pipeop()) inputs joins new Graph. PipeOps input Graphs joined new edges across Graphs, length(graphs) > 1, resulting Graph disconnected. operation always creates deep copies input arguments, modified reference afterwards. access individual PipeOps composition, use resulting Graph's $pipeops list.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/gunion.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Disjoint Union of Graphs — gunion","text":"","code":"gunion(graphs, in_place = FALSE)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/gunion.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Disjoint Union of Graphs — gunion","text":"graphs list (Graph | PipeOp | NULL | ...) List elements Graphs joined. Elements must convertible Graph PipeOp using as_graph() as_pipeop(). NULL values automatically get converted PipeOpNOP random ID format nop_********. list can named, case IDs elements prefixed names, separated dot (.). in_place (logical(1) | logical) Whether try avoid cloning first element graphs, similar difference %>>!% %>>%. can avoided graphs[[1]] already Graph. Unlike chain_graphs(), gunion() checks mutating graphs[[1]], leave graphs[[1]] incompletely modified state fails.in_place may also length graph, case determines element graphs whether cloned. internal usage recommended.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/gunion.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Disjoint Union of Graphs — gunion","text":"Graph resulting Graph.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/is.Multiplicity.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a Multiplicity — is.Multiplicity","title":"Check if an object is a Multiplicity — is.Multiplicity","text":"Check object Multiplicity.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/is.Multiplicity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a Multiplicity — is.Multiplicity","text":"","code":"is.Multiplicity(x)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/is.Multiplicity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a Multiplicity — is.Multiplicity","text":"x () Object check.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/is.Multiplicity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a Multiplicity — is.Multiplicity","text":"logical(1)","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/is_noop.html","id":null,"dir":"Reference","previous_headings":"","what":"Test for NO_OP — is_noop","title":"Test for NO_OP — is_noop","text":"Test whether given object NO_OP.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/is_noop.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Test for NO_OP — is_noop","text":"","code":"is_noop(x)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/is_noop.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Test for NO_OP — is_noop","text":"x Object test.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/is_noop.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Test for NO_OP — is_noop","text":"logical(1): Whether x NO_OP.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr3pipelines-package.html","id":null,"dir":"Reference","previous_headings":"","what":"mlr3pipelines: Preprocessing Operators and Pipelines for 'mlr3' — mlr3pipelines-package","title":"mlr3pipelines: Preprocessing Operators and Pipelines for 'mlr3' — mlr3pipelines-package","text":"Dataflow programming toolkit enriches 'mlr3' diverse set pipelining operators ('PipeOps') can composed graphs. Operations exist data preprocessing, model fitting, ensemble learning. Graphs can treated 'mlr3' 'Learners' can therefore resampled, benchmarked, tuned.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr3pipelines-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"mlr3pipelines: Preprocessing Operators and Pipelines for 'mlr3' — mlr3pipelines-package","text":"Maintainer: Martin Binder mlr.developer@mb706.com Authors: Florian Pfisterer pfistererf@googlemail.com (ORCID) Lennart Schneider lennart.sch@web.de (ORCID) Bernd Bischl bernd_bischl@gmx.net (ORCID) Michel Lang michellang@gmail.com (ORCID) Sebastian Fischer sebf.fischer@gmail.com (ORCID) Susanne Dandl dandl.susanne@googlemail.com contributors: Keno Mersmann keno.mersmann@gmail.com [contributor] Maximilian Mücke muecke.maximilian@gmail.com (ORCID) [contributor] Lona Koers lona.koers@gmail.com [contributor]","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs.html","id":null,"dir":"Reference","previous_headings":"","what":"Dictionary of (sub-)graphs — mlr_graphs","title":"Dictionary of (sub-)graphs — mlr_graphs","text":"simple Dictionary storing objects class Graph. dictionary contains collection often-used graph structures, aim solely make often-used functions accessible. Graph associated help page, can accessed via ?mlr_graphs_, .e. ?mlr_graphs_bagging.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Dictionary of (sub-)graphs — mlr_graphs","text":"R6Class object inheriting mlr3misc::Dictionary.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Dictionary of (sub-)graphs — mlr_graphs","text":"Methods inherited Dictionary, well : add(key, value) (character(1), function) Adds constructor value dictionary key key, potentially overwriting previously stored item.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs.html","id":"s-methods","dir":"Reference","previous_headings":"","what":"S3 methods","title":"Dictionary of (sub-)graphs — mlr_graphs","text":".data.table(dict)Dictionary -> data.table::data.table Returns data.table column key (character).","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dictionary of (sub-)graphs — mlr_graphs","text":"","code":"library(mlr3) lrn = lrn(\"regr.rpart\") task = mlr_tasks$get(\"boston_housing\") # Robustify the learner for the task. gr = pipeline_robustify(task, lrn) %>>% po(\"learner\", lrn) # or equivalently gr = mlr_graphs$get(\"robustify\", task = task, learner = lrn) %>>% po(lrn) # or equivalently gr = ppl(\"robustify\", task, lrn) %>>% po(\"learner\", lrn) # all Graphs currently in the dictionary: as.data.table(mlr_graphs) #> Key: #> key #> #> 1: bagging #> 2: branch #> 3: convert_types #> 4: greplicate #> 5: ovr #> 6: robustify #> 7: stacking #> 8: targettrafo"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_bagging.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a bagging learner — mlr_graphs_bagging","title":"Create a bagging learner — mlr_graphs_bagging","text":"Creates Graph performs bagging supplied graph. done follows: Subsample data step using PipeOpSubsample, afterwards apply graph Replicate step iterations times (parallel via multiplicities) Average outputs replicated graphs predictions using averager (note setting collect_multipliciy = TRUE required) input arguments cloned references common returned Graph.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_bagging.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a bagging learner — mlr_graphs_bagging","text":"","code":"pipeline_bagging( graph, iterations = 10, frac = 0.7, averager = NULL, replace = FALSE )"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_bagging.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a bagging learner — mlr_graphs_bagging","text":"graph PipeOp | Graph PipeOpLearner Graph create robustifying pipeline . Outputs replicated graphs connected averager. iterations integer(1) Number bagging iterations. Defaults 10. frac numeric(1) Percentage rows keep subsampling. See PipeOpSubsample information. Defaults 0.7. averager PipeOp | Graph PipeOp Graph averages predictions replicated subsampled graph's. simplest case, po(\"classifavg\") po(\"regravg\") can used order perform simple averaging classification regression predictions respectively. NULL (default), averager added end graph. Note setting collect_multipliciy = TRUE construction averager required. replace logical(1) Whether sample replacement. Default FALSE.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_bagging.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a bagging learner — mlr_graphs_bagging","text":"Graph","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_bagging.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a bagging learner — mlr_graphs_bagging","text":"","code":"# \\donttest{ library(mlr3) lrn_po = po(\"learner\", lrn(\"regr.rpart\")) task = mlr_tasks$get(\"boston_housing\") gr = pipeline_bagging(lrn_po, 3, averager = po(\"regravg\", collect_multiplicity = TRUE)) resample(task, GraphLearner$new(gr), rsmp(\"holdout\"))$aggregate() #> regr.mse #> 22.72214 # The original bagging method uses boosting by sampling with replacement. gr = ppl(\"bagging\", lrn_po, frac = 1, replace = TRUE, averager = po(\"regravg\", collect_multiplicity = TRUE)) resample(task, GraphLearner$new(gr), rsmp(\"holdout\"))$aggregate() #> regr.mse #> 23.23871 # }"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_branch.html","id":null,"dir":"Reference","previous_headings":"","what":"Branch Between Alternative Paths — mlr_graphs_branch","title":"Branch Between Alternative Paths — mlr_graphs_branch","text":"Create multiplexed graph. input arguments cloned references common returned Graph.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_branch.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Branch Between Alternative Paths — mlr_graphs_branch","text":"","code":"pipeline_branch(graphs, prefix_branchops = \"\", prefix_paths = FALSE)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_branch.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Branch Between Alternative Paths — mlr_graphs_branch","text":"graphs list Graph Multiple graphs, possibly named. must exactly one output. arguments named, must unique names. prefix_branchops character(1) Optional id prefix prepend PipeOpBranch PipeOpUnbranch id. resulting IDs \"[prefix_branchops]branch\" \"[prefix_branchops]unbranch\". Default \"\". prefix_paths logical(1) | character(1) Whether add prefixes graph IDs performing gunion. Can helpful avoid ID clashes resulting graph. Default FALSE. TRUE, prefixes taken names input arguments present \"poX\" X counts . character(1), prefix added PipeOp IDs additionally input argument list.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_branch.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Branch Between Alternative Paths — mlr_graphs_branch","text":"Graph","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_branch.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Branch Between Alternative Paths — mlr_graphs_branch","text":"","code":"library(\"mlr3\") po_pca = po(\"pca\") po_nop = po(\"nop\") branches = pipeline_branch(list(pca = po_pca, nothing = po_nop)) # gives the same as branches = c(\"pca\", \"nothing\") po(\"branch\", branches) %>>% gunion(list(po_pca, po_nop)) %>>% po(\"unbranch\", branches) #> Graph with 4 PipeOps: #> ID State sccssors prdcssors #> #> branch <> pca,nop #> pca <> unbranch branch #> nop <> unbranch branch #> unbranch <> pca,nop pipeline_branch(list(pca = po_pca, nothing = po_nop), prefix_branchops = \"br_\", prefix_paths = \"xy_\") #> Graph with 4 PipeOps: #> ID State sccssors prdcssors #> #> br_branch <> xy_pca.pca,xy_nothi... #> xy_pca.pca <> br_unbranch br_branch #> xy_nothing.nop <> br_unbranch br_branch #> br_unbranch <> xy_pca.pca,xy_nothi... # gives the same as po(\"branch\", branches, id = \"br_branch\") %>>% gunion(list(xy_pca = po_pca, xy_nothing = po_nop)) %>>% po(\"unbranch\", branches, id = \"br_unbranch\") #> Graph with 4 PipeOps: #> ID State sccssors prdcssors #> #> br_branch <> xy_pca.pca,xy_nothi... #> xy_pca.pca <> br_unbranch br_branch #> xy_nothing.nop <> br_unbranch br_branch #> br_unbranch <> xy_pca.pca,xy_nothi..."},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_convert_types.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Column Types — mlr_graphs_convert_types","title":"Convert Column Types — mlr_graphs_convert_types","text":"Converts columns type type_from type_to, using corresponding R function (e.g. .numeric(), .factor()). possible subset columns affected using affect_columns argument. resulting Graph contains PipeOpColApply, followed, appropriate, PipeOpFixFactors. Unlike R's .factor() function, ppl(\"convert_types\") convert ordered types (unordered) factor vectors.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_convert_types.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Column Types — mlr_graphs_convert_types","text":"","code":"pipeline_convert_types( type_from, type_to, affect_columns = NULL, id = NULL, fixfactors = NULL, more_args = list() )"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_convert_types.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Column Types — mlr_graphs_convert_types","text":"type_from character column types convert. May combination \"logical\", \"integer\", \"numeric\", \"factor\", \"ordered\", \"character\", \"POSIXct\". type_to character(1) type convert . Must scalar value, exactly one types allowed type_from. affect_columns function | Selector | NULL columns affect. argument can restrict columns converted, beyond type_from argument. Must Selector-like function, takes Task argument returns character features use. id character(1) | NULL ID give constructed PipeOps. Defaults ID built automatically type_from type_to. PipeOpFixFactors appended, ID paste0(id, \"_ff\"). fixfactors logical(1) | NULL Whether append PipeOpFixFactors. Defaults TRUE type_to \"factor\" \"ordered\". more_args list Additional arguments give conversion function. e.g. used pass timezone .POSIXct.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_convert_types.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Column Types — mlr_graphs_convert_types","text":"Graph","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_convert_types.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Column Types — mlr_graphs_convert_types","text":"","code":"library(\"mlr3\") data_chr = data.table::data.table( x = factor(letters[1:3]), y = letters[1:3], z = letters[1:3] ) task_chr = TaskClassif$new(\"task_chr\", data_chr, \"x\") str(task_chr$data()) #> Classes ‘data.table’ and 'data.frame':\t3 obs. of 3 variables: #> $ x: Factor w/ 3 levels \"a\",\"b\",\"c\": 1 2 3 #> $ y: chr \"a\" \"b\" \"c\" #> $ z: chr \"a\" \"b\" \"c\" #> - attr(*, \".internal.selfref\")= graph = ppl(\"convert_types\", \"character\", \"factor\") str(graph$train(task_chr)[[1]]$data()) #> Classes ‘data.table’ and 'data.frame':\t3 obs. of 3 variables: #> $ x: Factor w/ 3 levels \"a\",\"b\",\"c\": 1 2 3 #> $ y: Factor w/ 3 levels \"a\",\"b\",\"c\": 1 2 3 #> $ z: Factor w/ 3 levels \"a\",\"b\",\"c\": 1 2 3 #> - attr(*, \".internal.selfref\")= graph_z = ppl(\"convert_types\", \"character\", \"factor\", affect_columns = selector_name(\"z\")) graph_z$train(task_chr)[[1]]$data() #> x z y #> #> 1: a a a #> 2: b b b #> 3: c c c # `affect_columns` and `type_from` are both applied. The following # looks for a 'numeric' column with name 'z', which is not present; # the task is therefore unchanged. graph_z = ppl(\"convert_types\", \"numeric\", \"factor\", affect_columns = selector_name(\"z\")) graph_z$train(task_chr)[[1]]$data() #> x y z #> #> 1: a a a #> 2: b b b #> 3: c c c"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_greplicate.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Disjoint Graph Union of Copies of a Graph — mlr_graphs_greplicate","title":"Create Disjoint Graph Union of Copies of a Graph — mlr_graphs_greplicate","text":"Create new Graph containing n copies input Graph / PipeOp. avoid ID collisions, PipeOp IDs suffixed _i ranges 1 n. input arguments cloned references common returned Graph.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_greplicate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Disjoint Graph Union of Copies of a Graph — mlr_graphs_greplicate","text":"","code":"pipeline_greplicate(graph, n)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_greplicate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Disjoint Graph Union of Copies of a Graph — mlr_graphs_greplicate","text":"graph Graph Graph replicate. n integer(1) Number copies create.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_greplicate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Disjoint Graph Union of Copies of a Graph — mlr_graphs_greplicate","text":"Graph containing n copies input graph.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_greplicate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Disjoint Graph Union of Copies of a Graph — mlr_graphs_greplicate","text":"","code":"library(\"mlr3\") po_pca = po(\"pca\") pipeline_greplicate(po_pca, n = 2) #> Graph with 2 PipeOps: #> ID State sccssors prdcssors #> #> pca_1 <> #> pca_2 <>"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_ovr.html","id":null,"dir":"Reference","previous_headings":"","what":"Create A Graph to Perform ","title":"Create A Graph to Perform ","text":"Create new Graph classification Task perform \"One vs. Rest\" classification. input arguments cloned references common returned Graph.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_ovr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create A Graph to Perform ","text":"","code":"pipeline_ovr(graph)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_ovr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create A Graph to Perform ","text":"graph Graph Graph wrapped PipeOpOVRSplit PipeOpOVRUnite. Graph return NULL training classification Prediction prediction.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_ovr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create A Graph to Perform ","text":"Graph","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_ovr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create A Graph to Perform ","text":"","code":"library(\"mlr3\") task = tsk(\"wine\") learner = lrn(\"classif.rpart\") learner$predict_type = \"prob\" # Simple OVR g1 = pipeline_ovr(learner) g1$train(task) #> $ovrunite.output #> NULL #> g1$predict(task) #> $ovrunite.output #> for 178 observations: #> row_ids truth response prob.1 prob.2 prob.3 #> 1 1 1 0.93301153 0.04437722 0.02261125 #> 2 1 1 0.93301153 0.04437722 0.02261125 #> 3 1 1 0.93301153 0.04437722 0.02261125 #> --- --- --- --- --- --- #> 176 3 3 0.08896784 0.04157376 0.86945841 #> 177 3 3 0.08896784 0.04157376 0.86945841 #> 178 3 3 0.01729144 0.04484461 0.93786395 #> # Bagged Learners gr = po(\"replicate\", reps = 3) %>>% po(\"subsample\") %>>% learner %>>% po(\"classifavg\", collect_multiplicity = TRUE) g2 = pipeline_ovr(gr) g2$train(task) #> $ovrunite.output #> NULL #> g2$predict(task) #> $ovrunite.output #> for 178 observations: #> row_ids truth response prob.1 prob.2 prob.3 #> 1 1 1 0.94464381 0.05147707 0.003879117 #> 2 1 1 0.94464381 0.05147707 0.003879117 #> 3 1 1 0.94464381 0.05147707 0.003879117 #> --- --- --- --- --- --- #> 176 3 3 0.26352226 0.03891908 0.697558661 #> 177 3 3 0.26352226 0.03891908 0.697558661 #> 178 3 3 0.01850032 0.05186723 0.929632453 #> # Bagging outside OVR g3 = po(\"replicate\", reps = 3) %>>% pipeline_ovr(po(\"subsample\") %>>% learner) %>>% po(\"classifavg\", collect_multiplicity = TRUE) g3$train(task) #> $classifavg.output #> NULL #> g3$predict(task) #> $classifavg.output #> for 178 observations: #> row_ids truth response prob.1 prob.2 prob.3 #> 1 1 1 0.94463024 0.03159972 0.02377004 #> 2 1 1 0.94463024 0.03159972 0.02377004 #> 3 1 1 0.94463024 0.03159972 0.02377004 #> --- --- --- --- --- --- #> 176 3 3 0.03047528 0.03001841 0.93950630 #> 177 3 3 0.03047528 0.03001841 0.93950630 #> 178 3 3 0.03047528 0.03001841 0.93950630 #>"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_robustify.html","id":null,"dir":"Reference","previous_headings":"","what":"Robustify a learner — mlr_graphs_robustify","title":"Robustify a learner — mlr_graphs_robustify","text":"Creates Graph can used robustify subsequent learner. Performs following steps: Drops empty factor levels using PipeOpFixFactors Imputes numeric features using PipeOpImputeHist PipeOpMissInd Imputes factor features using PipeOpImputeOOR Encodes factors using one-hot-encoding. Factors cardinality > max_cardinality collapsed using PipeOpCollapseFactors graph built conservatively, .e. function always tries assure everything works. learner provided, steps can left , .e. learner can deal factor variables, encoding performed. input arguments cloned references common returned Graph.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_robustify.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Robustify a learner — mlr_graphs_robustify","text":"","code":"pipeline_robustify( task = NULL, learner = NULL, impute_missings = NULL, factors_to_numeric = NULL, max_cardinality = 1000, ordered_action = \"factor\", character_action = \"factor\", POSIXct_action = \"numeric\" )"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_robustify.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Robustify a learner — mlr_graphs_robustify","text":"task Task Task create robustifying pipeline . Optional, omitted, \"worst possible\" Task assumed full pipeline created. learner Learner learner create robustifying pipeline . Optional, omitted, \"worst possible\" Learner assumed conservative pipeline built. impute_missings logical(1) | NULL missing values imputed? Defaults NULL: imputes task missing values (factors encoded numerics) learner can handle . factors_to_numeric logical(1) | NULL (ordered unordered) factors encoded? Defaults NULL: encodes task factors (character columns get converted factor) learner can handle factors. max_cardinality integer(1) Maximum number factor levels allowed. See . Default: 1000. ordered_action character(1) handle ordered columns: \"factor\" (default) \"factor!\": convert factor columns; \"numeric\" \"numeric!\": convert numeric columns; \"integer\" \"integer!\": convert integer columns; \"ignore\" \"ignore!\": ignore. task given ordered columns, learner given can handle ordered, \"factor\", \"numeric\" \"integer\" treated like \"ignore\". means necessary add exclamation point override Task Learner properties given. \"ignore\" \"ignore!\" therefore behave completely identically, \"ignore!\" present consistency. ordered features converted factor, treated like factor features pipeline, possibly eventually converted numerics, different way: factors get one-hot encoded, ordered_action = \"numeric\" converts ordered using .numeric integer-valued rank. character_action character(1) handle character columns: \"factor\" (default) \"factor!\": convert factor columns; \"matrix\" \"matrix!\": Use PipeOpTextVectorizer. \"ignore\" \"ignore!\": ignore. task given character columns, learner given can handle character, \"factor\" \"matrix\" treated like \"ignore\". means necessary add exclamation point override Task Learner properties given. \"ignore\" \"ignore!\" therefore behave completely identically, \"ignore!\" present consistency. character columns converted factor, treated like factor pipeline, possibly eventually converted numerics, using one-hot encoding. POSIXct_action character(1) handle POSIXct columns: \"numeric\" (default) \"numeric!\": convert numeric columns; \"datefeatures\" \"datefeatures!\": Use PipeOpDateFeatures. \"ignore\" \"ignore!\": ignore. task given POSIXct columns, learner given can handle POSIXct, \"numeric\" \"datefeatures\" treated like \"ignore\". means necessary add exclamation point override Task Learner properties given. \"ignore\" \"ignore!\" therefore behave completely identically, \"ignore!\" present consistency.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_robustify.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Robustify a learner — mlr_graphs_robustify","text":"Graph","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_robustify.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Robustify a learner — mlr_graphs_robustify","text":"","code":"# \\donttest{ library(mlr3) lrn = lrn(\"regr.rpart\") task = mlr_tasks$get(\"boston_housing\") gr = pipeline_robustify(task, lrn) %>>% po(\"learner\", lrn) resample(task, GraphLearner$new(gr), rsmp(\"holdout\")) #> with 1 resampling iterations #> task_id #> boston_housing #> learner_id #> removeconstants_prerobustify.fixfactors.removeconstants_postrobustify.regr.rpart #> resampling_id iteration prediction_test warnings errors #> holdout 1 0 0 # }"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_stacking.html","id":null,"dir":"Reference","previous_headings":"","what":"Create A Graph to Perform Stacking. — mlr_graphs_stacking","title":"Create A Graph to Perform Stacking. — mlr_graphs_stacking","text":"Create new Graph stacking. stacked learner uses predictions several base learners fits super learner using predictions features order predict outcome. input arguments cloned references common returned Graph.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_stacking.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create A Graph to Perform Stacking. — mlr_graphs_stacking","text":"","code":"pipeline_stacking( base_learners, super_learner, method = \"cv\", folds = 3, use_features = TRUE )"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_stacking.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create A Graph to Perform Stacking. — mlr_graphs_stacking","text":"base_learners list Learner list base learners. super_learner Learner super learner makes final prediction based base learners. method character(1)\"cv\" (default) building super learner using cross-validated predictions base learners \"insample\" building super learner using predictions base learners trained training data. folds integer(1) Number cross-validation folds. used method = \"cv\". Default 3. use_features logical(1) Whether original features also passed super learner. Default TRUE.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_stacking.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create A Graph to Perform Stacking. — mlr_graphs_stacking","text":"Graph","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_stacking.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create A Graph to Perform Stacking. — mlr_graphs_stacking","text":"","code":"library(mlr3) library(mlr3learners) base_learners = list( lrn(\"classif.rpart\", predict_type = \"prob\"), lrn(\"classif.kknn\", predict_type = \"prob\") ) super_learner = lrn(\"classif.log_reg\") graph_stack = pipeline_stacking(base_learners, super_learner) graph_learner = as_learner(graph_stack) graph_learner$train(tsk(\"german_credit\"))"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_targettrafo.html","id":null,"dir":"Reference","previous_headings":"","what":"Transform and Re-Transform the Target Variable — mlr_graphs_targettrafo","title":"Transform and Re-Transform the Target Variable — mlr_graphs_targettrafo","text":"Wraps Graph transforms target training inverts transformation prediction. done follows: Specify transformation inversion function using subclass PipeOpTargetTrafo, defaults PipeOpTargetMutate, afterwards apply graph. end, prediction transformation inverted using PipeOpTargetInvert. set transformation inversion function PipeOpTargetMutate see parameters trafo inverter param_set resulting Graph. Note input graph explicitly checked actually return Prediction prediction. input arguments cloned references common returned Graph.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_targettrafo.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Transform and Re-Transform the Target Variable — mlr_graphs_targettrafo","text":"","code":"pipeline_targettrafo( graph, trafo_pipeop = PipeOpTargetMutate$new(), id_prefix = \"\" )"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_targettrafo.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Transform and Re-Transform the Target Variable — mlr_graphs_targettrafo","text":"graph PipeOpLearner | Graph PipeOpLearner Graph wrap transformation re-transformation target variable. trafo_pipeop PipeOp PipeOp subclass PipeOpTargetTrafo. Default PipeOpTargetMutate. id_prefix character(1) Optional id prefix prepend PipeOpTargetInvert ID. resulting ID \"[id_prefix]targetinvert\". Default \"\".","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_targettrafo.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Transform and Re-Transform the Target Variable — mlr_graphs_targettrafo","text":"Graph","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_graphs_targettrafo.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Transform and Re-Transform the Target Variable — mlr_graphs_targettrafo","text":"","code":"library(\"mlr3\") tt = pipeline_targettrafo(PipeOpLearner$new(LearnerRegrRpart$new())) tt$param_set$values$targetmutate.trafo = function(x) log(x, base = 2) tt$param_set$values$targetmutate.inverter = function(x) list(response = 2 ^ x$response) # gives the same as g = Graph$new() g$add_pipeop(PipeOpTargetMutate$new(param_vals = list( trafo = function(x) log(x, base = 2), inverter = function(x) list(response = 2 ^ x$response)) ) ) g$add_pipeop(LearnerRegrRpart$new()) g$add_pipeop(PipeOpTargetInvert$new()) g$add_edge(src_id = \"targetmutate\", dst_id = \"targetinvert\", src_channel = 1, dst_channel = 1) g$add_edge(src_id = \"targetmutate\", dst_id = \"regr.rpart\", src_channel = 2, dst_channel = 1) g$add_edge(src_id = \"regr.rpart\", dst_id = \"targetinvert\", src_channel = 1, dst_channel = 2)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_avg.html","id":null,"dir":"Reference","previous_headings":"","what":"Optimized Weighted Average of Features for Classification and Regression — mlr_learners_avg","title":"Optimized Weighted Average of Features for Classification and Regression — mlr_learners_avg","text":"Computes weighted average inputs. Used context computing weighted averages predictions. Predictions averaged using weights (order appearance data) optimized using nonlinear optimization package nloptr measure provided measure. (defaults classif.ce LearnerClassifAvg regr.mse LearnerRegrAvg). Learned weights can obtained $model. Learner implements generalizes approach proposed LeDell (2015) uses non-linear optimization order learn base-learner weights optimize given performance metric (e.g AUC). approach similar exactly one implemented AUC SuperLearner R package (metric \"classif.auc\"). detailed analysis general idea, reader referred LeDell (2015). Note, weights always sum 1 division sum(weights) weighting incoming features.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_avg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Optimized Weighted Average of Features for Classification and Regression — mlr_learners_avg","text":"","code":"mlr_learners_classif.avg mlr_learners_regr.avg"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_avg.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Optimized Weighted Average of Features for Classification and Regression — mlr_learners_avg","text":"R6Class object inheriting mlr3::LearnerClassif/mlr3::Learner.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_avg.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Optimized Weighted Average of Features for Classification and Regression — mlr_learners_avg","text":"parameters parameters inherited LearnerClassif, well : measure :: Measure | character Measure optimize . converted Measure case character. Initialized \"classif.ce\", .e. misclassification error classification \"regr.mse\", .e. mean squared error regression. optimizer :: Optimizer | character(1)Optimizer used find optimal thresholds. character, converts Optimizer via opt. Initialized OptimizerNLoptr. Nloptr hyperparameters initialized xtol_rel = 1e-8, algorithm = \"NLOPT_LN_COBYLA\" equal initial weights learner. fine-grained control, recommended supply instantiated Optimizer. log_level :: character(1) | integer(1) Set temporary log-level lgr::get_logger(\"bbotk\"). Initialized : \"warn\".","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_avg.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Optimized Weighted Average of Features for Classification and Regression — mlr_learners_avg","text":"LearnerClassifAvg$new(), id = \"classif.avg\") (chr) -> self Constructor. LearnerRegrAvg$new(), id = \"regr.avg\") (chr) -> self Constructor.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_avg.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Optimized Weighted Average of Features for Classification and Regression — mlr_learners_avg","text":"LeDell, Erin (2015). Scalable Ensemble Learning Computationally Efficient Variance Estimation. Ph.D. thesis, UC Berkeley.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Encapsulate a Graph as a Learner — mlr_learners_graph","title":"Encapsulate a Graph as a Learner — mlr_learners_graph","text":"Learner encapsulates Graph used mlr3 resampling benchmarks. Graph must return single Prediction $predict() call. result $train() call discarded, internal state changes training used. predict_type GraphLearner can obtained set via predict_type active binding. Setting new predict type try set predict_type relevant PipeOp / Learner encapsulated within Graph. Similarly, predict_type Graph always smallest denominator Graph. GraphLearner always constructed untrained state. graph argument non-NULL $state, ignored.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_graph.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Encapsulate a Graph as a Learner — mlr_learners_graph","text":"R6Class object inheriting mlr3::Learner.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_graph.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Encapsulate a Graph as a Learner — mlr_learners_graph","text":"graph :: Graph | PipeOpGraph wrap. Can PipeOp, automatically converted Graph. argument usually cloned, unless clone_graph FALSE; access Graph inside GraphLearner -reference, use $graph. id :: character(1) Identifier resulting Learner. param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings . Default list(). task_type :: character(1) task_type GraphLearner ; usually automatically inferred Graphs simple enough. predict_type :: character(1) predict_type GraphLearner ; usually automatically inferred Graphs simple enough. clone_graph :: logical(1) Whether clone graph upon construction. Unintentionally changing graph reference can lead unexpected behaviour, TRUE (default) recommended. particular, note $state $graph set NULL reference construction GraphLearner, $train(), $predict() clone_graph FALSE.","code":"GraphLearner$new(graph, id = NULL, param_vals = list(), task_type = NULL, predict_type = NULL)"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_graph.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Encapsulate a Graph as a Learner — mlr_learners_graph","text":"Fields inherited Learner, well : graph :: GraphGraph wrapped. field contains prototype Graph trained, contain model. Use graph_model access trained Graph $train(). Read-. graph_model :: LearnerGraph wrapped. Graph contains trained state $train(). Read-. pipeops :: named list PipeOp Contains PipeOps underlying Graph, named PipeOp's $ids. Shortcut $graph_model$pipeops. See Graph details. edges :: data.table columns src_id (character), src_channel (character), dst_id (character), dst_channel (character) Table connections PipeOps underlying Graph. Shortcut $graph$edges. See Graph details. param_set :: ParamSet Parameters underlying Graph. Shortcut $graph$param_set. See Graph details. pipeops_param_set :: named list() Named list containing ParamSets PipeOps Graph. See details. pipeops_param_set_values :: named list() Named list containing set parameter values PipeOps Graph. See details. internal_tuned_values :: named list() NULL internal tuned parameter values collected PipeOps. NULL returned learner trained none wrapped learners supports internal tuning. internal_valid_scores :: named list() NULL internal validation scores retrieved PipeOps. names prefixed respective IDs PipeOps. NULL returned learner trained none wrapped learners supports internal validation. validate :: numeric(1), \"predefined\", \"test\" NULL construct validation data. also configured individual PipeOps PipeOpLearner, see set_validate.GraphLearner. details possible values, see mlr3::Learner. marshaled :: logical(1) Whether learner marshaled. impute_selected_features :: logical(1) Whether heuristically determine $selected_features() $selected_features() \"base learner\" Learners, even \"selected_features\" property / implement $selected_features(). impute_selected_features TRUE base learners implement $selected_features(), GraphLearner's $selected_features() method return features seen base learners. useful cases feature selection performed inside Graph: $selected_features() set features selected Graph. impute_selected_features FALSE, $selected_features() method throw error $selected_features() implemented base learners. heuristic may report features actually used base learners, cases base learners implement $selected_features(). default FALSE.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_graph.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Encapsulate a Graph as a Learner — mlr_learners_graph","text":"Methods inherited Learner, well : ids(sorted = FALSE) (logical(1)) -> character Get IDs PipeOps. order PipeOps added sorted FALSE, topologically sorted sorted TRUE. plot(html = FALSE, horizontal = FALSE) (logical(1), logical(1)) -> NULL Plot Graph, using either igraph package (html = FALSE, default) visNetwork package html = TRUE producing htmlWidget. htmlWidget can rescaled using visOptions. html = FALSE, orientation plotted graph can controlled horizontal. marshal () -> self Marshal model. unmarshal () -> self Unmarshal model. base_learner(recursive = Inf, return_po = FALSE, return_all = FALSE, resolve_branching = TRUE) (numeric(1), logical(1), logical(1), character(1)) -> Learner | PipeOp | list Learner | list PipeOp Return base learner GraphLearner. recursive 0, GraphLearner returned. Otherwise, Graph traversed backwards find first PipeOp containing $learner_model field. recursive 1, $learner_model (containing PipeOp, return_po TRUE) returned. recursive greater 1, discovered base learner's base_learner() method called recursive - 1. recursive must set 1 return_po TRUE, must set 1 return_all TRUE. return_po TRUE, container-PipeOp returned instead Learner. typically PipeOpLearner PipeOpLearnerCV. return_all TRUE, list Learners PipeOps returned. return_po FALSE, list may contain Multiplicity objects, unwrapped. return_all FALSE multiple possible base learners, error thrown. may also happen single PipeOpLearner present trained Multiplicity. resolve_branching TRUE, PipeOpUnbranch encountered, corresponding PipeOpBranch searched, hyperparameter configuration used select base learner. may multiple corresponding PipeOpBranchs, considered. resolve_branching FALSE, PipeOpUnbranch treated PipeOp multiple inputs; possible branch paths considered equally. following standard extractors defined Learner class available. Note typically extract information $base_learner(). works well simple Graphs modify features much, may give unexpected results Graphs add new features move information features. example, consider feature missing values, feature B used imputation, using po(\"imputelearner\"). case following Learner performs embedded feature selection selects feature , selected_features() method return feature , $importance() may even report 0 feature B. entirely accurate considering entire GraphLearner, feature B used imputation therefore impact predictions. following therefore used Graph known impact relevant properties. importance() () -> numeric $importance() returned base learner, \"importance property. Throws error otherwise. selected_features() () -> character $selected_features() returned base learner, \"selected_features property. base learner \"selected_features\" property impute_selected_features TRUE, features seen base learners returned. Throws error otherwise. oob_error() () -> numeric(1) $oob_error() returned base learner, \"oob_error property. Throws error otherwise. loglik() () -> numeric(1) $loglik() returned base learner, \"loglik property. Throws error otherwise.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_graph.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Encapsulate a Graph as a Learner — mlr_learners_graph","text":"as_graph() called graph argument, can technically also list things, automatically converted Graph via gunion(); however, usually result valid Graph can work Learner. graph can furthermore Learner, automatically wrapped Graph, wrapped GraphLearner object; usually adds overhead recommended.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_learners_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Encapsulate a Graph as a Learner — mlr_learners_graph","text":"","code":"library(\"mlr3\") graph = po(\"pca\") %>>% lrn(\"classif.rpart\") lr = GraphLearner$new(graph) lr = as_learner(graph) # equivalent lr$train(tsk(\"iris\")) lr$graph$state # untrained version! #> $pca #> NULL #> #> $classif.rpart #> NULL #> # The following is therefore NULL: lr$graph$pipeops$classif.rpart$learner_model$model #> NULL # To access the trained model from the PipeOpLearner's Learner, use: lr$graph_model$pipeops$classif.rpart$learner_model$model #> n= 150 #> #> node), split, n, loss, yval, (yprob) #> * denotes terminal node #> #> 1) root 150 100 setosa (0.33333333 0.33333333 0.33333333) #> 2) PC1< -1.553145 50 0 setosa (1.00000000 0.00000000 0.00000000) * #> 3) PC1>=-1.553145 100 50 versicolor (0.00000000 0.50000000 0.50000000) #> 6) PC1< 1.142805 44 1 versicolor (0.00000000 0.97727273 0.02272727) * #> 7) PC1>=1.142805 56 7 virginica (0.00000000 0.12500000 0.87500000) * # Feature importance (of principal components): lr$graph_model$pipeops$classif.rpart$learner_model$importance() #> PC1 PC2 PC3 PC4 #> 85.795455 18.016529 5.694731 3.254132"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops.html","id":null,"dir":"Reference","previous_headings":"","what":"Dictionary of PipeOps — mlr_pipeops","title":"Dictionary of PipeOps — mlr_pipeops","text":"simple Dictionary storing objects class PipeOp. PipeOp associated help page, see mlr_pipeops_[id].","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Dictionary of PipeOps — mlr_pipeops","text":"R6Class object inheriting mlr3misc::Dictionary.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Dictionary of PipeOps — mlr_pipeops","text":"Fields inherited Dictionary, well : metainf :: environment Environment stores metainf argument $add() method. internal use.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Dictionary of PipeOps — mlr_pipeops","text":"Methods inherited Dictionary, well : add(key, value, metainf = NULL) (character(1), R6ClassGenerator, NULL | list) Adds constructor value dictionary key key, potentially overwriting previously stored item. metainf NULL (default), must list arguments given value constructor (.e. value$new()) needs constructed .data.table PipeOp listing.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops.html","id":"s-methods","dir":"Reference","previous_headings":"","what":"S3 methods","title":"Dictionary of PipeOps — mlr_pipeops","text":".data.table(dict)Dictionary -> data.table::data.table Returns data.table columns key (character), packages (character), input.num (integer), output.num (integer), input.type.train (character), input.type.predict (character), output.type.train (character), output.type.predict (character).","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Dictionary of PipeOps — mlr_pipeops","text":"","code":"library(\"mlr3\") mlr_pipeops$get(\"learner\", lrn(\"classif.rpart\")) #> PipeOp: (not trained) #> values: #> Input channels : #> input [TaskClassif,TaskClassif] #> Output channels : #> output [NULL,PredictionClassif] # equivalent: po(\"learner\", learner = lrn(\"classif.rpart\")) #> PipeOp: (not trained) #> values: #> Input channels : #> input [TaskClassif,TaskClassif] #> Output channels : #> output [NULL,PredictionClassif] # all PipeOps currently in the dictionary: as.data.table(mlr_pipeops)[, c(\"key\", \"input.num\", \"output.num\", \"packages\")] #> Key: #> key input.num output.num packages #> #> 1: adas 1 1 mlr3pipelines,smotefamily #> 2: blsmote 1 1 mlr3pipelines,smotefamily #> 3: boxcox 1 1 mlr3pipelines,bestNormalize #> 4: branch 1 NA mlr3pipelines #> 5: chunk 1 NA mlr3pipelines #> 6: classbalancing 1 1 mlr3pipelines #> 7: classifavg NA 1 mlr3pipelines,stats #> 8: classweights 1 1 mlr3pipelines #> 9: colapply 1 1 mlr3pipelines #> 10: collapsefactors 1 1 mlr3pipelines #> 11: colroles 1 1 mlr3pipelines #> 12: copy 1 NA mlr3pipelines #> 13: datefeatures 1 1 mlr3pipelines #> 14: decode 1 1 mlr3pipelines #> 15: encode 1 1 mlr3pipelines,stats #> 16: encodeimpact 1 1 mlr3pipelines #> 17: encodelmer 1 1 mlr3pipelines,lme4,nloptr #> 18: featureunion NA 1 mlr3pipelines #> 19: filter 1 1 mlr3pipelines #> 20: fixfactors 1 1 mlr3pipelines #> 21: histbin 1 1 mlr3pipelines,graphics #> 22: ica 1 1 mlr3pipelines,fastICA #> 23: imputeconstant 1 1 mlr3pipelines #> 24: imputehist 1 1 mlr3pipelines,graphics #> 25: imputelearner 1 1 mlr3pipelines #> 26: imputemean 1 1 mlr3pipelines #> 27: imputemedian 1 1 mlr3pipelines,stats #> 28: imputemode 1 1 mlr3pipelines #> 29: imputeoor 1 1 mlr3pipelines #> 30: imputesample 1 1 mlr3pipelines #> 31: kernelpca 1 1 mlr3pipelines,kernlab #> 32: learner 1 1 mlr3pipelines #> 33: learner_cv 1 1 mlr3pipelines #> 34: learner_pi_cvplus 1 1 mlr3pipelines #> 35: learner_quantiles 1 1 mlr3pipelines #> 36: missind 1 1 mlr3pipelines #> 37: modelmatrix 1 1 mlr3pipelines,stats #> 38: multiplicityexply 1 NA mlr3pipelines #> 39: multiplicityimply NA 1 mlr3pipelines #> 40: mutate 1 1 mlr3pipelines #> 41: nearmiss 1 1 mlr3pipelines,themis #> 42: nmf 1 1 mlr3pipelines,MASS,NMF #> 43: nop 1 1 mlr3pipelines #> 44: ovrsplit 1 1 mlr3pipelines #> 45: ovrunite 1 1 mlr3pipelines #> 46: pca 1 1 mlr3pipelines #> 47: proxy NA 1 mlr3pipelines #> 48: quantilebin 1 1 mlr3pipelines,stats #> 49: randomprojection 1 1 mlr3pipelines #> 50: randomresponse 1 1 mlr3pipelines #> 51: regravg NA 1 mlr3pipelines #> 52: removeconstants 1 1 mlr3pipelines #> 53: renamecolumns 1 1 mlr3pipelines #> 54: replicate 1 1 mlr3pipelines #> 55: rowapply 1 1 mlr3pipelines #> 56: scale 1 1 mlr3pipelines #> 57: scalemaxabs 1 1 mlr3pipelines #> 58: scalerange 1 1 mlr3pipelines #> 59: select 1 1 mlr3pipelines #> 60: smote 1 1 mlr3pipelines,smotefamily #> 61: smotenc 1 1 mlr3pipelines,themis #> 62: spatialsign 1 1 mlr3pipelines #> 63: subsample 1 1 mlr3pipelines #> 64: targetinvert 2 1 mlr3pipelines #> 65: targetmutate 1 2 mlr3pipelines #> 66: targettrafoscalerange 1 2 mlr3pipelines #> 67: textvectorizer 1 1 mlr3pipelines,quanteda,stopwords #> 68: threshold 1 1 mlr3pipelines #> 69: tomek 1 1 mlr3pipelines,themis #> 70: tunethreshold 1 1 mlr3pipelines,bbotk #> 71: unbranch NA 1 mlr3pipelines #> 72: vtreat 1 1 mlr3pipelines,vtreat #> 73: yeojohnson 1 1 mlr3pipelines,bestNormalize #> key input.num output.num packages"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":null,"dir":"Reference","previous_headings":"","what":"ADAS Balancing — mlr_pipeops_adas","title":"ADAS Balancing — mlr_pipeops_adas","text":"Generates balanced data set creating synthetic instances minority class using ADASYN algorithm. algorithm generates minority instance new data points based K nearest neighbors difficulty learning data point. can applied tasks numeric features missing values. See smotefamily::ADAS details.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"ADAS Balancing — mlr_pipeops_adas","text":"R6Class object inheriting PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"ADAS Balancing — mlr_pipeops_adas","text":"id :: character(1) Identifier resulting object, default \"smote\". param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list().","code":"PipeOpADAS$new(id = \"adas\", param_vals = list())"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"ADAS Balancing — mlr_pipeops_adas","text":"Input output channels inherited PipeOpTaskPreproc. output training input Task added synthetic rows minority class. output prediction unchanged input.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"ADAS Balancing — mlr_pipeops_adas","text":"$state named list $state elements inherited PipeOpTaskPreproc.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"ADAS Balancing — mlr_pipeops_adas","text":"parameters parameters inherited PipeOpTaskPreproc, well : K :: numeric(1) number nearest neighbors used sampling new values. Default 5. See ADAS().","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"ADAS Balancing — mlr_pipeops_adas","text":"fields inherited PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"ADAS Balancing — mlr_pipeops_adas","text":"methods inherited PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"ADAS Balancing — mlr_pipeops_adas","text":"H, Bai Y, Garcia, . E, Li S (2008). “ADASYN: Adaptive synthetic sampling approach imbalanced learning.” 2008 IEEE International Joint Conference Neural Networks (IEEE World Congress Computational Intelligence), 1322-1328. doi:10.1109/IJCNN.2008.4633969 .","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_adas.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ADAS Balancing — mlr_pipeops_adas","text":"","code":"library(\"mlr3\") # Create example task data = data.frame( target = factor(sample(c(\"c1\", \"c2\"), size = 300, replace = TRUE, prob = c(0.1, 0.9))), x1 = rnorm(300), x2 = rnorm(300) ) task = TaskClassif$new(id = \"example\", backend = data, target = \"target\") task$head() #> target x1 x2 #> #> 1: c2 -0.0834583 0.05489672 #> 2: c2 -0.7970822 -0.86258739 #> 3: c2 1.1015246 0.93077549 #> 4: c2 0.1084104 0.57117040 #> 5: c1 -1.1905068 1.23483193 #> 6: c2 0.2799213 0.46200313 table(task$data(cols = \"target\")) #> target #> c1 c2 #> 26 274 # Generate synthetic data for minority class pop = po(\"adas\") adas_result = pop$train(list(task))[[1]]$data() nrow(adas_result) #> [1] 552 table(adas_result$target) #> #> c1 c2 #> 278 274"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":null,"dir":"Reference","previous_headings":"","what":"BLSMOTE Balancing — mlr_pipeops_blsmote","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"Adds new data points generating synthetic instances minority class using Borderline-SMOTE algorithm. can applied classification tasks numeric features missing values. See smotefamily::BLSMOTE details.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"R6Class object inheriting PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"id :: character(1) Identifier resulting object, default \"smote\". param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list().","code":"PipeOpBLSmote$new(id = \"blsmote\", param_vals = list())"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"Input output channels inherited PipeOpTaskPreproc. output training input Task added synthetic rows minority class. output prediction unchanged input.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"$state named list $state elements inherited PipeOpTaskPreproc.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"parameters parameters inherited PipeOpTaskPreproc, well : K :: numeric(1) number nearest neighbors used sampling minority class. Default 5. See BLSMOTE(). C :: numeric(1) number nearest neighbors used classifying sample points SAFE/DANGER/NOISE. Default 5. See BLSMOTE(). dup_size :: numeric Desired times synthetic minority instances original number majority instances. 0 leads balancing minority majority class. Default 0. See BLSMOTE(). method :: character(1) type Borderline-SMOTE algorithm use. Default \"type1\". See BLSMOTE(). quiet :: logical(1) Whether suppress printing status training. Initialized TRUE.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"fields inherited PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"methods inherited PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"Han, Hui, Wang, Wen-Yuan, Mao, Bing-Huan (2005). “Borderline-SMOTE: New -Sampling Method Imbalanced Data Sets Learning.” Huang, De-Shuang, Zhang, Xiao-Ping, Huang, Guang-Bin (eds.), Advances Intelligent Computing, 878–887. ISBN 978-3-540-31902-3, doi:10.1007/11538059_91 .","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_blsmote.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"BLSMOTE Balancing — mlr_pipeops_blsmote","text":"","code":"library(\"mlr3\") # Create example task data = smotefamily::sample_generator(500, 0.8) data$result = factor(data$result) task = TaskClassif$new(id = \"example\", backend = data, target = \"result\") task$head() #> result X1 X2 #> #> 1: n 0.9844391 0.1597977 #> 2: n 0.2391228 0.3475170 #> 3: n 0.5945652 0.2016805 #> 4: p 0.6814483 0.9776465 #> 5: p 0.5109275 0.4190668 #> 6: n 0.3266779 0.6078258 table(task$data(cols = \"result\")) #> result #> n p #> 391 109 # Generate synthetic data for minority class pop = po(\"blsmote\") bls_result = pop$train(list(task))[[1]]$data() nrow(bls_result) #> [1] 773 table(bls_result$result) #> #> n p #> 391 382"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_boxcox.html","id":null,"dir":"Reference","previous_headings":"","what":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","title":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","text":"Conducts Box-Cox transformation numeric features. lambda parameter transformation estimated training used training prediction transformation. See bestNormalize::boxcox() details.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_boxcox.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","text":"R6Class object inheriting PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_boxcox.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","text":"id :: character(1) Identifier resulting object, default \"boxcox\". param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list().","code":"PipeOpBoxCox$new(id = \"boxcox\", param_vals = list())"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_boxcox.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","text":"Input output channels inherited PipeOpTaskPreproc. output input Task affected numeric features replaced transformed versions.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_boxcox.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","text":"$state named list $state elements inherited PipeOpTaskPreproc, well list class boxcox column, transformed.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_boxcox.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","text":"parameters parameters inherited PipeOpTaskPreproc, well : standardize :: logical(1) Whether center scale transformed values attempt standard normal distribution. details see boxcox(). eps :: numeric(1) Tolerance parameter identify lambda parameter equal zero. details see boxcox(). lower :: numeric(1) Lower value estimation lambda parameter. details see boxcox(). upper :: numeric(1) Upper value estimation lambda parameter. details see boxcox().","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_boxcox.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","text":"Uses bestNormalize::boxcox function.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_boxcox.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","text":"methods inherited PipeOpTaskPreproc/PipeOp.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_boxcox.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Box-Cox Transformation of Numeric Features — mlr_pipeops_boxcox","text":"","code":"library(\"mlr3\") task = tsk(\"iris\") pop = po(\"boxcox\") task$data() #> Species Petal.Length Petal.Width Sepal.Length Sepal.Width #> #> 1: setosa 1.4 0.2 5.1 3.5 #> 2: setosa 1.4 0.2 4.9 3.0 #> 3: setosa 1.3 0.2 4.7 3.2 #> 4: setosa 1.5 0.2 4.6 3.1 #> 5: setosa 1.4 0.2 5.0 3.6 #> --- #> 146: virginica 5.2 2.3 6.7 3.0 #> 147: virginica 5.0 1.9 6.3 2.5 #> 148: virginica 5.2 2.0 6.5 3.0 #> 149: virginica 5.4 2.3 6.2 3.4 #> 150: virginica 5.1 1.8 5.9 3.0 pop$train(list(task))[[1]]$data() #> Species Petal.Length Petal.Width Sepal.Length Sepal.Width #> #> 1: setosa -1.3431567 -1.3850773 -0.8917547 1.01831791 #> 2: setosa -1.3431567 -1.3850773 -1.1812229 -0.08167295 #> 3: setosa -1.4033413 -1.3850773 -1.4845435 0.37307046 #> 4: setosa -1.2832670 -1.3850773 -1.6417967 0.14833599 #> 5: setosa -1.3431567 -1.3850773 -1.0348319 1.22454068 #> --- #> 146: virginica 0.8174171 1.2930924 1.0385560 -0.08167295 #> 147: virginica 0.7075555 0.9020852 0.6097200 -1.32264877 #> 148: virginica 0.8174171 1.0023867 0.8279148 -0.08167295 #> 149: virginica 0.9269887 1.2930924 0.4976284 0.80781419 #> 150: virginica 0.7625234 0.7998822 0.1485189 -0.08167295 pop$state #> $bc #> $bc$Petal.Length #> Standardized Box Cox Transformation with 150 nonmissing obs.: #> Estimated statistics: #> - lambda = 0.931286 #> - mean (before standardization) = 2.58137 #> - sd (before standardization) = 1.627669 #> #> $bc$Petal.Width #> Standardized Box Cox Transformation with 150 nonmissing obs.: #> Estimated statistics: #> - lambda = 0.6433629 #> - mean (before standardization) = 0.08586719 #> - sd (before standardization) = 0.7857394 #> #> $bc$Sepal.Length #> Standardized Box Cox Transformation with 150 nonmissing obs.: #> Estimated statistics: #> - lambda = -0.144751 #> - mean (before standardization) = 1.549011 #> - sd (before standardization) = 0.1094848 #> #> $bc$Sepal.Width #> Standardized Box Cox Transformation with 150 nonmissing obs.: #> Estimated statistics: #> - lambda = 0.2810121 #> - mean (before standardization) = 1.30301 #> - sd (before standardization) = 0.1950175 #> #> #> $dt_columns #> [1] \"Petal.Length\" \"Petal.Width\" \"Sepal.Length\" \"Sepal.Width\" #> #> $affected_cols #> [1] \"Petal.Length\" \"Petal.Width\" \"Sepal.Length\" \"Sepal.Width\" #> #> $intasklayout #> Key: #> id type #> #> 1: Petal.Length numeric #> 2: Petal.Width numeric #> 3: Sepal.Length numeric #> 4: Sepal.Width numeric #> #> $outtasklayout #> Key: #> id type #> #> 1: Petal.Length numeric #> 2: Petal.Width numeric #> 3: Sepal.Length numeric #> 4: Sepal.Width numeric #> #> $outtaskshell #> Empty data.table (0 rows and 5 cols): Species,Petal.Length,Petal.Width,Sepal.Length,Sepal.Width #>"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":null,"dir":"Reference","previous_headings":"","what":"Path Branching — mlr_pipeops_branch","title":"Path Branching — mlr_pipeops_branch","text":"Perform alternative path branching: PipeOpBranch multiple output channels connect different paths Graph. time, one paths taken execution. end different paths, PipeOpUnbranch PipeOp must used indicate end alternative paths. confused PipeOpCopy, naming scheme bit unfortunate.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Path Branching — mlr_pipeops_branch","text":"R6Class object inheriting PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Path Branching — mlr_pipeops_branch","text":"options :: numeric(1) | character options integer number, determines number output channels / options created, named output1...output. $selection parameter integer. options character, determines names channels directly. $selection parameter factorial. id :: character(1) Identifier resulting object, default \"branch\". param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list().","code":"PipeOpBranch$new(options, id = \"branch\", param_vals = list())"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Path Branching — mlr_pipeops_branch","text":"PipeOpBranch one input channel named \"input\", taking input (\"*\") training prediction. PipeOpBranch multiple output channels depending options construction argument, named \"output1\", \"output2\", ... options numeric, named options value options character. output channels produce object given input (\"*\") NO_OP, training prediction.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Path Branching — mlr_pipeops_branch","text":"$state left empty (list()).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Path Branching — mlr_pipeops_branch","text":"selection :: numeric(1) | character(1) Selection branching path take. ParamInt options parameter construction numeric(1), ranges 1 options. ParamFct options parameter character possible values options values. Initialized either 1 (options construction argument numeric(1)) first element options (character).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Path Branching — mlr_pipeops_branch","text":"Alternative path branching handled PipeOp backend. indicate path taken, PipeOpBranch returns NO_OP object output channel. PipeOp handles NO_OP input automatically returning NO_OP output without calling private$.train() private$.predict(), PipeOpUnbranch reached. PipeOpUnbranch take multiple inputs, except one must NO_OP, forward non-NO_OP object output.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Path Branching — mlr_pipeops_branch","text":"fields inherited PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Path Branching — mlr_pipeops_branch","text":"methods inherited PipeOp.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_branch.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Path Branching — mlr_pipeops_branch","text":"","code":"library(\"mlr3\") pca = po(\"pca\") nop = po(\"nop\") choices = c(\"pca\", \"nothing\") gr = po(\"branch\", choices) %>>% gunion(list(pca, nop)) %>>% po(\"unbranch\", choices) gr$param_set$values$branch.selection = \"pca\" gr$train(tsk(\"iris\")) #> $unbranch.output #> (150 x 5): Iris Flowers #> * Target: Species #> * Properties: multiclass #> * Features (4): #> - dbl (4): PC1, PC2, PC3, PC4 #> gr$param_set$values$branch.selection = \"nothing\" gr$train(tsk(\"iris\")) #> $unbranch.output #> (150 x 5): Iris Flowers #> * Target: Species #> * Properties: multiclass #> * Features (4): #> - dbl (4): Petal.Length, Petal.Width, Sepal.Length, Sepal.Width #>"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":null,"dir":"Reference","previous_headings":"","what":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"Chunks input outnum chunks. Creates outnum Tasks training, simply passes input outnum times prediction.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"R6Class object inheriting PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"outnum :: numeric(1) Number output channels, therefore number chunks created. id :: character(1) Identifier resulting object, default \"chunk\". param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list().","code":"PipeOpChunk$new(outnum, id = \"chunk\", param_vals = list())"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":"input-and-output","dir":"Reference","previous_headings":"","what":"Input and Output","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"PipeOpChunk one input channel named \"input\", taking Task training prediction. PipeOpChunk multiple output channels depending options construction argument, named \"output1\", \"output2\", ... output channels produce (respectively disjoint, random) subsets input Task training, pass original Task prediction.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"$state left empty (list()).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"shuffle :: logical(1) data shuffled chunking? Initialized TRUE.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"Uses mlr3misc::chunk_vector() function.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"fields inherited PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"methods inherited PipeOp.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_chunk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Chunk Input into Multiple Outputs — mlr_pipeops_chunk","text":"","code":"library(\"mlr3\") task = tsk(\"wine\") opc = mlr_pipeops$get(\"chunk\", 2) # watch the row number: 89 during training (task is chunked)... opc$train(list(task)) #> $output1 #> (89 x 14): Wine Regions #> * Target: type #> * Properties: multiclass #> * Features (13): #> - dbl (11): alcalinity, alcohol, ash, color, dilution, flavanoids, #> hue, malic, nonflavanoids, phenols, proanthocyanins #> - int (2): magnesium, proline #> #> $output2 #> (89 x 14): Wine Regions #> * Target: type #> * Properties: multiclass #> * Features (13): #> - dbl (11): alcalinity, alcohol, ash, color, dilution, flavanoids, #> hue, malic, nonflavanoids, phenols, proanthocyanins #> - int (2): magnesium, proline #> # ... 178 during predict (task is copied) opc$predict(list(task)) #> $output1 #> (178 x 14): Wine Regions #> * Target: type #> * Properties: multiclass #> * Features (13): #> - dbl (11): alcalinity, alcohol, ash, color, dilution, flavanoids, #> hue, malic, nonflavanoids, phenols, proanthocyanins #> - int (2): magnesium, proline #> #> $output2 #> (178 x 14): Wine Regions #> * Target: type #> * Properties: multiclass #> * Features (13): #> - dbl (11): alcalinity, alcohol, ash, color, dilution, flavanoids, #> hue, malic, nonflavanoids, phenols, proanthocyanins #> - int (2): magnesium, proline #>"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":null,"dir":"Reference","previous_headings":"","what":"Class Balancing — mlr_pipeops_classbalancing","title":"Class Balancing — mlr_pipeops_classbalancing","text":"undersamples Task keep fraction rows majority class, well oversamples (repeats data points) rows minority class. Sampling happens training phase. Class-balancing Task sampling may beneficial classification imbalanced training data.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Class Balancing — mlr_pipeops_classbalancing","text":"R6Class object inheriting PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Class Balancing — mlr_pipeops_classbalancing","text":"id :: character(1) Identifier resulting object, default \"classbalancing\" param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list().","code":"PipeOpClassBalancing$new(id = \"classbalancing\", param_vals = list())"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Class Balancing — mlr_pipeops_classbalancing","text":"Input output channels inherited PipeOpTaskPreproc. Instead Task, TaskClassif used input output training prediction. output training input Task added removed rows balance target classes. output prediction unchanged input.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Class Balancing — mlr_pipeops_classbalancing","text":"$state named list $state elements inherited PipeOpTaskPreproc.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Class Balancing — mlr_pipeops_classbalancing","text":"parameters parameters inherited PipeOpTaskPreproc; however, affect_columns parameter present. parameters : ratio :: numeric(1) Ratio number rows classes keep, relative $reference value. Initialized 1. reference :: numeric(1) $ratio value measured . Can \"\" (mean instance count classes), \"major\" (instance count class instances), \"minor\" (instance count class fewest instances), \"nonmajor\" (average instance count classes except major one), \"nonminor\" (average instance count classes except minor one), \"one\" ($ratio determines number instances , per class). Initialized \"\". adjust :: numeric(1) classes / downsample. Can \"\" (downsample match required instance count), \"major\", \"minor\", \"nonmajor\", \"nonminor\" (see respective values $reference), \"upsample\" (upsample), \"downsample\". Initialized \"\". shuffle :: logical(1) Whether shuffle rows resulting task. case data upsampled shuffle = FALSE, resulting task original rows (removed downsampling) original order, followed newly added rows ordered target class. Initialized TRUE.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Class Balancing — mlr_pipeops_classbalancing","text":"/ downsampling happens follows: first, \"target class count\" calculated, taking mean class count classes indicated reference parameter (e.g. reference \"nonmajor\": mean class count classes \"major\" class, .e. class samples) multiplying value ratio parameter. reference \"one\", \"target class count\" just value ratio (.e. 1 * ratio). class referenced adjust parameter (e.g. adjust \"nonminor\": class class fewest samples), PipeOpClassBalancing either throws samples (downsampling), adds additional rows equal randomly chosen samples (upsampling), number samples classes equals \"target class count\". Uses task$filter() remove rows. identical rows added upsampling, task$row_roles$use can used duplicate rows [inaudible]; instead task$rbind() function used, new data.table attached contains rows duplicated exactly many times added.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Class Balancing — mlr_pipeops_classbalancing","text":"fields inherited PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class Balancing — mlr_pipeops_classbalancing","text":"methods inherited PipeOpTaskPreproc/PipeOp.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classbalancing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Class Balancing — mlr_pipeops_classbalancing","text":"","code":"library(\"mlr3\") task = tsk(\"spam\") opb = po(\"classbalancing\") # target class counts table(task$truth()) #> #> spam nonspam #> 1813 2788 # double the instances in the minority class (spam) opb$param_set$values = list(ratio = 2, reference = \"minor\", adjust = \"minor\", shuffle = FALSE) result = opb$train(list(task))[[1L]] table(result$truth()) #> #> spam nonspam #> 3626 2788 # up or downsample all classes until exactly 20 per class remain opb$param_set$values = list(ratio = 20, reference = \"one\", adjust = \"all\", shuffle = FALSE) result = opb$train(list(task))[[1]] table(result$truth()) #> #> spam nonspam #> 20 20"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":null,"dir":"Reference","previous_headings":"","what":"Majority Vote Prediction — mlr_pipeops_classifavg","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"Perform (weighted) majority vote prediction classification Predictions connecting PipeOpClassifAvg multiple PipeOpLearner outputs. Always returns \"prob\" prediction, regardless incoming Learner's $predict_type. label class highest predicted probability selected \"response\" prediction. Learner's $predict_type set \"prob\", prediction obtained also \"prob\" type prediction probability predicted weighted average incoming predictions. incoming Learner's $predict_type must agree. Weights can set parameter; none provided, defaults equal weights prediction. Defaults equal weights model. `","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"R6Class inheriting PipeOpEnsemble/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"innum :: numeric(1) Determines number input channels. innum 0 (default), vararg input channel created can take arbitrary number inputs. collect_multiplicity :: logical(1) TRUE, input Multiplicity collecting channel. means, Multiplicity input, instead multiple normal inputs, accepted members aggregated. requires innum 0. Default FALSE. id :: character(1) Identifier resulting object, default \"classifavg\". param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list().","code":"PipeOpClassifAvg$new(innum = 0, collect_multiplicity = FALSE, id = \"classifavg\", param_vals = list())"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"Input output channels inherited PipeOpEnsemble. Instead Prediction, PredictionClassif used input output prediction.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"$state left empty (list()).","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"parameters parameters inherited PipeOpEnsemble.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"Inherits PipeOpEnsemble implementing private$weighted_avg_predictions() method.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"fields inherited PipeOpEnsemble/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"methods inherited PipeOpEnsemble/PipeOp.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classifavg.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Majority Vote Prediction — mlr_pipeops_classifavg","text":"","code":"# \\donttest{ library(\"mlr3\") # Simple Bagging gr = ppl(\"greplicate\", po(\"subsample\") %>>% po(\"learner\", lrn(\"classif.rpart\")), n = 3 ) %>>% po(\"classifavg\") resample(tsk(\"iris\"), GraphLearner$new(gr), rsmp(\"holdout\")) #> with 1 resampling iterations #> task_id #> iris #> learner_id #> subsample_1.subsample_2.subsample_3.classif.rpart_1.classif.rpart_2.classif.rpart_3.classifavg #> resampling_id iteration prediction_test warnings errors #> holdout 1 0 0 # }"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":null,"dir":"Reference","previous_headings":"","what":"Class Weights for Sample Weighting — mlr_pipeops_classweights","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"Adds class weight column Task different Learners may able use sample weighting. Sample weights added sample according target class. binary classification tasks supported. Caution: constructed naively without parameter, weights set 1. minor_weight parameter must adjusted PipeOp useful. Note sets \"weights_learner\" column. therefore influences behaviour subsequent Learners, influence resampling evaluation metric weights.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"R6Class object inheriting PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"id :: character(1) Identifier resulting object, default \"classweights\" param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list().","code":"PipeOpClassWeights$new(id = \"classweights\", param_vals = list())"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"Input output channels inherited PipeOpTaskPreproc. Instead Task, TaskClassif used input output training prediction. output training input Task added weights column according target class. output prediction unchanged input.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"$state named list $state elements inherited PipeOpTaskPreproc.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"parameters parameters inherited PipeOpTaskPreproc; however, affect_columns parameter present. parameters : minor_weight :: numeric(1) Weight given samples minor class. Major class samples weight 1. Initialized 1.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"Introduces, overwrites, \"weights\" column Task. However, Learner method needs respect weights effect. newly introduced column named .WEIGHTS; naming conflict column already exists weight column .","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"fields inherited PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"methods inherited PipeOpTaskPreproc/PipeOp.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_classweights.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Class Weights for Sample Weighting — mlr_pipeops_classweights","text":"","code":"library(\"mlr3\") task = tsk(\"spam\") opb = po(\"classweights\") # task weights if (\"weights_learner\" %in% names(task)) { task$weights_learner # recent mlr3-versions } else { task$weights # old mlr3-versions } #> NULL # double the instances in the minority class (spam) opb$param_set$values$minor_weight = 2 result = opb$train(list(task))[[1L]] if (\"weights_learner\" %in% names(result)) { result$weights_learner # recent mlr3-versions } else { result$weights # old mlr3-versions } #> Key: #> row_id weight #> #> 1: 1 2 #> 2: 2 2 #> 3: 3 2 #> 4: 4 2 #> 5: 5 2 #> --- #> 4597: 4597 1 #> 4598: 4598 1 #> 4599: 4599 1 #> 4600: 4600 1 #> 4601: 4601 1"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"Applies function column task. Use affect_columns parameter inherited PipeOpTaskPreprocSimple limit columns function applied . can used simple parameter transformations type conversions (e.g. .numeric). function applied training prediction. One important relationship machine learning preprocessing prediction phase, preprocessing data row independent rows. Therefore, applicator function always return vector / list result component depends corresponding input component components. rule thumb, function f generates output different Vectorize(f), function used applicator.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"R6Class object inheriting PipeOpTaskPreprocSimple/PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":"construction","dir":"Reference","previous_headings":"","what":"Construction","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"id :: character(1) Identifier resulting object, default \"colapply\". param_vals :: named list List hyperparameter settings, overwriting hyperparameter settings otherwise set construction. Default list().","code":"PipeOpColApply$new(id = \"colapply\", param_vals = list())"},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":"input-and-output-channels","dir":"Reference","previous_headings":"","what":"Input and Output Channels","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"Input output channels inherited PipeOpTaskPreprocSimple. output input Task features changed according applicator parameter.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":"state","dir":"Reference","previous_headings":"","what":"State","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"$state named list $state elements inherited PipeOpTaskPreprocSimple.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":"parameters","dir":"Reference","previous_headings":"","what":"Parameters","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"parameters parameters inherited PipeOpTaskPreprocSimple, well : applicator :: function Function apply column task. return value vector length input, .e., function vectorizes input. typical example .numeric. return value can also matrix, data.frame, data.table. case, length input must match number returned rows. names resulting features output Task based (column) name(s) return value applicator function, prefixed original feature name separated dot (.). Use Vectorize create vectorizing function function ordinarily takes one element input.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":"internals","dir":"Reference","previous_headings":"","what":"Internals","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"Calls map data, using value applicator f. coerces output via .data.table.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":"fields","dir":"Reference","previous_headings":"","what":"Fields","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"fields inherited PipeOpTaskPreprocSimple/PipeOpTaskPreproc/PipeOp.","code":""},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"methods inherited PipeOpTaskPreprocSimple/PipeOpTaskPreproc/PipeOp.","code":""},{"path":[]},{"path":"https://mlr3pipelines.mlr-org.com/reference/mlr_pipeops_colapply.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Apply a Function to each Column of a Task — mlr_pipeops_colapply","text":"","code":"library(\"mlr3\") task = tsk(\"iris\") poca = po(\"colapply\", applicator = as.character) poca$train(list(task))[[1]] # types are converted #> (150 x 5): Iris Flowers #> * Target: Species #> * Properties: multiclass #> * Features (4): #> - chr (4): Petal.Length, Petal.Width, Sepal.Length, Sepal.Width # function that does not vectorize f1 = function(x) { # we could use `ifelse` here, but that is not the point if (x > 1) { \"a\" } else { \"b\" } } poca$param_set$values$applicator = Vectorize(f1) poca$train(list(task))[[1]]$data() #> Species Petal.Length Petal.Width Sepal.Length Sepal.Width #> #> 1: setosa a b a a #> 2: setosa a b a a #> 3: setosa a b a a #> 4: setosa a b a a #> 5: setosa a b a a #> --- #> 146: virginica a a a a #> 147: virginica a a a a #> 148: virginica a a a a #> 149: virginica a a a a #> 150: virginica a a a a # only affect Petal.* columns poca$param_set$values$affect_columns = selector_grep(\"^Petal\") poca$train(list(task))[[1]]$data() #> Species Petal.Length Petal.Width Sepal.Length Sepal.Width #> #> 1: setosa a b 5.1 3.5 #> 2: setosa a b 4.9 3.0 #> 3: setosa a b 4.7 3.2 #> 4: setosa a b 4.6 3.1 #> 5: setosa a b 5.0 3.6 #> --- #> 146: virginica a a 6.7 3.0 #> 147: virginica a a 6.3 2.5 #> 148: virginica a a 6.5 3.0 #> 149: virginica a a 6.2 3.4 #> 150: virginica a a 5.9 3.0 # function returning multiple columns f2 = function(x) { cbind(floor = floor(x), ceiling = ceiling(x)) } poca$param_set$values$applicator = f2 poca$param_set$values$affect_columns = selector_all() poca$train(list(task))[[1]]$data() #> Species Petal.Length.floor Petal.Length.ceiling Petal.Width.floor #>