[MRG+1] issue #6532 Add inverse_transform function#6570
Merged
Conversation
inverse_transform function
Member
|
LGTM You can add a test for |
inverse_transform functioninverse_transform function
Contributor
Author
|
Ok, I'd like to add a test by tomorrow. |
add kwargs test
Contributor
Author
|
I have added kwargs test and rebased. |
| X = np.array([1, 4, 9, 16]).reshape((2, 2)) | ||
|
|
||
| # Test that inverse_transform works correctly | ||
| F = FunctionTransformer(func=np.sqrt, inverse_func=lambda x: x**2) |
Member
There was a problem hiding this comment.
This test is okay but we would be more explicitly testing the functionality if we had an inverse_func that was not a true inverse. This test could be passed by a FunctionTransformer that memorised its input. It's pretty minor, but I wouldn't generally test with the most usual case when unusual cases are to be supported.
Contributor
Author
|
Modified. |
Member
|
You might comment that "# this is intentionally not a true inverse!" but yes, looks okay! |
Member
|
Merging! |
mannby
pushed a commit
to mannby/scikit-learn
that referenced
this pull request
Apr 22, 2016
…kit-learn#6570) * [MRG+1] scikit-learn#6532 Add inverse_func argument to FunctionTransformer * modify test:inverse_func is not true inverse
TomDLT
pushed a commit
to TomDLT/scikit-learn
that referenced
this pull request
Oct 3, 2016
…kit-learn#6570) * [MRG+1] scikit-learn#6532 Add inverse_func argument to FunctionTransformer * modify test:inverse_func is not true inverse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
inverse_transformfunction as requested, and writetest_inverse_transformto confirm that it works correctly.