Learn R Programming

pguIMP (version 0.0.0.3)

pgu.optimizer: pgu.optimizer

Description

Finds the transformation models that result in distributions that come closest to a normal distribution.

Arguments

Format

R6::R6Class object.

Active bindings

features

Returns the instance variable features. (character)

trafoAlphabet

Returns the instance variable trafoAlphabet. (character)

setTrafoAlphabet

Sets the instance variable trafoAlphabet to data. (character)

mirror

Returns the instance variable mirror (logical)

setMirror

Sets the instance variable mirror to data (logical)

optParameter

Returns the instance variable optParameter (tibble::tibble)

optTypes

Returns the instance variable optTypes (tibble::tibble)

Methods

Public methods

Method new()

Creates and returns a new pgu.optimizer object.

Usage

pgu.optimizer$new(data = "tbl_df")

Arguments

data

The data to be analyzed. (tibble::tibble)

Returns

A new pgu.optimizer object. (pguIMP::pgu.optimizer)

Method finalize()

Clears the heap and indicates that instance of pgu.optimizer is removed from heap.

Usage

pgu.optimizer$finalize()

Method print()

Prints instance variables of a pgu.optimizer object.

Usage

pgu.optimizer$print()

Returns

string

Method resetFeatures()

Extract the attribute names from the given data frame and stores them in the class' instance variable features,

Usage

pgu.optimizer$resetFeatures(data = "tbl_df")

Arguments

data

The data to be analyzed. (tibble::tibble)

Method resetOptParameter()

Initializes the instance variable optParameter.

Usage

pgu.optimizer$resetOptParameter()

Method resetOptTypes()

Initializes the instance variable optTypes.

Usage

pgu.optimizer$resetOptTypes()

Method resetOptimizer()

Initializes the optimizer instance variables. Here, initialization defines a consecutive sequence of the class' functions: resetFeatures, setTrafoAlphabet, setMirror, resetOptParameter and resetOptTypes.

Usage

pgu.optimizer$resetOptimizer(data = "tbl_df")

Arguments

data

The data to be analyzed. (tibble::tibble)

Method featureIdx()

Determines the numerical index of the column of an attribute based on the attribute name.

Usage

pgu.optimizer$featureIdx(feature = "character")

Arguments

feature

The attribute's name. (character)

Returns

The attributes column index. (numeric)

Method modelParameterIsBigger()

Compares a model parameter to a reference parameter and tests, if the model parameter is bigger.

Usage

pgu.optimizer$modelParameterIsBigger(
  modelParameter = "numeric",
  referenceParameter = "numeric"
)

Arguments

modelParameter

The model parameter (numeric)

referenceParameter

The reference parameter (numeric)

Returns

Test Result (logical)

Method modelParameterIsSmaller()

Compares a model parameter to a reference parameter and tests, if the model parameter is smaller.

Usage

pgu.optimizer$modelParameterIsSmaller(
  modelParameter = "numeric",
  referenceParameter = "numeric"
)

Arguments

modelParameter

The model parameter (numeric)

referenceParameter

The reference parameter (numeric)

Returns

Test Result (logical)

Method updateTrafoType()

Takes an instance of the pgu.transfromator class and sets the transformation type to a user defined value.

Usage

pgu.optimizer$updateTrafoType(
  transformator = "pgu.transformator",
  type = "character"
)

Arguments

transformator

An instance of the pgu.transformator class (pguIMP::pgu.transformator)

type

A transfromation type (character)

Returns

An updated instance of the pgu.transformator class (pguIMP::pgu.transformator)

Method updateMirrorLogic()

Takes an instance of the pgu.transfromator class and sets the mirrorLogic parameter to a user defined value.

Usage

pgu.optimizer$updateMirrorLogic(
  transformator = "pgu.transformator",
  logic = "logical"
)

Arguments

transformator

An instance of the pgu.transformator class (pguIMP::pgu.transformator)

logic

The mirrorLogic parameter (logic)

Returns

An updated instance of the pgu.transformator class (pguIMP::pgu.transformator)

Method updateOptParameter()

Takes an instance of the pgu.model class and analyzes it. Keeps track of the optimal model parameters during optimization and stores them in the instance variables optTypes and optParameter.

Usage

pgu.optimizer$updateOptParameter(
  model = "pgu.model",
  type = "character",
  logic = "character"
)

Arguments

model

An instance of the pgu.model class (pguIMP::pgu.model)

type

A transfromation type (character)

logic

The mirrorLogic parameter (logic)

Method optimize()

Permutates all possible variations of data transfromations and iterates through them. Analysis the optimal transformation parameters for each attribute in the data frame and stores them in the instance variables optParameter, optTypes.

Usage

pgu.optimizer$optimize(data = "tbl_df", progress = "Progress")

Arguments

data

The data frame to be analyzed. (tibble::tibble)

progress

If shiny is loaded, the analysis' progress is stored within this instance of the shiny Progress class. (shiny::Progress)

Method trafoAlpahbetTblDf()

Returns information on the optimization progress

Usage

pgu.optimizer$trafoAlpahbetTblDf()

Returns

The data frame comprizing analysis information. (tibble::tibble)

Method clone()

The objects of this class are cloneable with this method.

Usage

pgu.optimizer$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

Analysis is performed individually on each attribute. This object is used by the shiny based gui and is not for use in individual R-scripts!