LearnKit v0.1.6 LearnKit.Preprocessing View Source

Module for data preprocessing

Link to this section Summary

Functions

Prepare coefficients for normalization

Normalize data set with minimax normalization

Normalize data set

Normalize 1 feature with predefined coefficients

Link to this section Types

Link to this section Functions

Link to this function coefficients(features, type) View Source
coefficients(matrix(), String.t()) :: matrix()

Prepare coefficients for normalization

Parameters

  • features: features grouped by index
  • type: minimax/z_normalization

Examples

iex> LearnKit.Preprocessing.coefficients([[1, 2], [3, 4], [5, 6]], "minimax")
[{1, 5}, {2, 6}]

iex> LearnKit.Preprocessing.coefficients([[1, 2], [3, 4], [5, 6]], "z_normalization")
[{3.0, 1.632993161855452}, {4.0, 1.632993161855452}]
Link to this function normalize(features) View Source
normalize(matrix()) :: matrix()

Normalize data set with minimax normalization

Parameters

  • features: list of features for normalization

Examples

iex> LearnKit.Preprocessing.normalize([[1, 2], [3, 4], [5, 6]])
[
  [0.0, 0.0],
  [0.5, 0.5],
  [1.0, 1.0]
]
Link to this function normalize(features, options) View Source
normalize(matrix(), list()) :: matrix()

Normalize data set

Parameters

  • features: list of features for normalization
  • options: keyword list with options

Options

  • type: minimax/z_normalization, default is minimax, optional

Examples

iex> LearnKit.Preprocessing.normalize([[1, 2], [3, 4], [5, 6]], [type: "z_normalization"])
[
  [-1.224744871391589, -1.224744871391589],
  [0.0, 0.0],
  [1.224744871391589, 1.224744871391589]
]
Link to this function normalize_feature(feature, coefficients, type) View Source
normalize_feature(list(), [tuple()], String.t()) :: list()

Normalize 1 feature with predefined coefficients

Parameters

  • feature: feature for normalization
  • coefficients: predefined coefficients
  • type: minimax/z_normalization

Examples

iex> LearnKit.Preprocessing.normalize_feature([1, 2], [{1, 5}, {2, 6}], "minimax")
[0.0, 0.0]