Skip to content

Commit

Permalink
008 notebook add xai explanation text
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Davidyuk <[email protected]>
  • Loading branch information
igor-davidyuk committed Jul 4, 2024
1 parent 2a83130 commit df88e3a
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions notebooks/008_deploy_project.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,36 @@
"visualizer.show_in_notebook(result)"
]
},
{
"cell_type": "markdown",
"id": "e2ac65ea",
"metadata": {},
"source": [
"And by printing the prediction overview we can look inside the prediction object structure and properties."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f086979f",
"metadata": {},
"outputs": [],
"source": [
"print(prediction.overview)"
]
},
{
"cell_type": "markdown",
"id": "c972e8e4",
"metadata": {},
"source": [
"### Explaining the prediction\n",
"\n",
"If the deployment was created with the `enable_explainable_ai` argument set to `True`, we can also generate an explanation for the prediction. This can be done using the `deployment.explain` method, which does the inference as the `deployment.infer` method, but also generates saliency maps and adds them to `Prediction` object.\n",
"\n",
"Let's generate an explanation for the prediction and visualise it using the `Visualizer` utility class' `explain_label` method."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -214,16 +244,6 @@
"visualizer.show_in_notebook(result)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "10a21c59-bcb7-4645-94ae-ddfcb78775c5",
"metadata": {},
"outputs": [],
"source": [
"print(prediction.overview)"
]
},
{
"cell_type": "markdown",
"id": "ea6ca304-083a-4e93-9008-215b86c6b9d4",
Expand Down

0 comments on commit df88e3a

Please sign in to comment.