Skip to content

Conversation

DvirDukhan
Copy link

No description provided.

Copy link
Contributor

@lantiga lantiga left a 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",
Copy link
Contributor

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."
Copy link
Contributor

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."
Copy link
Contributor

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."
Copy link
Contributor

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."
Copy link
Contributor

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."
Copy link
Contributor

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):
Copy link
Contributor

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."
Copy link
Contributor

Choose a reason for hiding this comment

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

movel -> model

Copy link
Contributor

@lantiga lantiga left a 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

@DvirDukhan DvirDukhan merged commit c85c755 into master Sep 27, 2021
@DvirDukhan DvirDukhan deleted the generic-shapely branch September 27, 2021 13:11
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.

2 participants