Skip to content
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

Merged
merged 7 commits into from May 4, 2021

Conversation

ivanmkc
Copy link
Contributor

@ivanmkc ivanmkc commented Apr 21, 2021

Waiting for merge of #337

@ivanmkc ivanmkc requested review from dizcology and a team as code owners April 21, 2021 23:34
@ivanmkc ivanmkc requested a review from tmatsuo April 21, 2021 23:34
@product-auto-label product-auto-label bot added api: aiplatform Issues related to the AI Platform API. samples Issues that are directly related to samples. labels Apr 21, 2021
@snippet-bot
Copy link

snippet-bot bot commented Apr 21, 2021

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 21, 2021
@ivanmkc ivanmkc changed the title [WIP] Added explain tabular samples fix: [WIP] Added explain tabular samples Apr 26, 2021
@ivanmkc ivanmkc changed the title fix: [WIP] Added explain tabular samples feat: [WIP] Added explain tabular samples Apr 26, 2021
@ivanmkc ivanmkc force-pushed the imkc--explain-tabular-sample branch from dbdf1dd to 00102be Compare April 30, 2021 23:43
@ivanmkc ivanmkc requested a review from a team as a code owner April 30, 2021 23:43
@ivanmkc ivanmkc changed the base branch from dev to master April 30, 2021 23:44
@ivanmkc ivanmkc requested a review from a team as a code owner April 30, 2021 23:44
@ivanmkc ivanmkc changed the title feat: [WIP] Added explain tabular samples feat: Added explain tabular samples Apr 30, 2021
@ivanmkc ivanmkc force-pushed the imkc--explain-tabular-sample branch from b09cece to 8fb4947 Compare May 3, 2021 21:44
Copy link
Contributor

@vinnysenthil vinnysenthil left a 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.

samples/model-builder/conftest.py Outdated Show resolved Hide resolved
samples/model-builder/conftest.py Outdated Show resolved Hide resolved
samples/model-builder/conftest.py Outdated Show resolved Hide resolved
Comment on lines 32 to 33
for prediction_ in response.predictions:
print(prediction_)
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will add.

@vinnysenthil vinnysenthil requested review from sasha-gitg and removed request for a team and tmatsuo May 3, 2021 22:15
Comment on lines 32 to 33
for prediction_ in response.predictions:
print(prediction_)
Copy link
Member

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(
Copy link
Member

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.

Copy link
Contributor Author

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

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.

Copy link
Contributor

@vinnysenthil vinnysenthil left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Ivan

@ivanmkc ivanmkc merged commit c95d1ce into googleapis:master May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: aiplatform Issues related to the AI Platform API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants