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

docs(samples): replace deprecated fields in create_training_pipeline_tabular_forecasting_sample.py #981

Merged
merged 6 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ def create_training_pipeline_tabular_forecasting_sample(
target_column: str,
time_series_identifier_column: str,
time_column: str,
static_columns: str,
time_variant_past_only_columns: str,
time_variant_past_and_future_columns: str,
forecast_window_end: int,
time_series_attribute_columns: str,
unavailable_at_forecast: str,
available_at_forecast: str,
forecast_horizon: int,
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
Expand All @@ -47,7 +47,7 @@ def create_training_pipeline_tabular_forecasting_sample(
{"auto": {"column_name": "deaths"}},
]

period = {"unit": "day", "quantity": 1}
data_granularity = {"unit": "day", "quantity": 1}

# the inputs should be formatted according to the training_task_definition yaml file
training_task_inputs_dict = {
Expand All @@ -56,13 +56,13 @@ def create_training_pipeline_tabular_forecasting_sample(
"timeSeriesIdentifierColumn": time_series_identifier_column,
"timeColumn": time_column,
"transformations": transformations,
"period": period,
"dataGranularity": data_granularity,
"optimizationObjective": "minimize-rmse",
"trainBudgetMilliNodeHours": 8000,
"staticColumns": static_columns,
"timeVariantPastOnlyColumns": time_variant_past_only_columns,
"timeVariantPastAndFutureColumns": time_variant_past_and_future_columns,
"forecastWindowEnd": forecast_window_end,
"timeSeriesAttributeColumns": time_series_attribute_columns,
"unavailableAtForecast": unavailable_at_forecast,
"availableAtForecast": available_at_forecast,
"forecastHorizon": forecast_horizon,
}

training_task_inputs = json_format.ParseDict(training_task_inputs_dict, Value())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def test_ucaip_generated_create_training_pipeline_sample(capsys, shared_state):
target_column=TARGET_COLUMN,
time_series_identifier_column="county",
time_column="date",
static_columns=["state_name"],
time_variant_past_only_columns=["deaths"],
time_variant_past_and_future_columns=["date"],
forecast_window_end=10,
time_series_attribute_columns=["state_name"],
unavailable_at_forecast=["deaths"],
available_at_forecast=["date"],
forecast_horizon=10,
)

out, _ = capsys.readouterr()
Expand Down