# generates_normalization_function: Function to generate the data normalization function In okayaa/MT: Methods in Mahalanobis-Taguchi (MT) System

## Description

`generates_normalization_function` returns the data normalization function. The data normalization function is generated based on `unit_space_data`.

## Usage

 ```1 2``` ```generates_normalization_function(unit_space_data, unit_space_center, unit_space_scale, is_scaled = TRUE) ```

## Arguments

 `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.

## Value

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`.

`MT` and `MTA`
 ```1 2 3 4 5 6``` ```# 40 data for versicolor in the iris dataset iris_versicolor <- iris[61:100, -5] normalizes_data <- generates_normalization_function(iris_versicolor) is.function(normalizes_data) # TRUE ```