-
Notifications
You must be signed in to change notification settings - Fork 350
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
feat: Added explain tabular samples #348
feat: Added explain tabular samples #348
Conversation
Here is the summary of changes. You are about to add 2 region tags.
This comment is generated by snippet-bot.
|
dbdf1dd
to
00102be
Compare
b09cece
to
8fb4947
Compare
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.
Just one point about showcasing explanations returned on the explain()
call + a few nits.
for prediction_ in response.predictions: | ||
print(prediction_) |
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.
Why the underscore at the end of the var name? Also Endpoint.explain()
returns a high-level Prediction
object that contains predictions
and explanations
(see here). We should probably showcase both. @sasha-gitg thoughts?
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 agree that we should demonstrate that both predictions
and explanations
can get accessed from this object.
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.
Sure, will add.
for prediction_ in response.predictions: | ||
print(prediction_) |
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 agree that we should demonstrate that both predictions
and explanations
can get accessed from this object.
|
||
|
||
# [START aiplatform_sdk_explain_tabular_sample] | ||
def explain_tabular_sample( |
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.
This could be a generic explain sample and doesn't necessarily need to be qualified as tabular.
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.
The sheet has me doing explain_tabular_sample, I assume it's used by the tech writers in such a sample.
|
||
response = endpoint.explain(instances=[instance_dict], parameters={}) | ||
|
||
for explanation in response.explanations: |
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 as GAPIC sample for consistency.
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.
LGTM, thanks Ivan
Waiting for merge of #337