Skip to contents

Abstract output transformation class.

An output transformation can be used within a Surrogate to perform a transformation of the target variable(s).

See also

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 via requireNamespace().

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.

Usage

OutputTrafo$update(ydt)

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.

Usage

OutputTrafo$transform(ydt)

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.

Usage

OutputTrafo$inverse_transform_posterior(pred)

Arguments

pred

(data.table::data.table())
Data. One row per observation characterizing a posterior predictive distribution with the columns mean and se.

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.

Usage

OutputTrafo$inverse_transform(ydt)

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.


Method format()

Helper for print outputs.

Usage

OutputTrafo$format()

Returns

(character(1)).


Method print()

Print method.

Usage

OutputTrafo$print()

Returns

(character()).


Method clone()

The objects of this class are cloneable with this method.

Usage

OutputTrafo$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.