The square and cube root transformations are two specific forms of power transformations where the exponents are 1/2 and 1/3, respectively. In this recipe, we will implement square and cube root transformations using NumPy and scikit-learn.
The square root transformation is not defined for negative values, so make sure you only transform those variables whose values are >=0; otherwise, you will introduce NaN or receive an error message.