Add inverse boxcox transform functionality to Box Cox Transformer#471
Add inverse boxcox transform functionality to Box Cox Transformer#471solegalli merged 9 commits intofeature-engine:mainfrom SangamSwadiK:add_inv_box_cox_transform
Conversation
|
The code looks great. Thank you! We would have to expand this test to ensure that the inverse_transform returns the desired functionality: Would you be able to do that? For inspiration you could look at how we do it for the LogTransformer here: feature_engine/tests/test_transformation/test_log_transformer.py Lines 8 to 35 in c16e989 |
@solegalli I've added test for inverse transform. Please let me know if changes are required. I'll do it. |
solegalli
left a comment
There was a problem hiding this comment.
thanks a lot for the quick turnaround!
This is almost ready. I should have mentioned before that we need to add the inverse_transform to the docstings of the class.
See for example how we bring the documentation forward for the log transformer using {inverse_transform} here:
feature_engine/feature_engine/transformation/log.py
Lines 64 to 73 in c16e989
which we import from our base docstrings like we do here:
feature_engine/feature_engine/transformation/log.py
Lines 10 to 14 in c16e989
So if you could add the 2 lines of code above and also rephrase the sentence in the inverse_transform method that I point to in a following message, then, this is ready to go!!
Thank you so much!
|
|
||
| def inverse_transform(self, X: pd.DataFrame) -> pd.DataFrame: | ||
| """ | ||
| Apply the inverse BoxCox transformation. |
There was a problem hiding this comment.
Here, for convention we write the following:
Convert the data back to the original representation.
Instead of what you wrote, that makes total sense. It's just that we want to follow scikit-learn conventions.
@solegalli Sorry, I forgot to update the class docs, I've did the changes now. |
|
Thank you @SangamSwadiK ! Merging as we speak :) |
Reference Issues/PRs:
Issue : #449 (Add inverse Boxcox transform functionality)
What does this implement/fix?
Adds an inverse transform method to Boxcox transform
Please let me know if I missed something / did it incorrectly, ill fix it asap.