I am using SciPy\'s boxcox function to perform a Box-Cox transformation on a continuous variable.
from scipy.stats import boxcox
import numpy as np
y = np.random
In order to inverse the boxcox transformation from scipy.stats.boxcox using scipy.special.inv_boxcox you have to identify the lambda which was generated.
First apply the transformation and print the lambda (ie. param).
df[feature_boxcox], param = stats.boxcox(df[feature])
print('Optimal lambda', param)
Then in order to inverse the transformation you input the generated lambda.
inv_boxcox(df[feature_boxcox], param)