-
Notifications
You must be signed in to change notification settings - Fork 16
Generic shapely values #26
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
Conversation
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.
Looks good! Basically only a few descriptions to update
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"In this example we develop a small fraud detection model for credit card transactions based on XGBoost, export it to TorchScript using Hummingbird (https://github.com/microsoft/hummingbird) and run Shapley Value Sampling explanations (see https://captum.ai/api/shapley_value_sampling.html for reference) on it, also exported to TorchScript.\n", |
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.
I would change the description, since now the journey is different
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"We are interested to explore are casesof fraud, so we extract them from the test set." |
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.
Typos: "We are interested to explore cases of fraud"
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"At this point we can load the models we exported into RedisAI and serve them from there. After making sure RedisAI is running, we initialize the client." |
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.
Update text to reflect the fact that the explainer is a script now.
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"We read the model and the explainer from the saved TorchScript." |
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.
Same
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"We load both models into RedisAI." |
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.
Same
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"All, set, it's now test time. We reuse our `X_test_fraud` NumPy array we created previously. We set it, run both models, and get predictions and explanations as arrays." |
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.
Same
n_samples = int(args[0]) | ||
number_of_outputs = int(args[1]) | ||
output_tensor_index = int(args[2]) | ||
if(len(args)==4): |
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.
formatting
if len(args) == 4:
"metadata": {}, | ||
"source": [ | ||
"We load both models into RedisAI." | ||
"We load both movel and script into RedisAI." |
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.
movel -> model
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.
Fix file name torch_shapely.py
-> torch_shapley.py
No description provided.