min_max_scaling_pair#

caf.cvt.functional_rules.min_max_scaling_pair(risk_data, pairs, feature_range=(0, 100))[source]#

Scale paired columns jointly using Min-Max scaling.

For each tuple (col_current, col_forecast) in pairs, this function computes a single minimum and maximum across the combined values of both columns and applies a shared sklearn.preprocessing.MinMaxScaler with the provided feature_range. This ensures the two columns in each pair are scaled using the same mapping so they are directly comparable.

Parameters:
  • risk_data (pd.DataFrame) – DataFrame containing the columns to be scaled.

  • pairs (list[Tuple[str, str]])) – List of 2-tuples of column names. Each tuple specifies a pair of columns that will share a single scaler.

  • feature_range (Tuple[int, int], optional) – Desired range of the transformed data. Defaults to (0, 100).

Returns:

The original DataFrame with the specified columns scaled in-place.

Return type:

pd.DataFrame