shredx.utils.scaling.inverse_min_max_scale#
- shredx.utils.scaling.inverse_min_max_scale(scaled_tensor: Float[Tensor, '... dim'], original_min_max: tuple[float, float], feature_range: tuple[float, float] = (0, 1)) Float[Tensor, '... dim']#
Invert min-max scaling and recover the original data scale.
This performs the reverse transformation of
min_max_scale()using the original(min, max)values and thefeature_rangeused during scaling.- Parameters:
- scaled_tensorFloat[torch.Tensor, “… dim”]
Tensor that was previously scaled with min-max normalization.
- original_min_maxtuple[float, float]
Tuple
(min, max)values from the original data before scaling.- feature_rangetuple[float, float], optional
Feature range that was used during the original scaling, by default
(0, 1).
- Returns:
- Float[torch.Tensor, “… dim”]
Tensor mapped back to the original scale.
- Raises:
- ValueError
If
feature_rangeis not a tuple of two elements.- ValueError
If
original_min_maxis not a tuple of two elements.