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

explain_weights in Pipelines: minimal version #177

Merged
merged 5 commits into from
May 2, 2017

Conversation

jnothman
Copy link
Contributor

@jnothman jnothman commented May 1, 2017

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.

@codecov-io
Copy link

codecov-io commented May 1, 2017

Codecov Report

Merging #177 into master will decrease coverage by 0.04%.
The diff coverage is 94.59%.

@@            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
Impacted Files Coverage Δ
eli5/sklearn/explain_weights.py 100% <100%> (ø) ⬆️
eli5/sklearn/transform.py 100% <100%> (ø)
eli5/sklearn/__init__.py 100% <100%> (ø) ⬆️
eli5/__init__.py 83.33% <100%> (+0.57%) ⬆️
eli5/transform.py 66.66% <66.66%> (ø)

"""

import numpy as np # type: ignore
from sklearn.pipeline import Pipeline
Copy link
Contributor

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

@kmike
Copy link
Contributor

kmike commented May 1, 2017

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
Copy link
Contributor Author

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

Copy link
Contributor

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?

@jnothman
Copy link
Contributor Author

jnothman commented May 2, 2017 via email

@jnothman
Copy link
Contributor Author

jnothman commented May 2, 2017 via email

@@ -422,3 +424,17 @@ def _features(target_id):
method='linear model',
is_regression=True,
)


@explain_weights.register(Pipeline)
Copy link
Contributor

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.

@kmike kmike merged commit 4395be7 into TeamHG-Memex:master May 2, 2017
@kmike
Copy link
Contributor

kmike commented May 2, 2017

Thanks @jnothman! I'm going to make a new release soon - do you want to add anything else to it?

@jnothman
Copy link
Contributor Author

jnothman commented May 2, 2017

we'll see how time goes.

@jnothman
Copy link
Contributor Author

jnothman commented May 2, 2017

thanks for the review and merge!

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