Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG+1] issue #6532 Add inverse_transform function#6570

Merged
MechCoder merged 2 commits into
scikit-learn:masterfrom
facaiy:inverse_func
Apr 12, 2016
Merged

[MRG+1] issue #6532 Add inverse_transform function#6570
MechCoder merged 2 commits into
scikit-learn:masterfrom
facaiy:inverse_func

Conversation

@facaiy
Copy link
Copy Markdown
Contributor

@facaiy facaiy commented Mar 21, 2016

Add inverse_transform function as requested, and write test_inverse_transform to confirm that it works correctly.

@facaiy facaiy changed the title [MRG] issue #6532 [MRG] issue #6532 Add inverse_transform function Mar 23, 2016
@MechCoder
Copy link
Copy Markdown
Member

LGTM

You can add a test for inv_kw_args also

@MechCoder MechCoder changed the title [MRG] issue #6532 Add inverse_transform function [MRG+1] issue #6532 Add inverse_transform function Apr 8, 2016
@facaiy
Copy link
Copy Markdown
Contributor Author

facaiy commented Apr 8, 2016

Ok, I'd like to add a test by tomorrow.

@facaiy
Copy link
Copy Markdown
Contributor Author

facaiy commented Apr 9, 2016

I have added kwargs test and rebased.
If ok, might we merge it?

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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@facaiy
Copy link
Copy Markdown
Contributor Author

facaiy commented Apr 11, 2016

Modified.
is it OK, @jnothman ?

@jnothman
Copy link
Copy Markdown
Member

You might comment that "# this is intentionally not a true inverse!" but yes, looks okay!

@MechCoder
Copy link
Copy Markdown
Member

Merging!

@MechCoder MechCoder merged commit 1d487fb into scikit-learn:master Apr 12, 2016
@facaiy facaiy deleted the inverse_func branch April 12, 2016 08:48
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
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.

3 participants