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 default AutoMLTabularTrainingJob column transformations #357
Changes from all commits
c2caaa6
29bcc70
5ce67e2
4b96837
b68e58c
6a0ac30
af0b990
ea5ef12
3300faa
783d2ea
ae5dfa1
332e3e2
9e66508
17e9f37
c4f9d6a
819cda8
c2ece02
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 |
---|---|---|
|
@@ -130,7 +130,6 @@ def __init__( | |
|
||
super().__init__(project=project, location=location, credentials=credentials) | ||
self._display_name = display_name | ||
self._project = project | ||
self._training_encryption_spec = initializer.global_config.get_encryption_spec( | ||
encryption_spec_key_name=training_encryption_spec_key_name | ||
) | ||
|
@@ -2918,10 +2917,31 @@ def _run( | |
|
||
training_task_definition = schema.training_job.definition.automl_tabular | ||
|
||
if self._column_transformations is None: | ||
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. Please log here we are defaulting to auto for all columns as column_transformations was not provided. 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. Makes sense, will add. 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 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. INFO:google.cloud.aiplatform.training_jobs:No column transformations provided, so now retrieving columns from dataset in order to set default column transformations. 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. @sasha-gitg Does this look okay or is it too verbose? 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. I thought it would be nice to show the names so the user can verify the columns. 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. LGTM |
||
_LOGGER.info( | ||
"No column transformations provided, so now retrieving columns from dataset in order to set default column transformations." | ||
) | ||
|
||
column_names = [ | ||
column_name | ||
for column_name in dataset.column_names | ||
if column_name != target_column | ||
] | ||
column_transformations = [ | ||
{"auto": {"column_name": column_name}} for column_name in column_names | ||
] | ||
|
||
_LOGGER.info( | ||
"The column transformation of type 'auto' was set for the following columns: %s." | ||
% column_names | ||
) | ||
else: | ||
column_transformations = self._column_transformations | ||
|
||
training_task_inputs_dict = { | ||
# required inputs | ||
"targetColumn": target_column, | ||
"transformations": self._column_transformations, | ||
"transformations": column_transformations, | ||
"trainBudgetMilliNodeHours": budget_milli_node_hours, | ||
# optional inputs | ||
"weightColumnName": weight_column, | ||
|
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.
These were wrong before