GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Added explain tabular samples by ivanmkc · Pull Request #348 · googleapis/python-aiplatform

Conversation

@ivanmkc

@ivanmkc ivanmkc commented Apr 21, 2021

Copy link
Copy Markdown
Contributor

Waiting for merge of #337

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ivanmkc
ivanmkc requested review from a team and dizcology 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

snippet-bot Bot commented Apr 21, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 2 region tags.
  • samples/model-builder/explain_tabular_sample.py:20, tag aiplatform_sdk_explain_tabular_sample
  • samples/model-builder/upload_model_explain_tabular_managed_container_sample.py:20, tag aiplatform_sdk_upload_model_explain_tabular_managed_container_sample

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
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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 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 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 added 3 commits May 3, 2021 17:39
@ivanmkc
Added tabular explanation sample
f7b2d9f
@ivanmkc
Cleaned up mocks
76116c7
@ivanmkc
Ran linter
8fb4947
@ivanmkc
ivanmkc force-pushed the imkc--explain-tabular-sample branch from b09cece to 8fb4947 Compare May 3, 2021 21:44
vinnysenthil
vinnysenthil suggested changes May 3, 2021
View reviewed changes

@vinnysenthil vinnysenthil left a comment

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread samples/model-builder/conftest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread samples/model-builder/conftest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread samples/model-builder/conftest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread samples/model-builder/explain_tabular_sample.py Outdated
Comment on lines +32 to +33
for prediction_ in response.predictions:
print(prediction_)

@vinnysenthil vinnysenthil May 3, 2021

Copy link
Copy Markdown
Contributor

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sasha-gitg sasha-gitg May 4, 2021

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ivanmkc ivanmkc May 4, 2021

Copy link
Copy Markdown
Contributor Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vinnysenthil
vinnysenthil requested review from sasha-gitg and removed request for a team and tmatsuo May 3, 2021 22:15
sasha-gitg
sasha-gitg approved these changes May 4, 2021
View reviewed changes
Comment thread samples/model-builder/explain_tabular_sample.py Outdated
Comment on lines +32 to +33
for prediction_ in response.predictions:
print(prediction_)

@sasha-gitg sasha-gitg May 4, 2021

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread samples/model-builder/explain_tabular_sample.py


# [START aiplatform_sdk_explain_tabular_sample]
def explain_tabular_sample(

@sasha-gitg sasha-gitg May 4, 2021

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ivanmkc ivanmkc May 4, 2021

Copy link
Copy Markdown
Contributor Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ivanmkc added 2 commits May 4, 2021 15:01
@ivanmkc
Fixed mock and added explanation printing
70ed28c
@ivanmkc
Added more verbose explanations
8200fce
ivanmkc
ivanmkc commented May 4, 2021
View reviewed changes
Comment thread samples/model-builder/explain_tabular_sample.py

response = endpoint.explain(instances=[instance_dict], parameters={})

for explanation in response.explanations:

@ivanmkc ivanmkc May 4, 2021

Copy link
Copy Markdown
Contributor Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ivanmkc added 2 commits May 4, 2021 15:09
@ivanmkc
Fixed endpoint fixture
e526b5f
@ivanmkc
Fixed linting issues
3d7baa2
vinnysenthil
vinnysenthil approved these changes May 4, 2021
View reviewed changes

@vinnysenthil vinnysenthil left a comment

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@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

Reviewers

@sasha-gitg sasha-gitg sasha-gitg approved these changes
@dizcology dizcology Awaiting requested review from dizcology
+1 more reviewer
@vinnysenthil vinnysenthil vinnysenthil approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

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

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ivanmkc @vinnysenthil @sasha-gitg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.