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
Changes from 16 commits
66b565d
b899511
c225ac7
29e32bf
4dfb8b9
bf869b6
fca235b
e519e64
73bd6b1
ef03a20
c236824
9af9db9
31d0622
a8c10bb
dd30216
1e11c5c
b1c3e79
5583190
66d3b62
3d78777
fed80c6
cbf044d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4315,7 +4315,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, | ||
|
@@ -4326,6 +4326,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.""" | ||
|
@@ -4334,6 +4342,23 @@ def _model_upload_fail_string(self) -> str: | |
"Model." | ||
) | ||
|
||
@property | ||
def evaluated_data_items_bigquery_uri(self) -> Optional[str]: | ||
"""BigQuery location of exported evaluated examples from the Training Job | ||
Returns: | ||
str: BigQuery uri for the exported evaluated examples if the export | ||
feature is enabled for training. | ||
None: If the export feature was not enabled for training. | ||
""" | ||
|
||
self._assert_gca_resource_is_available() | ||
|
||
metadata = self._gca_resource.training_task_metadata | ||
if "evaluatedDataItemsBigqueryUri" in metadata: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Safer to do this: See this issue b/192601601. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
return metadata["evaluatedDataItemsBigqueryUri"] | ||
sasha-gitg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
return None | ||
|
||
def _add_additional_experiments(self, additional_experiments: List[str]): | ||
"""Add experiment flags to the training job. | ||
Args: | ||
|
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.
What are the scenarios where this method:
str
None
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.
Updated the method doc string.