tfx.orchestration.interactive.interactive_context.InteractiveContext

View source on GitHub

Class InteractiveContext

TFX interactive context for interactive TFX notebook development.

__init__

View source

__init__(
    pipeline_name=None,
    pipeline_root=None,
    metadata_connection_config=None
)

Initialize an InteractiveContext.

Args:

  • pipeline_name: Optional name of the pipeline for ML Metadata tracking purposes. If not specified, a name will be generated for you.
  • pipeline_root: Optional path to the root of the pipeline's outputs. If not specified, an ephemeral temporary directory will be created and used.
  • metadata_connection_config: Optional metadata_store_pb2.ConnectionConfig instance used to configure connection to a ML Metadata connection. If not specified, an ephemeral SQLite MLMD connection contained in the pipeline_root directory with file name "metadata.sqlite" will be used.

Methods

export_to_pipeline

View source

export_to_pipeline(
    *args,
    **kwargs
)

Exports a notebook to a .py file as a runnable pipeline.

The pipeline will be exported to the same directory as the notebook.

Args:

  • notebook_filename: String name of the notebook file, e.g. 'notebook.ipynb'.
  • pipeline_filename: String name for the exported pipeline python file, e.g. 'exported_pipeline.py'. If None, a filename will be generated using notebook_filename.

run

View source

run(
    *args,
    **kwargs
)

Run a given TFX component in the interactive context.

Args:

  • component: Component instance to be run.
  • enable_cache: whether caching logic should be enabled in the driver.

Returns:

execution_result.ExecutionResult object.