def _compute_inverse_bounds(power_transforms: Dict[(str, PowerTransformer)], tol: float=1e-10) -> Dict[(str, Tuple[(float, float)])]:
    'Computes the image of the transform so we can clip when we untransform.\n\n    The inverse of the Yeo-Johnson transform is given by:\n    if X >= 0 and lambda == 0:\n        X = exp(X_trans) - 1\n    elif X >= 0 and lambda != 0:\n        X = (X_trans * lambda + 1) ** (1 / lambda) - 1\n    elif X < 0 and lambda != 2:\n        X = 1 - (-(2 - lambda) * X_trans + 1) ** (1 / (2 - lambda))\n    elif X < 0 and lambda == 2:\n        X = 1 - exp(-X_trans)\n\n    We can break this down into three cases:\n    lambda < 0:        X < -1 / lambda\n    0 <= lambda <= 2:  X is unbounded\n    lambda > 2:        X > 1 / (2 - lambda)\n\n    Sklearn standardizes the transformed values to have mean zero and standard\n    deviation 1, so we also need to account for this when we compute the bounds.\n    '
    inv_bounds = defaultdict()
    for (k, pt) in power_transforms.items():
        bounds = [(- np.inf), np.inf]
        (mu, sigma) = (pt._scaler.mean_.item(), pt._scaler.scale_.item())
        lambda_ = pt.lambdas_.item()
        if (lambda_ < ((- 1) * tol)):
            bounds[1] = ((((- 1.0) / lambda_) - mu) / sigma)
        elif (lambda_ > (2.0 + tol)):
            bounds[0] = (((1.0 / (2.0 - lambda_)) - mu) / sigma)
        inv_bounds[k] = tuple(checked_cast_list(float, bounds))
    return inv_bounds
Computes the image of the transform so we can clip when we untransform.

The inverse of the Yeo-Johnson transform is given by:
if X >= 0 and lambda == 0:
    X = exp(X_trans) - 1
elif X >= 0 and lambda != 0:
    X = (X_trans * lambda + 1) ** (1 / lambda) - 1
elif X < 0 and lambda != 2:
    X = 1 - (-(2 - lambda) * X_trans + 1) ** (1 / (2 - lambda))
elif X < 0 and lambda == 2:
    X = 1 - exp(-X_trans)

We can break this down into three cases:
lambda < 0:        X < -1 / lambda
0 <= lambda <= 2:  X is unbounded
lambda > 2:        X > 1 / (2 - lambda)

Sklearn standardizes the transformed values to have mean zero and standard
deviation 1, so we also need to account for this when we compute the bounds.
def _compute_inverse_bounds(power_transforms: Dict[(str, PowerTransformer)], tol: float=1e-10) -> Dict[(str, Tuple[(float, float)])]:
    'Computes the image of the transform so we can clip when we untransform.\n\n    The inverse of the Yeo-Johnson transform is given by:\n    if X >= 0 and lambda == 0:\n        X = exp(X_trans) - 1\n    elif X >= 0 and lambda != 0:\n        X = (X_trans * lambda + 1) ** (1 / lambda) - 1\n    elif X < 0 and lambda != 2:\n        X = 1 - (-(2 - lambda) * X_trans + 1) ** (1 / (2 - lambda))\n    elif X < 0 and lambda == 2:\n        X = 1 - exp(-X_trans)\n\n    We can break this down into three cases:\n    lambda < 0:        X < -1 / lambda\n    0 <= lambda <= 2:  X is unbounded\n    lambda > 2:        X > 1 / (2 - lambda)\n\n    Sklearn standardizes the transformed values to have mean zero and standard\n    deviation 1, so we also need to account for this when we compute the bounds.\n    '
    inv_bounds = defaultdict()
    for (k, pt) in power_transforms.items():
        bounds = [(- np.inf), np.inf]
        (mu, sigma) = (pt._scaler.mean_.item(), pt._scaler.scale_.item())
        lambda_ = pt.lambdas_.item()
        if (lambda_ < ((- 1) * tol)):
            bounds[1] = ((((- 1.0) / lambda_) - mu) / sigma)
        elif (lambda_ > (2.0 + tol)):
            bounds[0] = (((1.0 / (2.0 - lambda_)) - mu) / sigma)
        inv_bounds[k] = tuple(checked_cast_list(float, bounds))
    return inv_bounds