The ML.TRIAL_INFO function

This document describes theML.TRIAL_INFO function, which lets you displayinformation about trials from a model that useshyperparameter tuning.

You can use this function with models that supporthyperparameter tuning. For moreinformation, seeEnd-to-end user journeys for ML models.

Syntax

ML.TRIAL_INFO(MODEL `PROJECT_ID.DATASET.MODEL_NAME`)

Arguments

ML.TRIAL_INFO takes the following arguments:

  • PROJECT_ID: your project ID.
  • DATASET: the BigQuery dataset thatcontains the model.
  • MODEL_NAME: The name of the model.

Output

ML.TRIAL_INFO returns one row per trial with the following columns:

  • trial_id: anINT64 value that contains the ID assigned to each trial inthe approximate order of trial execution.trial_id values start from1.
  • hyperparameters: aSTRUCT value that contains the hyperparameters used inthe trial.
  • hparam_tuning_evaluation_metrics: aSTRUCT value that contains theevaluation metrics appropriate to the hyperparameter tuning objectivespecified by thehparam_tuning_objectives argumentin theCREATE MODEL statement. Metrics are calculated from the evaluationdata. For more information about the datasets used in hyperparameter tuning,seeData split.
  • training_loss: aFLOAT64 value that contains the loss of the trial duringthe last iteration, calculated using the training data.
  • eval_loss: aFLOAT64 value that contains the loss of the trial during thelast iteration, calculated using the evaluation data.
  • status: aSTRING value that contains the final status of the trial.Possible values include the following:

    • SUCCEEDED: the trial succeeded.
    • FAILED: the trial failed.
    • INFEASIBLE: the trial was not run due to an invalid combination ofhyperparameters.
  • error_message: aSTRING value that contains the error message that isreturned if the trial didn't succeed. For more information, seeError handling.

  • is_optimal: aBOOL value that indicates whether the trial had the bestobjective value. If multiple trials are marked as optimal, then the trialwith the smallesttrial_id value is used as the default trial during modelserving.

Example

The following query retrieves information of all trials for the modelmydataset.mymodel in your default project:

SELECT*FROMML.TRIAL_INFO(MODEL`mydataset.mymodel`)

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.