energia.utils.math#

Utilities to perform mathematical operations

Functions

erf(x, /)

Error function at x.

exp(x, /)

Return e raised to the power of x.

find_euclidean_distance(a, b)

finds euclidean distances between two cluster nodes

generate_connectivity_matrix(scale_len)

Generates a connectivity matrix to maintain chronology [..1,0,1..]

norm_constant(p, mu, sigma)

Calculates the normal constant

normalize(data[, how])

min max normalization of data

sqrt(x, /)

Return the square root of x.

norm_constant(p, mu, sigma) float[source]#

Calculates the normal constant

Parameters:
  • p (float) – level of compliance

  • mu (float) – mean

  • sigma (float) – standard deviation

Returns:

normal constant

Return type:

float

find_euclidean_distance(a: list, b: list) float[source]#

finds euclidean distances between two cluster nodes

Parameters:
  • a (list) – coordinates of cluster node a

  • b (list) – coordinates of cluster node b

Returns:

euclidean distance

Return type:

float

generate_connectivity_matrix(scale_len) array[source]#

Generates a connectivity matrix to maintain chronology [..1,0,1..]

Parameters:

scale_len (int) – length of the scale

Returns:

connectivity matrix

Return type:

numpy.array

normalize(data: list, how: str = 'max') list[source]#

min max normalization of data

Parameters:
  • data (numpy.array | DataFrame) – time-series data

  • how (str, optional) – min-max or max, defaults to “max”

Returns:

normalized data

Return type:

numpy.array | DataFrame