Is your feature request related to a problem? Please describe.
When you want to apply a logarithmic transformation and data contains a zero value, calculating log(1+x) is more convenient.
Describe the solution you'd like
This could be another argument in LogTransformer that checks for zeros and apply log(1 + x)
from feature_engine import transformation as vt
tf = vt.LogTransformer(variables = ['LotArea', 'GrLivArea'], check_zeros=True)
under the hood basically applies
if check_zeros:
log_1p = True if (X[self.variables_] == 0).any().any() else False
or it can be a separate transformer
from feature_engine import transformation as vt
tf = vt.Log1PTransformer(variables = ['LotArea', 'GrLivArea'], check_zeros=True)
Is your feature request related to a problem? Please describe.
When you want to apply a logarithmic transformation and data contains a zero value, calculating
log(1+x)is more convenient.Describe the solution you'd like
This could be another argument in LogTransformer that checks for zeros and apply
log(1 + x)under the hood basically applies
or it can be a separate transformer