FactorMixin

class pyoptex.utils.factor.FactorMixin[source]

Factor Mixin to be used whenever creating a new factor class. This mixin contains common validation code and functions to normalize and denormalize columns based on the factors settings.

Attributes

namestr

The name of the factor

typestr

The type of the factor, can be ‘continuous’, ‘cont’, ‘categorical’, ‘cat’, ‘mixture’, ‘mixt’, ‘quantitative’, ‘quant’, ‘qualitative’, ‘qual’

minfloat

The minimum of the factor. Used for continuous factors.

maxfloat

The maximum of the factor. Used for continuous factors.

levelslist(float) or list(str)

For continuous factors, this is the list of possible numerical values. For categorical factors, this is a list of strings for the possible categories.

coordslist(np.array(2d))

Only possible for categorical factors. The list of encodings of each level.

__init__()[source]

Methods

FactorMixin.denormalize(data)

Denormalizes the data coming from this factor.

FactorMixin.normalize(data)

Normalizes the data coming from this factor.

FactorMixin.validate()

Validation of the settings.

Attributes

FactorMixin.coords_

Extracts the encoded coordinates for the factor.

FactorMixin.is_categorical

Check wether the factor is catgorical.

FactorMixin.is_continuous

Checks whether the factor is continuous.

FactorMixin.is_mixture

Checks wether the factor is a mixture.

FactorMixin.mean

The mean of the factor for normalization of a continuous factor.

FactorMixin.scale

The scale of the factor for normalization of a continuous factor.