-
Notifications
You must be signed in to change notification settings - Fork 333
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
explain_weights in Pipelines: minimal version #177
Conversation
Codecov Report
@@ Coverage Diff @@
## master #177 +/- ##
=========================================
- Coverage 97.34% 97.3% -0.05%
=========================================
Files 39 41 +2
Lines 2450 2487 +37
Branches 464 469 +5
=========================================
+ Hits 2385 2420 +35
- Misses 34 35 +1
- Partials 31 32 +1
|
eli5/sklearn/transform.py
Outdated
""" | ||
|
||
import numpy as np # type: ignore | ||
from sklearn.pipeline import Pipeline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems # type: ignore
should fix mypy build
Looks good, thanks for the persistence @jnothman! |
@@ -13,3 +13,5 @@ The following functions are exposed to a top level, e.g. | |||
.. autofunction:: eli5.show_weights | |||
|
|||
.. autofunction:: eli5.show_prediction | |||
|
|||
.. autofunction:: eli5.transform_feature_names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not certain this belongs here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was also unsure; do you think this function will be used stand-alone, not as an implementation detail of how to make explain.. / show.. functions work?
It's not an implementation detail insofar as users will need to register
their own implementations as they write their own transformers.
That's not to say that it's likely to be called outside of explain_weights.
…On 2 May 2017 at 20:15, Mikhail Korobov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/source/autodocs/eli5.rst
<#177 (comment)>:
> @@ -13,3 +13,5 @@ The following functions are exposed to a top level, e.g.
.. autofunction:: eli5.show_weights
.. autofunction:: eli5.show_prediction
+
+.. autofunction:: eli5.transform_feature_names
Yeah, I was also unsure; do you think this function will be used
stand-alone, not as an implementation detail of how to make explain.. /
show.. functions work?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#177 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEz671vqj-Q77fv0qjqag7hobJeFpP3ks5r1wJLgaJpZM4NNBx7>
.
|
In any case, documentation, of all things, can change later.
…On 2 May 2017 at 20:19, Joel Nothman ***@***.***> wrote:
It's not an implementation detail insofar as users will need to register
their own implementations as they write their own transformers.
That's not to say that it's likely to be called outside of explain_weights.
On 2 May 2017 at 20:15, Mikhail Korobov ***@***.***> wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In docs/source/autodocs/eli5.rst
> <#177 (comment)>:
>
> > @@ -13,3 +13,5 @@ The following functions are exposed to a top level, e.g.
> .. autofunction:: eli5.show_weights
>
> .. autofunction:: eli5.show_prediction
> +
> +.. autofunction:: eli5.transform_feature_names
>
> Yeah, I was also unsure; do you think this function will be used
> stand-alone, not as an implementation detail of how to make explain.. /
> show.. functions work?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#177 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAEz671vqj-Q77fv0qjqag7hobJeFpP3ks5r1wJLgaJpZM4NNBx7>
> .
>
|
eli5/sklearn/explain_weights.py
Outdated
@@ -422,3 +424,17 @@ def _features(target_id): | |||
method='linear model', | |||
is_regression=True, | |||
) | |||
|
|||
|
|||
@explain_weights.register(Pipeline) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After #170 it should be just @register
, so that it is registered both for global and sklearn-specific explain functions.
Thanks @jnothman! I'm going to make a new release soon - do you want to add anything else to it? |
we'll see how time goes. |
thanks for the review and merge! |
It looks like eli5 had a recent release, so it's a pity to come in late for it. But here's a more minimal version of #158, to which more can be added as it is designed and tested.