transformers
This module gathers all classes and methods used to transform data to new scales.
- class ITransformer
Bases:
ABC
This abstract class describes a generic transformer class.
- classmethod normalize(data: Any, in_scales: Scale) Any
- classmethod normalize(data: Series, in_scales: Union[Mapping[Any, Scale], Scale]) Series
- classmethod normalize(data: CommensurableValues) CommensurableValues[QuantitativeScale]
- classmethod normalize(data: Values) Values[QuantitativeScale]
- classmethod normalize(data: DataFrame, in_scales: Union[Mapping[Any, Scale], Scale]) DataFrame
- classmethod normalize(data: AdjacencyValueMatrix) AdjacencyValueMatrix[QuantitativeScale]
- classmethod normalize(data: PerformanceTable) PerformanceTable[QuantitativeScale]
- classmethod normalize(data: PartialValueMatrix) PartialValueMatrix[QuantitativeScale]
Normalize input data.
Output type is the same as input data type.
- Parameters
data –
in_scales – input scales (must be used when data doesn’t have scales attribute)
- Returns
normalized data (new object)
- Raises
TypeError – if type of arguments are not supported
- classmethod transform(data: Any, out_scales: S, in_scales: Scale) Any
- classmethod transform(data: Series, out_scales: Union[S, Mapping[Any, S]], in_scales: Union[Scale, Mapping[Any, Scale]]) Series
- classmethod transform(data: CommensurableValues, out_scales: S) CommensurableValues[S]
- classmethod transform(data: Values, out_scales: Union[S, Mapping[Any, S]]) Values[S]
- classmethod transform(data: DataFrame, out_scales: Union[S, Mapping[Any, S]], in_scales: Union[Scale, Mapping[Any, Scale]]) DataFrame
- classmethod transform(data: AdjacencyValueMatrix, out_scales: S) AdjacencyValueMatrix[S]
- classmethod transform(data: PerformanceTable, out_scales: Union[S, Mapping[Any, S]]) PerformanceTable[S]
- classmethod transform(data: PartialValueMatrix, out_scales: Union[S, Mapping[Any, S]]) PartialValueMatrix[S]
Transform input data to new scales.
Output type is the same as input data type.
- Parameters
data –
out_scales – output scales
in_scales – input scales (must be used when data doesn’t have scales attribute)
- Returns
transformed data (new object)
- Raises
TypeError – if type of arguments are not supported
- normalize(data, in_scales=None)
Normalize input data.
Output type is the same as input data type.
- Parameters
data (Union[Any, Series, Values, CommensurableValues, DataFrame, AdjacencyValueMatrix, PerformanceTable, PartialValueMatrix]) –
in_scales (Optional[Union[Mapping[Any, Scale], Scale]]) – input scales (must be used when data doesn’t have scales attribute)
- 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
data (Union[Any, Series, Values, CommensurableValues, DataFrame, AdjacencyValueMatrix, PerformanceTable, PartialValueMatrix]) –
out_scales (Union[S, Mapping[Any, S]]) – output scales
in_scales (Optional[Union[Mapping[Any, Scale], Scale]]) – input scales (must be used when data doesn’t have scales attribute)
- 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]]