nnbma.operators package

Submodules

nnbma.operators.base module

nnbma.operators.base.asinh(t: ndarray, a: float = 1.0)[source]
nnbma.operators.base.id(t: ndarray)[source]
nnbma.operators.base.log10(t: ndarray)[source]
nnbma.operators.base.pow10(t: ndarray)[source]
nnbma.operators.base.sinh(t: ndarray, a: float = 1.0)[source]

nnbma.operators.normalization module

class nnbma.operators.normalization.InverseNormalizer(df: DataFrame, norm_type: NormTypes)[source]

Bases: Operator

Specific operator that reverts a specified normalization of the dataset.

Parameters:
  • df (pd.DataFrame) – dataset to be normalized.

  • norm_type (NormTypes) – type of normalization to revert.

class nnbma.operators.normalization.NormTypes(value)[source]

Bases: Enum

Types of normalization

MEAN0 = 1

Center the columns, i.e., set their means to 0.

MEAN0STD1 = 3

Center and reduce the columns, i.e., set their means to 0 and their variances to 1.

MIN0MAX1 = 4

Apply a MinMax normalization, i.e., set the minimum value of each column to 0 and the maximum to 1.

MIN1MAX1 = 5

Apply an alternative MinMax normalization, i.e., set the minimum value of each column to -1 and the maximum to 1.

NONE = 0

No normalization.

STD1 = 2

Reduce the columns, i.e., set their variances to 1.

class nnbma.operators.normalization.Normalizer(df: DataFrame, norm_type: NormTypes)[source]

Bases: Operator

Specific operator that applies a specified normalization of the dataset.

Parameters:
  • df (pd.DataFrame) – dataset to be normalized.

  • norm_type (NormTypes) – type of normalization to be applied.

nnbma.operators.operator module

class nnbma.operators.operator.ColumnwiseOperator(ops: List[Callable[[ndarray], ndarray]])[source]

Bases: Operator

Class that stores a list of operators – one per column of the dataset to be considered. It defines a pre-processing on the dataset.

Parameters:

ops (List[Callable[[np.ndarray], np.ndarray]]) – list of operators or composition of operators, with one per column of the dataset to be pre-processed.

class nnbma.operators.operator.Operator(fun: Callable[[ndarray], ndarray])[source]

Bases: object

Class that stores a transformation to be applied to a full dataset or to one column.

Parameters:

fun (Callable[[np.ndarray], np.ndarray]) – any function that returns numpy.arrays with the same size as its input.

class nnbma.operators.operator.SequentialOperator(ops: List[Operator])[source]

Bases: Operator

Defines an operator on one column as a composition of multiple operators.

Parameters:

ops (List[Operator]) – the list of operators to be composed, in the order of application.

Module contents