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: enabling AutoML Forecasting training response to include BigQuery location of exported evaluated examples #657

Merged
22 commits merged into from Oct 14, 2021
Merged
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
66b565d
Added BigQuery location of exported evaluated examples from AutoML Fo…
Aug 16, 2021
b899511
Testing BQ uri output feature for AutoML Forecasting
Aug 16, 2021
c225ac7
Testing BQ uri output feature for AutoML Forecasting
Aug 16, 2021
29e32bf
Testing BQ uri output feature for AutoML Forecasting
Aug 16, 2021
4dfb8b9
Testing BQ uri output feature for AutoML Forecasting
Aug 17, 2021
bf869b6
Testing BQ uri output feature for AutoML Forecasting
Aug 17, 2021
fca235b
Testing BQ uri output feature for AutoML Forecasting
Aug 17, 2021
e519e64
Testing BQ uri output feature for AutoML Forecasting
Aug 18, 2021
73bd6b1
Merge branch 'googleapis:master' into master
mansiachuthan Aug 25, 2021
ef03a20
Adding changes from dev to master branch
mansiachuthan Aug 25, 2021
c236824
Merge branch 'master' into master
vinnysenthil Aug 25, 2021
9af9db9
Merge branch 'main' into master
vinnysenthil Aug 30, 2021
31d0622
Removed extra try/except block
mansiachuthan Aug 30, 2021
a8c10bb
Fix lint errors
hardik-vala Aug 31, 2021
dd30216
Address comments
hardik-vala Sep 23, 2021
1e11c5c
Merge branch 'main' into master
sasha-gitg Oct 4, 2021
b1c3e79
Add metadata existence check
hardik-vala Oct 4, 2021
5583190
Merge branch 'master' of https://github.com/mansiachuthan/python-aipl…
hardik-vala Oct 4, 2021
66d3b62
Merge branch 'main' into master
Oct 12, 2021
3d78777
Merge branch 'main' into master
Oct 12, 2021
fed80c6
Merge branch 'main' into master
Oct 12, 2021
cbf044d
Merge branch 'main' into master
vinnysenthil Oct 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 23 additions & 1 deletion google/cloud/aiplatform/training_jobs.py
Expand Up @@ -4119,7 +4119,7 @@ def _run(
labels=model_labels or self._labels,
)

return self._run_job(
new_model = self._run_job(
training_task_definition=training_task_definition,
training_task_inputs=training_task_inputs_dict,
dataset=dataset,
Expand All @@ -4130,6 +4130,14 @@ def _run(
model=model,
)

if export_evaluated_data_items:
_LOGGER.info(
"Exported examples available at:\n%s"
% self.evaluated_data_items_bigquery_uri
)

return new_model

@property
def _model_upload_fail_string(self) -> str:
"""Helper property for model upload failure."""
Expand All @@ -4138,6 +4146,20 @@ def _model_upload_fail_string(self) -> str:
"Model."
)

@property
def evaluated_data_items_bigquery_uri(self) -> Optional[str]:
Copy link
Member

Choose a reason for hiding this comment

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

What are the scenarios where this method:

  1. returns str
  2. returns None
  3. raises ValueError

Copy link

Choose a reason for hiding this comment

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

Updated the method doc string.

"""BigQuery location of exported evaluated examples from the Training Job"""
Copy link
Member

Choose a reason for hiding this comment

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

Raises section.

Copy link

Choose a reason for hiding this comment

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

No longer needed.


self._assert_gca_resource_is_available()

try:
metadata = self._gca_resource.training_task_metadata
return metadata["evaluatedDataItemsBigqueryUri"]
sasha-gitg marked this conversation as resolved.
Show resolved Hide resolved
except (AttributeError, KeyError):
Copy link
Member

Choose a reason for hiding this comment

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

Why both AttributeError and KeyError?

Copy link

Choose a reason for hiding this comment

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

Corrected.

raise ValueError(
"BigQuery URI for evaluated data items does not exist. Must export evaluated data items during training."
)

def _add_additional_experiments(self, additional_experiments: List[str]):
"""Add experiment flags to the training job.
Args:
Expand Down