src.prepro.prepro_v2¶
Version 2 preprocessing mixins that compute scaling parameters without applying them.
These mixins are designed to work with the in-graph scaling architecture where scaling is applied within the PyMC model using pm.Data containers, not during preprocessing.
Module Contents¶
- class src.prepro.prepro_v2.MaxAbsScaleTargetV2(*args, **kwargs)¶
Mixin that computes target scaling parameters without applying them.
This is the v2 version designed for in-graph scaling. It computes the scaling parameters during preprocessing but doesn’t apply them - they are applied later within the PyMC model graph.
- preprocess_target(target: pandas.Series) pandas.Series¶
Computes target scaling parameters without applying them.
- Parameters:
target – The target variable series
- Returns:
The original unscaled target (scaling will be applied in-graph)
- get_target_transformer() sklearn.preprocessing.MaxAbsScaler | None¶
Returns the fitted target transformer for use in inverse transforms.
- get_target_scaling_params() Dict[str, float]¶
Returns the computed target scaling parameters.
- Returns:
Dictionary with ‘scale’ parameter for the target
- class src.prepro.prepro_v2.MaxAbsScaleChannelsV2(*args, **kwargs)¶
Mixin that computes channel scaling parameters without applying them.
This is the v2 version designed for in-graph scaling. It computes the scaling parameters during preprocessing but doesn’t apply them - they are applied later within the PyMC model graph.
- preprocess_features(X: pandas.DataFrame, channel_columns: list | None = None) pandas.DataFrame¶
Computes channel scaling parameters without applying them.
- Parameters:
X – The feature dataframe
channel_columns – List of channel column names
- Returns:
The original unscaled features (scaling will be applied in-graph)
- get_channel_scaling_params() Dict[str, numpy.ndarray]¶
Returns the computed channel scaling parameters.
- Returns:
Dictionary with ‘scale’ parameter array for channels