Abstract output transformation class.
An output transformation can be used within a Surrogate to perform a transformation of the target variable(s).
See also
Other Output Transformation:
OutputTrafoLog
,
OutputTrafoStandardize
,
mlr_output_trafos
Active bindings
label
(
character(1)
)
Label for this object.man
(
character(1)
)
String in the format[pkg]::[topic]
pointing to a manual page for this object.packages
(
character()
)
Set of required packages. A warning is signaled if at least one of the packages is not installed, but loaded (not attached) later on-demand viarequireNamespace()
.state
(named
list()
|NULL
)
List of meta information regarding the parameters and their state.cols_y
(
character()
|NULL
)
Column ids of target variables that should be transformed.max_to_min
(
-1
|1
)
Multiplicative factor to correct for minimization or maximization.invert_posterior
(
logical(1)
)
Should the posterior predictive distribution be inverted when used within a SurrogateLearner or SurrogateLearnerCollection?
Methods
Method new()
Creates a new instance of this R6 class.
Usage
OutputTrafo$new(invert_posterior, label = NA_character_, man = NA_character_)
Arguments
invert_posterior
(
logical(1)
)
Should the posterior predictive distribution be inverted when used within a SurrogateLearner or SurrogateLearnerCollection?label
(
character(1)
)
Label for this object.man
(
character(1)
)
String in the format[pkg]::[topic]
pointing to a manual page for this object.
Method update()
Learn the transformation based on observed data and update parameters in $state
.
Must be implemented by subclasses.
Arguments
ydt
(
data.table::data.table()
)
Data. One row per observation with at least columns$cols_y
.
Method transform()
Perform the transformation. Must be implemented by subclasses.
Arguments
ydt
(
data.table::data.table()
)
Data. One row per observation with at least columns$cols_y
.
Returns
data.table::data.table()
with the transformation applied to the columns $cols_y
.
Method inverse_transform_posterior()
Perform the inverse transformation on a posterior predictive distribution characterized by the first and second moment. Must be implemented by subclasses.
Arguments
pred
(
data.table::data.table()
)
Data. One row per observation characterizing a posterior predictive distribution with the columnsmean
andse
.
Returns
data.table::data.table()
with the inverse transformation applied to the columns mean
and se
.
Method inverse_transform()
Perform the inverse transformation. Must be implemented by subclasses.
Arguments
ydt
(
data.table::data.table()
)
Data. One row per observation with at least columns$cols_y
.
Returns
data.table::data.table()
with the inverse transformation applied to the columns $cols_y
.