BF-MATH-NORMALIZERS - Normalizers

../../../../../../../_images/MLPro-BF-Math-Normalizers_class_diagram.drawio.png

Ver. 1.0.14 (2023-02-13) This module provides base class for Normalizers and normalizer objects including MinMax normalization and normalization by Z transformation.

class mlpro.bf.math.normalizers.Normalizer

Bases: object

Base template class for normalizer objects.

_set_parameters(p_param)

custom method to set the normalization parameters

Parameters:

p_set (Set) – Set related to the elements to be normalized

Returns:

boolean – Returns true after setting the parameters

Return type:

True

normalize(p_data: Element | ndarray)

Method to normalize a data (Element/ndarray) element based on MinMax or Z-transformation

Parameters:

p_data (Element or a numpy array) – Data element to be normalized

Returns:

element – Normalized Data

Return type:

Element or numpy array

denormalize(p_data: Element | ndarray)

Method to denormalize a data (Element/ndarray) element based on MinMax or Z-transformation

Parameters:

p_data (Element or a numpy array) – Data element to be denormalized

Returns:

element – Denormalized Data

Return type:

Element or numpy array

renormalize(p_data: Element | ndarray)

Method to denormalize and renormalize an element based on old and current normalization parameters.

Parameters:

p_data (Element or numpy array) – Element to be renormalized.

Returns:

renormalized_element – Renormalized Data

Return type:

Element or numpy array

update_parameters(p_data: Set | Element | ndarray)

Custom method to update normalization parameters.

Parameters:

p_data – arguments specific to normalization parameters. Check the normalizer objects for specific parameters

class mlpro.bf.math.normalizers.NormalizerMinMax

Bases: Normalizer

Class to normalize elements based on MinMax normalization.

update_parameters(p_set: Set | None = None, p_boundaries: list | ndarray | None = None)

Method to update the normalization parameters of MinMax normalizer.

Parameters:
  • p_set (Set) – Set related to the elements to be normalized

  • p_boundaries (ndarray) – array consisting of boundaries related to the dimension of the array

class mlpro.bf.math.normalizers.NormalizerZTrans

Bases: Normalizer

Class for Normalization based on Z transformation.

update_parameters(p_dataset: ndarray | None = None, p_data_new: Element | ndarray | None = None, p_data_del: Element | ndarray | None = None)

Method to update the normalization parameters for Z transformer

Parameters:
  • p_dataset (numpy array) – Dataset related to the elements to be normalized. Using this parameter will reset the normalization parameters based on the dataset provided.

  • p_data_new (Element or numpy array) – New element to update the normalization parameters. Using this parameter will set/update the normalization parameters based on the data provided.

  • p_data_del (Element or Numpy array) – Old element that is replaced with the new element.