Annex v0.1.0 Annex.Utils View Source

This module holds functions that are not necessarily specific to one of Annex's other modules.

Link to this section Summary

Functions

Calculates the dot product which is the sum of element-wise multiplication of two enumerables.

Calculates the average.

Turns a list of floats into floats between 0.0 and 1.0 at their respective ratio.

Turns a list of floats into their proportions.

Generates a float between -1.0 and 1.0

Generates a list of n floats between -1.0 and 1.0.

Random unifmormly splits a given dataset into two datasets at a given frequency.

A strict zip function in which the two given enumerables must be the same size.

A strict zip-while-mapping function in which the two given enumerables must be the same size.

Link to this section Functions

Calculates the dot product which is the sum of element-wise multiplication of two enumerables.

Calculates the average.

Link to this function

normalize(data) View Source
normalize([float()]) :: [float()]

Turns a list of floats into floats between 0.0 and 1.0 at their respective ratio.

Link to this function

proportions(data) View Source
proportions([float()]) :: [float()]

Turns a list of floats into their proportions.

The sum of the output should be approximately 1.0.

Link to this function

random_float() View Source
random_float() :: float()

Generates a float between -1.0 and 1.0

Generates a list of n floats between -1.0 and 1.0.

Link to this function

split_dataset(dataset, frequency) View Source

Random unifmormly splits a given dataset into two datasets at a given frequency.

Link to this function

transpose(a) View Source
transpose(any()) :: [[any()]]

Link to this function

zip(a, b) View Source
zip([any()], [any()]) :: [{any(), any()}]

A strict zip function in which the two given enumerables must be the same size.

Link to this function

zipmap(list1, list2, func) View Source
zipmap([any()], [any()], any()) :: [any()]

A strict zip-while-mapping function in which the two given enumerables must be the same size.