This page shows you how to train a forecast model from a tabular
dataset using either the Google Cloud console or the Agent Platform API.

## Before you begin

Before you train a forecast model, complete the following:

- [Prepare your training data](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/prepare-data.md.txt)
- [Create an Agent Platform dataset](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/create-dataset.md.txt)

## Train a model

### Google Cloud console

1. In the Google Cloud console, in the Agent Platform section, go to
   the **Datasets** page.

   [Go to the Datasets page](https://console.cloud.google.com/agent-platform/datasets)
2. Click the name of the dataset you want to use to train your model to open
   its details page.

3. If your data type uses annotation sets, select the annotation set you want
   to use for this model.

4. Click **Train new model**.

5. Select **Other**.

6. In the **Training method** page, configure the following:


   1. Select the model training method. To learn more, see [Model training methods](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#training-methods).

   2. Click **Continue**.

   <br />

7. In the **Model details** page, configure the following:


   1. Enter the display name for your new model.

   2. Select your target column.

      The target column is the value that the model will forecast.
      Learn more about
      [target column requirements](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/prepare-data.md.txt#data-structure).
   3. If you did not set your
      [**Series identifier** and **Timestamp** columns](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/prepare-data.md.txt#data-structure)
      on your dataset, select them now.

   4. Select your **Data granularity** . Select `Daily` if you would like to use
      holiday effect modeling. [Learn how to choose the data granularity](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/bp-tabular.md.txt#granularity).

   5. **Optional** : In the **Holiday regions** dropdown, choose one or more
      geographical regions to enable holiday effect modeling. During training,
      Agent Platform creates holiday categorical features within the model
      based on the date from the **Timestamp** column and the specified
      geographical regions. You can select this option only when **Data granularity**
      is set to `Daily`. By default, holiday effect modeling is disabled. To
      learn about the geographical regions used for holiday effect modeling, see
      [Holiday regions](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#holiday-regions).

   6. Enter your **Context window** and **Forecast horizon**.


      The forecast horizon determines how far into the future the model
      forecasts the target value for each row of inference data.
      The **Forecast horizon** is specified in units of **Data granularity**.


      The context window sets how far back the model looks during
      training (and for forecasts). In other words, for each training datapoint,
      the context window determines how far back the model looks for predictive
      patterns.
      The **Context window** is specified in units of **Data granularity**.

      [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#forecast-window).
   7. If you would like to export your test dataset to BigQuery,
      check **Export test dataset to BigQuery** and provide the name of
      the table.

   8. If you want to manually control your data split or configure the forecasting
      window, open the **Advanced options**.

   9. The default data split is chronological, with the standard 80/10/10
      percentages. If you would like to manually specify which rows are assigned
      to which split, select **Manual** and specify your Data split column.

      Learn more about
      [data splits](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/data-splits.md.txt).
   10. Select a rolling window strategy for forecast window
       generation. The default strategy is **Count**.

       - **Count**: Set the value for the maximum number of windows in the textbox provided.
       - **Stride**: Set the value of the stride length in the textbox provided.
       - **Column**: Select the appropriate column name from the dropdown provided.

       To learn more, see [Rolling window strategies](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#rolling_window_strategies).
   11. Click **Continue**.

   <br />

8. In the **Training options** page, configure the following:


   1. If you haven't already, click **Generate statistics**.

      Generating statistics populates the **Transformation** dropdown
      menus.
   2. Review your column list and exclude any
      columns from training that should not be used to train the model.

      If you are using a data split column, it should be included.
   3. Review the transformations selected for your included features and make any
      required updates.

      Rows containing data that is invalid for the selected transformation
      are excluded from training. Learn more about
      [transformations](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/datasets/data-types-tabular.md.txt#transformations).
   4. For each column you included for training, specify the **Feature type** for
      how that feature relates to its time series, and whether it is available
      at forecast time. Learn more about
      [feature type and availability](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#feature-type).

   5. If you want to specify a weight column, change your optimization
      objective from the default, or enable hierarchical forecasting, open
      **Advanced options**.

   6. **Optional** . If you want to specify a weight column, select it from
      the dropdown list. Learn more about
      [weight columns](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/prepare-data.md.txt#weight).

   7. **Optional** . If you want to select the optimization objective, select it
      from the list. Learn more
      [optimization objectives](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#optimization-objectives).

   8. **Optional** . If you want to use hierarchical forecasting, select **Enable
      hierarchical forecasting**. You can choose between three grouping options:

      - `No grouping`
      - `Group by columns`
      - `Group all`

      You can also choose to set the following aggregate loss weights:
      - `Group total weight`. This field can be set only if you select the `Group by columns` or the `Group all` option.
      - `Temporal total weight`.
      - `Group temporal total weight`. This field can be set only if you select the `Group by columns` or the `Group all` option.

      Learn more about
      [hierarchical forecasting](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/hierarchical.md.txt).
   9. Click **Continue**.

   <br />

9. In the **Compute and pricing** page, configure the following:


   1. Enter the maximum number of hours you want your model to train for. This
      setting helps you put a cap on the training costs. The actual
      time elapsed can be longer than this value, because there are other
      operations involved in creating a new model.

      Suggested training time is related to the size of your forecast horizon
      and your training data.
      The table below provides some sample forecasting training runs, and the
      range of training time that was needed to train a high-quality model.

      | Rows | Features | Forecast horizon | Training time |
      |---|---|---|---|
      | 12 million | 10 | 6 | 3-6 hours |
      | 20 million | 50 | 13 | 6-12 hours |
      | 16 million | 30 | 365 | 24-48 hours |

      For information about training pricing, see the
      [pricing page](https://cloud.google.com/products/gemini-enterprise-agent-platform/pricing#tabular-data).
   2.
      Click **Start Training**.

      Model training can take many hours, depending on the size and complexity of your
      data and your training budget, if you specified one. You can close this tab and
      return to it later. You will receive an email when your model has completed
      training.

      <br />


      > [!NOTE]
      > Tabular training data in Cloud Storage or BigQuery is not imported into Agent Platform. (When you import from local files, they are imported into Cloud Storage.) When you create a dataset with tabular data, the data is associated with the dataset. Changes you make to your data source in Cloud Storage or BigQuery after dataset creation are incorporated into models subsequently trained with that dataset. A snapshot of the dataset is taken when model training begins.

      <br />

   <br />

### API

> [!NOTE]
> Tabular training data in Cloud Storage or BigQuery is not imported into Agent Platform. (When you import from local files, they are imported into Cloud Storage.) When you create a dataset with tabular data, the data is associated with the dataset. Changes you make to your data source in Cloud Storage or BigQuery after dataset creation are incorporated into models subsequently trained with that dataset. A snapshot of the dataset is taken when model training begins.

Select a tab for your language or environment:

### REST


You use the
[trainingPipelines.create](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest/v1/projects.locations.trainingPipelines/create.md.txt) command
to train a model.


Before using any of the request data,
make the following replacements:

- <var translate="no">LOCATION</var>: Your region.
- <var translate="no">PROJECT</var>: Your [project ID](https://docs.cloud.google.com/resource-manager/docs/creating-managing-projects.md.txt#identifiers).
- <var translate="no">TRAINING_PIPELINE_DISPLAY_NAME</var>: Display name for the training pipeline created for this operation.
- <var translate="no">TRAINING_TASK_DEFINITION</var>: The model training method.
  - Time series Dense Encoder (TiDE)  
    `gs://google-cloud-aiplatform/schema/trainingjob/definition/time_series_dense_encoder_forecasting_1.0.0.yaml`
  - Temporal Fusion Transformer (TFT)  
    `gs://google-cloud-aiplatform/schema/trainingjob/definition/temporal_fusion_transformer_time_series_forecasting_1.0.0.yaml`
  - AutoML (L2L)  
    `gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_forecasting_1.0.0.yaml`
  - Seq2Seq+  
    `gs://google-cloud-aiplatform/schema/trainingjob/definition/seq2seq_plus_time_series_forecasting_1.0.0.yaml`

  To learn more, see [Model training methods](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#training-methods).
- <var translate="no">TARGET_COLUMN</var>: The column (value) you want this model to predict.
- <var translate="no">TIME_COLUMN</var>: The time column. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/prepare-data.md.txt#data-structure).
- <var translate="no">TIME_SERIES_IDENTIFIER_COLUMN</var>: The time series identifier column. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/prepare-data.md.txt#data-structure).
- <var translate="no">WEIGHT_COLUMN</var>: (Optional) The weight column. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/prepare-data.md.txt#weight).
- <var translate="no">TRAINING_BUDGET</var>: The maximum amount of time you want the model to train, in milli node hours (1,000 milli node hours equals one node hour).
- <var translate="no">GRANULARITY_UNIT</var>: The unit to use for the granularity of your training data and your forecast horizon and context window. Can be `minute`, `hour`, `day`, `week`, `month`, or `year`. Select `day` if you would like to use holiday effect modeling. [Learn how to choose the data granularity](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/bp-tabular.md.txt#granularity).
- <var translate="no">GRANULARITY_QUANTITY</var>: The number of granularity units that make up the interval between observations in your training data. Must be one for all units except minutes, which can be 1, 5, 10, 15, or 30. [Learn how to choose the data granularity](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/bp-tabular.md.txt#granularity).
- <var translate="no">GROUP_COLUMNS</var>: Column names in your training input table that identify the grouping for the hierarchy level. The column(s) must be \`time_series_attribute_columns\`. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/hierarchical.md.txt).
- <var translate="no">GROUP_TOTAL_WEIGHT</var>: Weight of the group aggregated loss relative to the individual loss. Disabled if set to \`0.0\` or is not set. If the group column is not set, all time series will be treated as part of the same group and is aggregated over all time series. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/hierarchical.md.txt).
- <var translate="no">TEMPORAL_TOTAL_WEIGHT</var>: Weight of the time aggregated loss relative to the individual loss. Disabled if set to \`0.0\` or is not set. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/hierarchical.md.txt).
- <var translate="no">GROUP_TEMPORAL_TOTAL_WEIGHT</var>: Weight of the total (group x time) aggregated loss relative to the individual loss. Disabled if set to \`0.0\` or is not set. If the group column is not set, all time series will be treated as part of the same group and is aggregated over all time series. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/hierarchical.md.txt).
- <var translate="no">HOLIDAY_REGIONS</var>: (Optional) You can select one or more geographical regions to enable holiday effect modeling. During training, Agent Platform creates holiday categorical features within the model based on the date from <var translate="no">TIME_COLUMN</var> and the specified geographical regions. To enable it, set <var translate="no">GRANULARITY_UNIT</var> to `day` and specify one or more regions in the <var translate="no">HOLIDAY_REGIONS</var> field. By default, holiday effect modeling is disabled. To learn more, see [Holiday regions](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#holiday-regions).
- <var translate="no">FORECAST_HORIZON</var>: The forecast horizon determines how far into the future the model forecasts the target value for each row of inference data. The forecast horizon is specified in units of data granularity (<var translate="no">GRANULARITY_UNIT</var>). [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#forecast-window).
- <var translate="no">CONTEXT_WINDOW</var>: The context window sets how far back the model looks during training (and for forecasts). In other words, for each training datapoint, the context window determines how far back the model looks for predictive patterns. The context window is specified in units of data granularity (<var translate="no">GRANULARITY_UNIT</var>). [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#forecast-window).
- <var translate="no">OPTIMIZATION_OBJECTIVE</var>: By default, Agent Platform minimizes the root-mean-squared error (RMSE). If you want a different optimization objective for your forecast model, choose one of the options in [Optimization objectives for forecast models](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#optimization-objectives). If you choose to minimize the quantile loss, you must also specify a value for <var translate="no">QUANTILES</var>.
- <var translate="no">PROBABILISTIC_INFERENCE</var>: (Optional) If set to `true`, Agent Platform models the probability distribution of the forecast. Probabilistic inference can improve model quality by handling noisy data and quantifying uncertainty. If <var translate="no">QUANTILES</var> are specified, then Agent Platform also returns the quantiles of the probability distribution. Probabilistic inference is compatible only with the `Time series Dense Encoder (TiDE)` and the `AutoML (L2L)` training methods. It is incompatible with hierarchical forecasting and the `minimize-quantile-loss` optimization objective.
- <var translate="no">QUANTILES</var>: Quantiles to use for the `minimize-quantile-loss` optimization objective and probabilistic inference. Provide a list of up to five unique numbers between `0` and `1`, exclusive.
- <var translate="no">TIME_SERIES_ATTRIBUTE_COL</var>: The name or names of the columns that are time series attributes. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#feature-type).
- <var translate="no">AVAILABLE_AT_FORECAST_COL</var>: The name or names of the covariate columns whose value is known at forecast time. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#feature-type).
- <var translate="no">UNAVAILABLE_AT_FORECAST_COL</var>: The name or names of the covariate columns whose value is unknown at forecast time. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#feature-type).
- <var translate="no">TRANSFORMATION_TYPE</var>: The transformation type is provided for each column used to train the model. [Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/datasets/data-types-tabular.md.txt#transformations).
- <var translate="no">COLUMN_NAME</var>: The name of the column with the specified transformation type. Every column used to train the model must be specified.
- <var translate="no">MODEL_DISPLAY_NAME</var>: Display name for the newly trained model.
- <var translate="no">DATASET_ID</var>: ID for the training Dataset.
- You can provide a `Split` object to control your data split. For information about controlling data split, see [Control the data split using REST](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/train-model.md.txt#data-split).
- You can provide a `windowConfig` object to configure a rolling window strategy for forecast window generation. For further information, see [Configure the rolling window strategy using REST](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/train-model.md.txt#rolling-window).
- <var translate="no">PROJECT_NUMBER</var>: Your project's automatically generated [project number](https://docs.cloud.google.com/resource-manager/docs/creating-managing-projects.md.txt#identifiers)


HTTP method and URL:

```
POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines
```


Request JSON body:

```
{
    "displayName": "TRAINING_PIPELINE_DISPLAY_NAME",
    "trainingTaskDefinition": "TRAINING_TASK_DEFINITION",
    "trainingTaskInputs": {
        "targetColumn": "TARGET_COLUMN",
        "timeColumn": "TIME_COLUMN",
        "timeSeriesIdentifierColumn": "TIME_SERIES_IDENTIFIER_COLUMN",
        "weightColumn": "WEIGHT_COLUMN",
        "trainBudgetMilliNodeHours": TRAINING_BUDGET,
        "dataGranularity": {"unit": "GRANULARITY_UNIT", "quantity": GRANULARITY_QUANTITY},
        "hierarchyConfig": {"groupColumns": GROUP_COLUMNS, "groupTotalWeight": GROUP_TOTAL_WEIGHT, "temporalTotalWeight": TEMPORAL_TOTAL_WEIGHT, "groupTemporalTotalWeight": GROUP_TEMPORAL_TOTAL_WEIGHT}
        "holidayRegions" : ["HOLIDAY_REGIONS_1", "HOLIDAY_REGIONS_2", ...]
        "forecast_horizon": FORECAST_HORIZON,
        "context_window": CONTEXT_WINDOW,
        "optimizationObjective": "OPTIMIZATION_OBJECTIVE",
        "quantiles": "QUANTILES",
        "enableProbabilisticInference": "PROBABILISTIC_INFERENCE",
        "time_series_attribute_columns": ["TIME_SERIES_ATTRIBUTE_COL_1", "TIME_SERIES_ATTRIBUTE_COL_2", ...]
        "available_at_forecast_columns": ["AVAILABLE_AT_FORECAST_COL_1", "AVAILABLE_AT_FORECAST_COL_2", ...]
        "unavailable_at_forecast_columns": ["UNAVAILABLE_AT_FORECAST_COL_1", "UNAVAILABLE_AT_FORECAST_COL_2", ...]
        "transformations": [
            {"TRANSFORMATION_TYPE_1":  {"column_name" : "COLUMN_NAME_1"} },
            {"TRANSFORMATION_TYPE_2":  {"column_name" : "COLUMN_NAME_2"} },
            ...
    },
    "modelToUpload": {"displayName": "MODEL_DISPLAY_NAME"},
    "inputDataConfig": {
      "datasetId": "DATASET_ID",
    }
}
```

To send your request, expand one of these options:

#### curl (Linux, macOS, or Cloud Shell)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) , or by using [Cloud Shell](https://docs.cloud.google.com/shell/docs.md.txt), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


Save the request body in a file named `request.json`,
and execute the following command:

```
curl -X POST \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d @request.json \
     "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines"
```

#### PowerShell (Windows)

> [!NOTE]
> **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](https://docs.cloud.google.com/sdk/gcloud/reference/init) or [`gcloud auth login`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/login.md.txt) . You can check the currently active account by running [`gcloud auth list`](https://docs.cloud.google.com/sdk/gcloud/reference/auth/list.md.txt).


Save the request body in a file named `request.json`,
and execute the following command:

```
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
    -Method POST `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines" | Select-Object -Expand Content
```

You should receive a JSON response similar to the following:

```
{
  "name": "projects/PROJECT_NUMBER/locations/LOCATION/trainingPipelines/TRAINING_PIPELINE_ID",
  "displayName": "myModelName",
  "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_tabular_1.0.0.yaml",
  "modelToUpload": {
    "displayName": "myModelName"
  },
  "state": "PIPELINE_STATE_PENDING",
  "createTime": "2020-08-18T01:22:57.479336Z",
  "updateTime": "2020-08-18T01:22:57.479336Z"
}
```

### Python

To learn how to install or update the Vertex AI SDK for Python, see [Install the Vertex AI SDK for Python](https://docs.cloud.google.com/vertex-ai/docs/start/use-vertex-ai-python-sdk).

For more information, see the
[Python API reference documentation](https://docs.cloud.google.com/python/docs/reference/aiplatform/latest.md.txt).

    def create_training_pipeline_forecasting_time_series_dense_encoder_sample(
        project: str,
        display_name: str,
        dataset_id: str,
        location: str = "us-central1",
        model_display_name: str = "my_model",
        target_column: str = "target_column",
        time_column: str = "date",
        time_series_identifier_column: str = "time_series_id",
        unavailable_at_forecast_columns: List[str] = [],
        available_at_forecast_columns: List[str] = [],
        forecast_horizon: int = 1,
        data_granularity_unit: str = "week",
        data_granularity_count: int = 1,
        training_fraction_split: float = 0.8,
        validation_fraction_split: float = 0.1,
        test_fraction_split: float = 0.1,
        budget_milli_node_hours: int = 8000,
        timestamp_split_column_name: str = "timestamp_split",
        weight_column: str = "weight",
        time_series_attribute_columns: List[str] = [],
        context_window: int = 0,
        export_evaluated_data_items: bool = False,
        export_evaluated_data_items_bigquery_destination_uri: Optional[str] = None,
        export_evaluated_data_items_override_destination: bool = False,
        quantiles: Optional[List[float]] = None,
        enable_probabilistic_inference: bool = False,
        validation_options: Optional[str] = None,
        predefined_split_column_name: Optional[str] = None,
        sync: bool = True,
    ):
        aiplatform.init(project=project, location=location)

        # Create training job
        forecasting_tide_job = aiplatform.TimeSeriesDenseEncoderForecastingTrainingJob(
            display_name=display_name,
            optimization_objective="minimize-rmse",
        )

        # Retrieve existing dataset
        dataset = aiplatform.TimeSeriesDataset(dataset_id)

        # Run training job
        model = forecasting_tide_job.run(
            dataset=dataset,
            target_column=target_column,
            time_column=time_column,
            time_series_identifier_column=time_series_identifier_column,
            unavailable_at_forecast_columns=unavailable_at_forecast_columns,
            available_at_forecast_columns=available_at_forecast_columns,
            forecast_horizon=forecast_horizon,
            data_granularity_unit=data_granularity_unit,
            data_granularity_count=data_granularity_count,
            training_fraction_split=training_fraction_split,
            validation_fraction_split=validation_fraction_split,
            test_fraction_split=test_fraction_split,
            predefined_split_column_name=predefined_split_column_name,
            timestamp_split_column_name=timestamp_split_column_name,
            weight_column=weight_column,
            time_series_attribute_columns=time_series_attribute_columns,
            context_window=context_window,
            export_evaluated_data_items=export_evaluated_data_items,
            export_evaluated_data_items_bigquery_destination_uri=export_evaluated_data_items_bigquery_destination_uri,
            export_evaluated_data_items_override_destination=export_evaluated_data_items_override_destination,
            quantiles=quantiles,
            enable_probabilistic_inference=enable_probabilistic_inference,
            validation_options=validation_options,
            budget_milli_node_hours=budget_milli_node_hours,
            model_display_name=model_display_name,
            sync=sync,
        )

        model.wait()

        print(model.display_name)
        print(model.resource_name)
        print(model.uri)
        return model

## Control the data split using REST

You control how your training data is split between the training,
validation, and test sets. Use a split column to manually specify the data
split for each row and provide it as part of a `PredefinedSplit`
[`Split` object](https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest/v1/projects.locations.trainingPipelines.md.txt#InputDataConfig) in the
`inputDataConfig` of the JSON request.

<var translate="no">DATA_SPLIT_COLUMN</var> is the column containing the data split values
(`TRAIN`, `VALIDATION`, `TEST`).

```json
"predefinedSplit": {
  "key": DATA_SPLIT_COLUMN
},
```

[Learn more](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/data-splits.md.txt) about data splits.

## Configure the rolling window strategy using REST

Provide a `windowConfig` object to configure a rolling window strategy for
forecast window generation. The default strategy is `maxCount`.

- To use the `maxCount` option, add the following to `trainingTaskInputs` of
  the JSON request. <var translate="no">MAX_COUNT_VALUE</var> refers to the maximum number
  of windows.

  ````json
    "windowConfig": {
      "maxCount": MAX_COUNT_VALUE
    },
    ```
  ````
- To use the `strideLength` option, add the following to `trainingTaskInputs`
  of the JSON request. <var translate="no">STRIDE_LENGTH_VALUE</var> refers to the value of
  the stride length.

  ````json
    "windowConfig": {
      "strideLength": STRIDE_LENGTH_VALUE
    },
    ```
  ````
- To use the `column` option, add the following to `trainingTaskInputs` of
  the JSON request. <var translate="no">COLUMN_NAME</var> refers to the name of the column
  with `True` or `False` values.

  ````json
    "windowConfig": {
      "column": "COLUMN_NAME"
    },
    ```
  ````

To learn more, see [Rolling window strategies](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting-parameters.md.txt#rolling-window-strategies).

## What's next

- [Evaluate your model](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/tabular-data/forecasting/evaluate-model.md.txt).