Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update power transformer user guide #759

Merged

Conversation

cmcouto-silva
Copy link
Contributor

Updating the PowerTransformer UserGuide with more text and code examples.

Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.18%. Comparing base (9bc0d43) to head (4c136aa).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #759   +/-   ##
=======================================
  Coverage   98.18%   98.18%           
=======================================
  Files         105      105           
  Lines        4074     4074           
  Branches      795      795           
=======================================
  Hits         4000     4000           
  Misses         29       29           
  Partials       45       45           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -5,66 +5,349 @@
PowerTransformer
================

The :class:`PowerTransformer()` applies power or exponential transformations to numerical
variables.
Power transformations are a family of mathematical functions used to transform numerical variables into a more suitable shape for modeling. The transformation function is typically represented as :math:`x' = x^\\lambda`, where :math:`x` is the original variable and :math:`\\lambda` is the transformation parameter.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @cmcouto-silva thanks for the PR. Could you please break all lines so that they are around 88 characters max?

just need to press enter at the 88 char height and reorganize the text a bit all throughout the document. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

@@ -5,66 +5,349 @@
PowerTransformer
================

The :class:`PowerTransformer()` applies power or exponential transformations to numerical
variables.
Power transformations are a family of mathematical functions used to transform numerical variables into a more suitable shape for modeling. The transformation function is typically represented as :math:`x' = x^\\lambda`, where :math:`x` is the original variable and :math:`\\lambda` is the transformation parameter.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the exponential math function is not rendering as it should. Did you try building the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built it to see the tests, but I haven't checked it rendered yet. I'm checking it now and arranging the fixes. Thx for the heads up!


Most variable transformations, like the logarithm, the reciprocal and the square root, are special cases of power transformations, where the exponent (lambda) is 0, -1 and 0.5, respectively.

You can apply these transformations with :class:`PowerTransformer()`, as we will see later in this page, or through dedicated transformers, like :class:`LogarithmTransformer` and :class:`ReciprocalTransformer`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Logtransformer instead of LogarithmTransformer, that's why it does not link to the corresponding page

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, I'll update the PR soon!

Python example
--------------

:class:`PowerTransformer()` applies power transformations to numerical independent variables. We'll use the Ames House Prices' dataset to see it in action. First, let's load the dataset and split it into train and test sets:

.. code:: python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one : not 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get this. Where should it be one, not 2?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. code: instead of .. code:: I think. This code block is not rendering properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, ok! The error was due to ..code instead of .. code (with space between .. and code). Thx!

@solegalli
Copy link
Collaborator

@cmcouto-silva FYI

Check this PR and we are good to go: cmcouto-silva#2

@solegalli solegalli changed the title Power transformer user guide update power transformer user guide May 14, 2024
@solegalli solegalli merged commit ad0de8c into feature-engine:main May 14, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants