FuzzyRescale: R6 Fuzzy Rescale

Description Arguments Examples

Description

The R6 class FuzzyRescale transforms data into 0-1 or 0-100 scale based on Fuzzy membership functions.

Arguments

x

An R object. Currently there are methods for vectors, matrices, and data frames. Factors are allowed, but characters are not.

select

expression, indicating columns to select from a data frame or matrix

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds. This class is missing tolerable (i.e., compatible), in which the transformation will not remove NAs if na.rm is FALSE, it abides the dimension of vectors and retrun NAs beside the truly transformed values.

digits

integer indicating the number of decimal places to be used.

max

a scalar indicating the maximum endpoint of rescaled variable. The might be 1, 100, etc.

center

it determines the central value of a fuzzy set. It should be any of the values "mean", "median" or any numeric input. It will have a membership degree of 1, in gaussmf() method; 0.5 in sigmf();

sigma

it determines the width of a fuzzy set obtained from either gaussmf() or sigmf(). It should be any of the values "sd", "IQR" or any numeric input. In sigmf(), to open the membership function to the left or right, specify a negative or positive value for sigma, respectively.

param_one

This is the first parameter for smf(). If param_one is lower than param_two, it will be the foot of the membership function; otherwise it will define the shoulder. It should be either "min" or "max", any quantiles defined by the prefix "p" followed by a value in [0,100] (e.g., "p2.5" indicates 2.5% percentile of the input variable), or any numeric input.

param_two

This is the second parameter for smf(). If param_two is higher than param_one, it will define the shoulder of the membership function; otherwise it will be the foot It should be either "max" or "min", any quantiles defined by the prefix "p" followed by a value in [0,100] (e.g., "p97.5" indicates 97.5% percentile of the input variable), or any numeric input.

Examples

1
2
3
4
5
6
7
x <- c(
   0.2, 0.5, 1.1, 1.4, 1.8, 2.3, 2.5, 2.7, 3.5, 4.4,
   4.6, 5.4, 5.4, 5.7, 5.8, 5.9, 6.0, 6.6, 7.1, 7.9
)
x_fuzzy <- FuzzyRescale$new(x)
R6::is.R6(x_fuzzy)
x_fuzzy$gaussmf()

MaaniBeigy/fuzzyrescaler documentation built on Oct. 30, 2019, 9:07 p.m.