sklearn_transformer#
Source code: sensai/data_transformation/sklearn_transformer.py
- class ManualScaler(centre: Optional[float] = None, scale: Optional[float] = None)[source]#
Bases:
SkLearnTransformerProtocol
A scaler whose parameters are not learnt from data but manually defined
- Parameters:
centre – the value to subtract from all values (if any)
scale – the value with which to scale all values (after removing the centre)
- class SkLearnTransformerFactoryFactory[source]#
Bases:
object
- static StandardScaler(with_mean=True, with_std=True) Callable[[], sklearn.preprocessing.StandardScaler] [source]#
- static RobustScaler(quantile_range=(25, 75), with_scaling=True, with_centering=True) Callable[[], sklearn.preprocessing.RobustScaler] [source]#
- Parameters:
quantile_range – a tuple (a, b) where a and b > a (both in range 0..100) are the percentiles which determine the scaling. Specifically, each value (after centering) is scaled with 1.0/(vb-va) where va and vb are the values corresponding to the percentiles a and b respectively, such that, in the symmetric case where va and vb are equally far from the centre, va will be transformed into -0.5 and vb into 0.5. In a uniformly distributed data set ranging from min to max, the default values of a=25 and b=75 will thus result in min being mapped to -1 and max being mapped to 1.
with_scaling – whether to apply scaling based on quantile_range.
with_centering – whether to apply centering by subtracting the median.
- Returns:
a function, which when called without any arguments, produces the respective RobustScaler instance.
- static ManualScaler(centre: Optional[float] = None, scale: Optional[float] = None) Callable[[], ManualScaler] [source]#
- Parameters:
centre – the value to subtract from all values (if any)
scale – the value with which to scale all values (after removing the centre)
- Returns:
a function, which when called without any arguments, produces the respective scaler instance.