transformers

This module gathers all classes and methods used to transform data to new scales.

class ClosestTransformer

Bases: Transformer

This transformer associates out-of-scale values with closest preferred ones in discrete ordinal scales.

classmethod normalize(data, in_scales=None)

Normalize input data.

Output type is the same as input data type.

Parameters
Returns

normalized data (new object)

Raises

TypeError – if type of arguments are not supported

Return type

Union[Any, Series, Values[QuantitativeScale], CommensurableValues[QuantitativeScale], DataFrame, AdjacencyValueMatrix[QuantitativeScale], PerformanceTable[QuantitativeScale], PartialValueMatrix[QuantitativeScale]]

classmethod transform(data, out_scales, in_scales=None)

Transform input data to new scales.

Output type is the same as input data type.

Parameters
Returns

transformed data (new object)

Raises

TypeError – if type of arguments are not supported

Return type

Union[Any, Series, Values[S], CommensurableValues[S], DataFrame, AdjacencyValueMatrix[S], PerformanceTable[S], PartialValueMatrix[S]]

class Transformer

Bases: ITransformer

This class defines the basic transformer methods.

It uses normalization and denormalization methods to transform values between scales, based on quantitative interval boundaries mapping.

classmethod normalize(data, in_scales=None)

Normalize input data.

Output type is the same as input data type.

Parameters
Returns

normalized data (new object)

Raises

TypeError – if type of arguments are not supported

Return type

Union[Any, Series, Values[QuantitativeScale], CommensurableValues[QuantitativeScale], DataFrame, AdjacencyValueMatrix[QuantitativeScale], PerformanceTable[QuantitativeScale], PartialValueMatrix[QuantitativeScale]]

classmethod transform(data, out_scales, in_scales=None)

Transform input data to new scales.

Output type is the same as input data type.

Parameters
Returns

transformed data (new object)

Raises

TypeError – if type of arguments are not supported

Return type

Union[Any, Series, Values[S], CommensurableValues[S], DataFrame, AdjacencyValueMatrix[S], PerformanceTable[S], PartialValueMatrix[S]]

normalize(data, in_scales=None)

Normalize input data.

Output type is the same as input data type.

Parameters
Returns

normalized data (new object)

Raises

TypeError – if type of arguments are not supported

Return type

Union[Any, Series, Values[QuantitativeScale], CommensurableValues[QuantitativeScale], DataFrame, AdjacencyValueMatrix[QuantitativeScale], PerformanceTable[QuantitativeScale], PartialValueMatrix[QuantitativeScale]]

transform(data, out_scales, in_scales=None)

Transform input data to new scales.

Output type is the same as input data type.

Parameters
Returns

transformed data (new object)

Raises

TypeError – if type of arguments are not supported

Return type

Union[Any, Series, Values[S], CommensurableValues[S], DataFrame, AdjacencyValueMatrix[S], PerformanceTable[S], PartialValueMatrix[S]]