airflow.providers.google.cloud.hooks.vertex_ai.experiment_service

Classes

ExperimentHook

Use the Vertex AI SDK for Python to manage your experiments.

ExperimentRunHook

Use the Vertex AI SDK for Python to create and manage your experiment runs.

Module Contents

class airflow.providers.google.cloud.hooks.vertex_ai.experiment_service.ExperimentHook(gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.common.hooks.base_google.GoogleBaseHook

Use the Vertex AI SDK for Python to manage your experiments.

create_experiment(experiment_name, location, experiment_description='', project_id=PROVIDE_PROJECT_ID, experiment_tensorboard=None)[source]

Create an experiment and, optionally, associate a Vertex AI TensorBoard instance using the Vertex AI SDK for Python.

Parameters:
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • location (str) – Required. The ID of the Google Cloud location that the service belongs to.

  • experiment_name (str) – Required. The name of the evaluation experiment.

  • experiment_description (str) – Optional. Description of the evaluation experiment.

  • experiment_tensorboard (str | None) – Optional. The Vertex TensorBoard instance to use as a backing TensorBoard for the provided experiment. If no TensorBoard is provided, a default Tensorboard instance is created and used by this experiment.

delete_experiment(experiment_name, location, project_id=PROVIDE_PROJECT_ID, delete_backing_tensorboard_runs=False)[source]

Delete an experiment.

Deleting an experiment deletes that experiment and all experiment runs associated with the experiment. The Vertex AI TensorBoard experiment associated with the experiment is not deleted.

Parameters:
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • location (str) – Required. The ID of the Google Cloud location that the service belongs to.

  • experiment_name (str) – Required. The name of the evaluation experiment.

  • delete_backing_tensorboard_runs (bool) – Optional. If True will also delete the Vertex AI TensorBoard runs associated with the experiment runs under this experiment that we used to store time series metrics.

class airflow.providers.google.cloud.hooks.vertex_ai.experiment_service.ExperimentRunHook(gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

Bases: airflow.providers.google.common.hooks.base_google.GoogleBaseHook

Use the Vertex AI SDK for Python to create and manage your experiment runs.

create_experiment_run(experiment_run_name, experiment_name, location, project_id=PROVIDE_PROJECT_ID, experiment_run_tensorboard=None, run_after_creation=False)[source]

Create experiment run for the experiment.

Parameters:
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • location (str) – Required. The ID of the Google Cloud location that the service belongs to.

  • experiment_name (str) – Required. The name of the evaluation experiment.

  • experiment_run_name (str) – Required. The specific run name or ID for this experiment.

  • experiment_run_tensorboard (str | None) – Optional. A backing TensorBoard resource to enable and store time series metrics logged to this experiment run.

  • run_after_creation (bool) – Optional. Responsible for state after creation of experiment run. If true experiment run will be created with state RUNNING.

list_experiment_runs(experiment_name, location, project_id=PROVIDE_PROJECT_ID)[source]

List experiment run for the experiment.

Parameters:
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • location (str) – Required. The ID of the Google Cloud location that the service belongs to.

  • experiment_name (str) – Required. The name of the evaluation experiment.

update_experiment_run_state(experiment_run_name, experiment_name, location, new_state, project_id=PROVIDE_PROJECT_ID)[source]

Update state of the experiment run.

Parameters:
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • location (str) – Required. The ID of the Google Cloud location that the service belongs to.

  • experiment_name (str) – Required. The name of the evaluation experiment.

  • experiment_run_name (str) – Required. The specific run name or ID for this experiment.

  • new_state (google.cloud.aiplatform.compat.types.execution_v1.Execution.State) – Required. New state of the experiment run.

delete_experiment_run(experiment_run_name, experiment_name, location, project_id=PROVIDE_PROJECT_ID, delete_backing_tensorboard_run=False)[source]

Delete experiment run from the experiment.

Parameters:
  • project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.

  • location (str) – Required. The ID of the Google Cloud location that the service belongs to.

  • experiment_name (str) – Required. The name of the evaluation experiment.

  • experiment_run_name (str) – Required. The specific run name or ID for this experiment.

  • delete_backing_tensorboard_run (bool) – Whether to delete the backing Vertex AI TensorBoard run that stores time series metrics for this run.

Was this entry helpful?