unit_space_data: Matrix with n rows (samples) and p columns (variables). Data to generate the unit space. All data should be continuous values and should not have missing values.
unit_space_center: Vector with length p. The values are subtrahends in normalization. If missing, the mean for each column of unit_space_data is used for normalization.
unit_space_scale: Vector with length p. The values are divisors in normalization. If missing and is_scaled is TRUE, then the unbiased standard deviation for each column of unit_space_data is used for normalization.
is_scaled: Logical. If TRUE (default value), normalization is conducted by subtracting unit_space_center and dividing by unit_space_scale. If FALSE, normalization is conducted by subtracting unit_space_center only.
Returns
Function is returned which takes an n x p matrix as an (only) argument and returns a normalized n x p matrix. The normalization is conducted based on unit_space_data.
Examples
# 40 data for versicolor in the iris datasetiris_versicolor <- iris[61:100,-5]normalizes_data <- generates_normalization_function(iris_versicolor)is.function(normalizes_data)# TRUE