Linearly Transform the Domain of Functional Data
Source:R/PipeOpFDAScaleRange.R
mlr_pipeops_fda.scalerange.Rd
Linearly transform the domain of functional data so they are between lower
and upper
.
The formula for this is \(x' = offset + x * scale\),
where \(scale\) is \((upper - lower) / (max(x) - min(x))\) and
\(offset\) is \(-min(x) * scale + lower\). The same transformation is applied during training and prediction.
Parameters
The parameters are the parameters inherited from PipeOpTaskPreproc
,
as well as the following parameters:
lower
::numeric(1)
Target value of smallest item of input data. Initialized to0
.uppper
::numeric(1)
Target value of greatest item of input data. Initialized to1
.
Super classes
mlr3pipelines::PipeOp
-> mlr3pipelines::PipeOpTaskPreproc
-> PipeOpFDAScaleRange
Methods
Method new()
Initializes a new instance of this Class.
Usage
PipeOpFDAScaleRange$new(id = "fda.scalerange", param_vals = list())
Examples
task = tsk("fuel")
po_scale = po("fda.scalerange", lower = -1, upper = 1)
task_scale = po_scale$train(list(task))[[1L]]
task_scale$data()
#> heatan h20 NIR UVVIS
#> <num> <num> <tfd_reg> <tfd_reg>
#> 1: 26.7810 2.3000 ▇▇▇█████████████████████▇▇ ▆▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇███████
#> 2: 27.4720 3.0000 ▆▇▇▇▇▇▇▇▇█████████████████ ▂▂▁▂▁▁▁▁▁▂▂▂▂▂▂▂▂▂▂▃▃▃▃▃▃▃
#> 3: 23.8400 2.0002 ▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅ ▄▃▃▃▃▃▃▃▃▃▃▃▃▄▄▄▄▄▄▄▄▄▄▄▄▄
#> 4: 18.1680 1.8500 ▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅ ▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▄▃▃
#> 5: 17.5170 2.3898 ▄▅▅▅▅▅▅▅▅▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▃▃▃▃▃▃▃
#> ---
#> 125: 23.8340 2.1100 ▅▅▅▅▅▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ ▃▃▃▃▃▃▃▃▃▃▂▂▃▃▃▃▃▃▃▃▃▃▃▃▃▃
#> 126: 11.8050 1.6200 ▂▂▂▂▃▃▃▃▃▃▃▄▄▄▄▄▄▄▄▅▅▅▅▅▅▆ ▂▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▂▂▂▂▂▂
#> 127: 8.8315 1.4200 ▁▁▁▂▂▂▂▂▂▃▃▃▃▃▄▄▄▄▄▄▄▅▅▅▅▆ ▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▂
#> 128: 11.3450 1.4800 ▅▅▅▅▅▅▆▆▆▆▆▆▆▆▆▇▇▇▇▇▆▆▆▆▆▆ ▆▆▆▆▆▆▆▆▅▅▅▅▅▅▅▆▆▆▆▆▆▆▆▆▆▆
#> 129: 28.9940 2.5000 ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ ▂▂▂▂▂▂▂▂▂▂▂▂▃▃▃▃▃▃▃▃▃▃▃▃▃▃