if (requireNamespace("rpart")) {
+library(mlr3)
task = tsk("boston_housing")
po = PipeOpTargetTrafoScaleRange$new()
po$train(list(task))
-#> $fun
-#> NULL
-#>
-#> $output
-#> <TaskRegr:boston_housing> (506 x 18): Boston Housing Prices
-#> * Target: cmedv.scaled
-#> * Properties: -
-#> * Features (17):
-#> - dbl (12): age, b, crim, dis, indus, lat, lon, lstat, nox, ptratio,
-#> rm, zn
-#> - int (3): rad, tax, tract
-#> - fct (2): chas, town
-#>
po$predict(list(task))
-#> $fun
-#> function (inputs)
-#> {
-#> assert_list(inputs, len = 1L, types = "Prediction")
-#> list(private$.invert(inputs[[1L]], predict_phase_state))
-#> }
-#> <bytecode: 0x56378ff01640>
-#> <environment: 0x56377e2e0bf8>
-#>
-#> $output
-#> <TaskRegr:boston_housing> (506 x 18): Boston Housing Prices
-#> * Target: cmedv.scaled
-#> * Properties: -
-#> * Features (17):
-#> - dbl (12): age, b, crim, dis, indus, lat, lon, lstat, nox, ptratio,
-#> rm, zn
-#> - int (3): rad, tax, tract
-#> - fct (2): chas, town
-#>
#syntactic sugar for a graph using ppl():
ttscalerange = ppl("targettrafo", trafo_pipeop = PipeOpTargetTrafoScaleRange$new(),
graph = PipeOpLearner$new(LearnerRegrRpart$new()))
ttscalerange$train(task)
-#> $targetinvert.output
-#> NULL
-#>
ttscalerange$predict(task)
-#> $targetinvert.output
-#> <PredictionRegr> for 506 observations:
-#> row_ids truth response
-#> 1 24.0 24.53538
-#> 2 21.6 26.91481
-#> 3 34.7 32.96875
-#> ---
-#> 504 23.9 24.53538
-#> 505 22.0 24.53538
-#> 506 19.0 20.96400
-#>
ttscalerange$state$regr.rpart
+ }
#> $model
#> n= 506
#>
@@ -346,11 +302,11 @@