bucky.util.power_transforms#

Simple power transformation classes.

Module Contents#

Classes#

BoxCox

Wrapper class for a Box-Cox transformer.

YeoJohnson

Wrapper class for a Yeo-Johnson transformer.

Functions#

boxcox(y, lam, lam2=None)

Box-Cox tranform, batched in the first dimension.

fit_lam(y, yj=False, lam_range=(-2, 2, 0.1))

Fit lambda of a power transform using grid search, taking the the most normally distributed result.

inv_boxcox(y, lam1, lam2)

Inverse Box-Cox tranform, batched in the first dimension.

inv_yeojohnson(y, lam)

Inverse Yeo-Johnson tranform, batched in the first dimension.

norm_cdf(x, mu, sigma)

Normal distribution CDF, batched.

yeojohnson(y, lam)

Yeo-Johnson tranform, batched in the first dimension.

Attributes#

EPS

bucky.util.power_transforms.EPS = 1e-08#
class bucky.util.power_transforms.BoxCox[source]#

Wrapper class for a Box-Cox transformer.

fit(self, y)[source]#

Fit the batched 1d variables in y, store the lambdas for the inv transform.

inv(self, y)[source]#

Inverse tranform using the fitted lambda values.

class bucky.util.power_transforms.YeoJohnson[source]#

Wrapper class for a Yeo-Johnson transformer.

fit(self, y)[source]#

Fit the batched 1d variables in y, store the lambdas for the inv transform.

inv(self, y)[source]#

Inverse tranform using the fitted lambda values.

bucky.util.power_transforms.boxcox(y, lam, lam2=None)[source]#

Box-Cox tranform, batched in the first dimension.

bucky.util.power_transforms.fit_lam(y, yj=False, lam_range=(- 2, 2, 0.1))[source]#

Fit lambda of a power transform using grid search, taking the the most normally distributed result.

bucky.util.power_transforms.inv_boxcox(y, lam1, lam2)[source]#

Inverse Box-Cox tranform, batched in the first dimension.

bucky.util.power_transforms.inv_yeojohnson(y, lam)[source]#

Inverse Yeo-Johnson tranform, batched in the first dimension.

bucky.util.power_transforms.norm_cdf(x, mu, sigma)[source]#

Normal distribution CDF, batched.

bucky.util.power_transforms.yeojohnson(y, lam)[source]#

Yeo-Johnson tranform, batched in the first dimension.