# Transform Skew-Symmetric Data to Gaussian for Machine Learning Problem

I am using a GBM for a regression machine learning problem. I believe one of the assumptions for GBM and most ML algorithms (at least for regression problems) is that the y-variables are normally distributed. a histogram of my y-variables look like this:

If it helps, I can provide the dput() of this vector as well. What are some good transformation functions I can use on my data to have it be more gaussian? and what are some good ways (other than looking at a histogram) to see if the transformation is a good one?

Thanks,

You can use BoxCox transformation for converting skewed distribution to more Gaussian-like. A code excerpt:

from scipy.stats import boxcox, skew

xt, _ = boxcox(x)
x_skew = skew(x)
xt_skew = skew(xt)


You will notice a lower skewness for the transformed data.

• Box-Cox often won’t play if any values are negative. – Nick Cox Jan 25 at 16:41