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

fix: LIME sometimes return NaN weights #1112

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

memoryz
Copy link
Contributor

@memoryz memoryz commented Jul 2, 2021

For categorical variables, if the LIME tabular sampler created samples that do not equal the original value for all simulated samples, we end up with an all zero variable, causing NaN weights. The fix is to simply append the original row as an identity sample to the simulated samples, making sure we don't end up with an all zero variable.

@memoryz
Copy link
Contributor Author

memoryz commented Jul 2, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@memoryz
Copy link
Contributor Author

memoryz commented Jul 2, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented Jul 2, 2021

Codecov Report

Merging #1112 (3c8df62) into master (85f089d) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1112      +/-   ##
==========================================
+ Coverage   85.68%   85.72%   +0.03%     
==========================================
  Files         251      251              
  Lines       11603    11604       +1     
  Branches      600      592       -8     
==========================================
+ Hits         9942     9947       +5     
+ Misses       1661     1657       -4     
Impacted Files Coverage Δ
...a/com/microsoft/ml/spark/explainers/LIMEBase.scala 98.18% <100.00%> (-0.07%) ⬇️
...la/com/microsoft/ml/spark/explainers/Sampler.scala 100.00% <100.00%> (ø)
...om/microsoft/ml/spark/explainers/TabularLIME.scala 95.58% <100.00%> (+0.06%) ⬆️
...microsoft/ml/spark/cognitive/SpeechToTextSDK.scala 90.58% <0.00%> (+0.78%) ⬆️
...a/com/microsoft/ml/spark/io/http/HTTPClients.scala 60.00% <0.00%> (+3.33%) ⬆️

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 85f089d...3c8df62. Read the comment docs.

@memoryz
Copy link
Contributor Author

memoryz commented Jul 2, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@memoryz
Copy link
Contributor Author

memoryz commented Jul 2, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mhamilton723 mhamilton723 merged commit 94f04a8 into microsoft:master Jul 3, 2021
@memoryz memoryz deleted the jasowang/lime_fix branch July 13, 2021 23:22
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

2 participants