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

inserting NULLs for individual feature importance - #361 #379

Merged
merged 3 commits into from
Feb 8, 2018

Conversation

hakoenig
Copy link
Contributor

@hakoenig hakoenig commented Feb 2, 2018

Some classifiers do not support feature importance. For them, we write
Algorithm does not support a standard way to calculate feature importance. into results.feature_importance as feature_name. This leads to problems when trying to write individual feature importance because the feature does not exist in the matrix. This PR checks for the fake feature name and sets the individual importances to Nulls.

Copy link
Contributor

@thcrock thcrock left a comment

Choose a reason for hiding this comment

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

I just have the one change, but also fix the flake8 issues that Travis is complaining about

@@ -154,7 +154,7 @@ def _save_feature_importances(self, model_id, feature_importances, feature_names
model_id=model_id,
feature_importance=0,
feature='Algorithm does not support a standard way' +
'to calculate feature importance.',
' to calculate feature importance.',
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably define this as a constant in one of the files and import it from the other. It would be way too easy for somebody to come in and reformat this line or add a word and break the other check.

@codecov-io
Copy link

Codecov Report

Merging #379 into master will decrease coverage by 0.03%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #379      +/-   ##
==========================================
- Coverage   90.92%   90.88%   -0.04%     
==========================================
  Files          61       61              
  Lines        3648     3655       +7     
==========================================
+ Hits         3317     3322       +5     
- Misses        331      333       +2
Impacted Files Coverage Δ
src/triage/component/catwalk/model_trainers.py 93.66% <100%> (+0.04%) ⬆️
...component/catwalk/individual_importance/uniform.py 89.28% <75%> (-6.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7bfaf85...7dc67b9. Read the comment docs.

@thcrock thcrock merged commit c70ac4c into master Feb 8, 2018
@thcrock thcrock deleted the individual_feature_importance branch February 8, 2018 18:51
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

3 participants