Getting explanations

This guide describes how to get explanations from a Model resource on AI Platform (Unified). You can get explanations in two ways:

  • Online explanations: Synchronous requests to the AI Platform (Unified) API, similar to online predictions that return predictions with feature attributions.

  • Batch explanations: Asynchronous requests to the AI Platform (Unified) API that return predictions with feature attributions. Batch explanations are an optional part of batch prediction requests.

Before you begin

Before getting explanations, you must do the following:

  1. This step differs depending on what type of machine learning model you use:

  2. If you want to get online explanations, deploy the Model that you created in the preceding step to an Endpoint resource.

Getting online explanations

To get online explanations, follow most of the same steps that you would to get online predictions. However, instead of sending a projects.locations.endpoints.predict request to the AI Platform API, send a projects.locations.endpoints.explain request.

The following guides provide detailed instructions for preparing and sending online explanation requests:

Getting batch explanations

To get batch explanations, set the generateExplanation field to true when you create a batch prediction job.

For detailed instructions about preparing and creating batch prediction jobs, read Getting batch predictions.

What's next