-
Notifications
You must be signed in to change notification settings - Fork 825
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
feat: Add the option to get Feature Contributions in LightGBMBooster used by LightGBMRanker #791
Conversation
…s in LightGBMRanker
b0e881a
to
a191417
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@JoanFM this is very interesting! As someone who was worked a lot on https://github.com/slundberg/shap and https://github.com/interpretml/interpret-community lately, it's very exciting to see this contribution in mmlspark. It would be even more amazing if we could add a spark-based implementation of TreeExplainer that works with the SparkML tree-based models natively. |
51d9e5f
to
148ed60
Compare
(similar to the lime explainer implementation that @mhamilton723 worked on in mmlspark) |
src/main/scala/com/microsoft/ml/spark/lightgbm/LightGBMBooster.scala
Outdated
Show resolved
Hide resolved
148ed60
to
c7f6a3d
Compare
src/main/scala/com/microsoft/ml/spark/lightgbm/LightGBMBooster.scala
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report
@@ Coverage Diff @@
## master #791 +/- ##
===========================================
- Coverage 52.40% 10.30% -42.11%
===========================================
Files 241 185 -56
Lines 9704 8504 -1200
Branches 529 525 -4
===========================================
- Hits 5085 876 -4209
- Misses 4619 7628 +3009
Continue to review full report at Codecov.
|
…d LeafIndex usage
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@imatiach-msft is it normal to have cognitive UnitTests failing or is it just some system unstability? |
probably some system unstability |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
tagging @mhamilton723 for the cognitive test failures |
@mhamilton723 any idea why the cognitive tests are failing? might you be able to take a look? Those test failures seem to be unrelated to this PR. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@JoanFM could you please resolve the conflicts in src/main/scala/com/microsoft/ml/spark/lightgbm/LightGBMBooster.scala? Thank you! |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@JoanFM sorry, could you again resolve the conflicts in src/main/scala/com/microsoft/ml/spark/lightgbm/LightGBMBooster.scala? It's due to the new PR you had which was just merged. Thank you! |
I just did, I was expecting to have conflicts with this set of PRs |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@JoanFM looks like there was some compilation failure: [error] /home/vsts/work/1/s/src/main/scala/com/microsoft/ml/spark/lightgbm/LightGBMBooster.scala:198:24: type mismatch; |
src/main/scala/com/microsoft/ml/spark/lightgbm/LightGBMBooster.scala
Outdated
Show resolved
Hide resolved
@JoanFM I made a suggestion for where the fix needs to be added |
c752543
to
cf092d6
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…used by LightGBMRanker (microsoft#791) * Allow LightGBMRanker to compute features shap * Take featureShapGetter into trait that potentially can be used by other models * Fix data used to be the one for shap and add tests for getShapFeatures in LightGBMRanker * Fix issues with merge conflict resolution * Refactor to share predictForMat and predictForCSR from Score, Shap and LeafIndex usage * Fix compilation issue
feat: This PR tries to add the option to get feature contribution for a given score. For now I applied it to lightGBMRanker but it might be useful for other models, but I am not sure.
test: I have added tests in VerifyLightGBMRanker to ensure the features shap length and results are expected.
Please let me know if you have any doubt or any request for me to change in this PR. I hope you find this PR helpful.