DSL¶
tfx.v1.dsl
¶
TFX DSL module.
MODULE | DESCRIPTION |
---|---|
components |
TFX DSL components module. |
experimental |
TFX dsl.experimental module. |
io |
TFX DSL I/O module. |
placeholders |
TFX placeholders module. |
standard_annotations |
Public API for base type annotations. |
CLASS | DESCRIPTION |
---|---|
Artifact |
TFX artifact used for orchestration. |
Channel |
Legacy channel interface. |
Cond |
Cond context manager that disable containing nodes if predicate is False. |
ExecutionMode |
Execution mode of a pipeline. |
Importer |
Definition for TFX Importer. |
Pipeline |
Logical TFX pipeline object. |
Resolver |
Definition for TFX Resolver. |
Classes¶
Artifact
¶
Artifact(mlmd_artifact_type: Optional[ArtifactType] = None)
Bases: Jsonable
TFX artifact used for orchestration.
This is used for type-checking and inter-component communication. Currently,
it wraps a tuple of (ml_metadata.proto.Artifact
,
ml_metadata.proto.ArtifactType
) with additional property accessors for
internal state.
A user may create a subclass of Artifact and override the TYPE_NAME property with the type for this artifact subclass. Users of the subclass may then omit the "type_name" field when construction the object.
A user may specify artifact type-specific properties for an Artifact subclass by overriding the PROPERTIES dictionary, as detailed below.
Note
The behavior of this class is experimental, without backwards compatibility guarantees, and may change in upcoming releases.
Construct an instance of Artifact.
Used by TFX internal implementation: create an empty Artifact with type_name and optional split info specified. The remaining info will be filled in during compiling and running time. The Artifact should be transparent to end users and should not be initiated directly by pipeline users.
PARAMETER | DESCRIPTION |
---|---|
mlmd_artifact_type
|
Proto message defining the underlying ArtifactType. Optional and intended for internal use.
TYPE:
|
METHOD | DESCRIPTION |
---|---|
copy_from |
Set uri, properties and custom properties from a given Artifact. |
from_json_dict |
Convert from dictionary data to an object. |
get_bool_custom_property |
Get a custom property of bool type. |
get_custom_property |
Gets a custom property with key. Return None if not found. |
get_float_custom_property |
Gets a custom property of float type. |
get_int_custom_property |
Get a custom property of int type. |
get_json_value_custom_property |
Get a custom property of JSON type. |
get_proto_custom_property |
Get a custom property of proto type. |
get_string_custom_property |
Get a custom property of string type. |
set_bool_custom_property |
Sets a custom property of bool type. |
set_float_custom_property |
Sets a custom property of float type. |
set_int_custom_property |
Set a custom property of int type. |
set_json_value_custom_property |
Sets a custom property of JSON type. |
set_mlmd_artifact |
Replace the MLMD artifact object on this artifact. |
set_mlmd_artifact_type |
Set entire ArtifactType in this object. |
set_proto_custom_property |
Sets a custom property of proto type. |
set_string_custom_property |
Set a custom property of string type. |
to_json_dict |
Convert from an object to a JSON serializable dictionary. |
ATTRIBUTE | DESCRIPTION |
---|---|
artifact_type |
Type of the underlying mlmd artifact.
|
external_id |
external id of the underlying artifact.
TYPE:
|
id |
Id of the underlying mlmd artifact.
TYPE:
|
is_external |
Returns true if the artifact is external.
TYPE:
|
mlmd_artifact |
Underlying mlmd artifact.
|
name |
Name of the underlying mlmd artifact.
TYPE:
|
pipeline_name |
Name of the pipeline that produce the artifact.
TYPE:
|
producer_component |
Producer component of the artifact.
TYPE:
|
state |
State of the underlying mlmd artifact.
TYPE:
|
type |
Type of the artifact.
|
type_id |
Type id of the underlying mlmd artifact.
TYPE:
|
type_name |
Type name of the underlying mlmd artifact.
|
uri |
Artifact URI.
TYPE:
|
Source code in tfx/types/artifact.py
Attributes¶
pipeline_name
property
writable
¶
pipeline_name: str
Name of the pipeline that produce the artifact.
Functions¶
copy_from
¶
copy_from(other: Artifact)
Set uri, properties and custom properties from a given Artifact.
Source code in tfx/types/artifact.py
from_json_dict
classmethod
¶
Convert from dictionary data to an object.
Source code in tfx/types/artifact.py
get_bool_custom_property
¶
Get a custom property of bool type.
Source code in tfx/types/artifact.py
get_custom_property
¶
Gets a custom property with key. Return None if not found.
Source code in tfx/types/artifact.py
get_float_custom_property
¶
Gets a custom property of float type.
Source code in tfx/types/artifact.py
get_int_custom_property
¶
Get a custom property of int type.
Source code in tfx/types/artifact.py
get_json_value_custom_property
¶
get_json_value_custom_property(key: str) -> JsonValueType
Get a custom property of JSON type.
Source code in tfx/types/artifact.py
get_proto_custom_property
¶
Get a custom property of proto type.
Source code in tfx/types/artifact.py
get_string_custom_property
¶
Get a custom property of string type.
Source code in tfx/types/artifact.py
set_bool_custom_property
¶
set_float_custom_property
¶
Sets a custom property of float type.
set_int_custom_property
¶
set_mlmd_artifact
¶
Replace the MLMD artifact object on this artifact.
Source code in tfx/types/artifact.py
set_mlmd_artifact_type
¶
Set entire ArtifactType in this object.
Source code in tfx/types/artifact.py
set_string_custom_property
¶
to_json_dict
¶
Convert from an object to a JSON serializable dictionary.
Source code in tfx/types/artifact.py
Channel
¶
Channel(type: Type[Artifact], additional_properties: Optional[Dict[str, Property]] = None, additional_custom_properties: Optional[Dict[str, Property]] = None, artifacts: Optional[Iterable[Artifact]] = None, producer_component_id: Optional[str] = None, output_key: Optional[str] = None)
Bases: Jsonable
, BaseChannel
Legacy channel interface.
Channel
used to represent the BaseChannel
concept in the early TFX code,
but due to having too much features in the same class, we refactored it to
multiple classes:
- BaseChannel for the general input abstraction
- OutputChannel for
component.outputs['key']
. - MLMDQueryChannel for simple filter-based input resolution.
Please do not use this class directly, but instead use the alternatives. This class won't be removed in TFX 1.x due to backward compatibility guarantee though.
Initialization of Channel.
PARAMETER | DESCRIPTION |
---|---|
type
|
Subclass of Artifact that represents the type of this Channel. |
additional_properties
|
(Optional) A mapping of properties which will be added to artifacts when this channel is used as an output of components. This is experimental and is subject to change in the future. |
additional_custom_properties
|
(Optional) A mapping of custom_properties which will be added to artifacts when this channel is used as an output of components. This is experimental and is subject to change in the future. |
artifacts
|
Deprecated and ignored, kept only for backward compatibility. |
producer_component_id
|
(Optional) Producer component id of the Channel. This argument is internal/experimental and is subject to change in the future. |
output_key
|
(Optional) The output key when producer component produces the artifacts in this Channel. This argument is internal/experimental and is subject to change in the future. |
METHOD | DESCRIPTION |
---|---|
as_optional |
Creates an optional version of self. |
as_output_channel |
Internal method to derive OutputChannel from the Channel instance. |
from_json_dict |
Convert from dictionary data to an object. |
get |
Returns all artifacts that can be get from this Channel. |
get_data_dependent_node_ids |
Get data dependent nodes of this channel. |
set_artifacts |
Sets artifacts for a static Channel. Will be deprecated. |
to_json_dict |
Convert from an object to a JSON serializable dictionary. |
ATTRIBUTE | DESCRIPTION |
---|---|
is_optional |
If this is an "optional" channel. Changes Pipeline runtime behavior. |
type_name |
Name of the artifact type class that Channel takes.
|
Source code in tfx/types/channel.py
Attributes¶
is_optional
property
¶
If this is an "optional" channel. Changes Pipeline runtime behavior.
Functions¶
as_optional
¶
Creates an optional version of self.
By default component input channels are considered required, meaning if the channel does not contain at least 1 artifact, the component will be skipped. Making channel optional disables this requirement and allows componenst to be executed with no artifacts from this channel.
RETURNS | DESCRIPTION |
---|---|
Self
|
A copy of self which is optional. |
Source code in tfx/types/channel.py
as_output_channel
¶
Internal method to derive OutputChannel from the Channel instance.
Return value (OutputChannel instance) is based on the shallow copy of self, so that any attribute change in one is reflected on the others.
PARAMETER | DESCRIPTION |
---|---|
producer_component
|
A BaseNode instance that is producing this channel.
TYPE:
|
output_key
|
Corresponding node.outputs key for this channel.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
'OutputChannel'
|
An OutputChannel instance that shares attributes with self. |
Source code in tfx/types/channel.py
from_json_dict
classmethod
¶
Convert from dictionary data to an object.
Source code in tfx/types/channel.py
get
¶
Returns all artifacts that can be get from this Channel.
RETURNS | DESCRIPTION |
---|---|
Iterable[Artifact]
|
An artifact collection. |
Source code in tfx/types/channel.py
get_data_dependent_node_ids
¶
Get data dependent nodes of this channel.
Currently only the OutputChannel
directly imposes the data dependency,
but other channels can also indirectly have a data dependency if they depend
on the OutputChannel. Use this abstract method to define transitive data
dependency.
RETURNS | DESCRIPTION |
---|---|
Set[str]
|
A set of data-dependent node IDs. |
set_artifacts
¶
Sets artifacts for a static Channel. Will be deprecated.
Source code in tfx/types/channel.py
to_json_dict
¶
Convert from an object to a JSON serializable dictionary.
Source code in tfx/types/channel.py
Cond
¶
Bases: DslContextManager[None]
Cond context manager that disable containing nodes if predicate is False.
Cond blocks can be nested to express the nested conditions.
Usage:
evaluator = Evaluator(
examples=example_gen.outputs["examples"],
model=trainer.outputs["model"],
eval_config=EvalConfig(...),
)
with Cond(evaluator.outputs["blessing"].future().custom_property("blessed") == 1):
pusher = Pusher(
model=trainer.outputs["model"], push_destination=PushDestination(...)
)
Source code in tfx/dsl/experimental/conditionals/conditional.py
Importer
¶
Importer(source_uri: str, artifact_type: Type[Artifact], reimport: Optional[bool] = False, properties: Optional[Dict[str, Union[str, int]]] = None, custom_properties: Optional[Dict[str, Union[str, int]]] = None, output_key: Optional[str] = None)
Bases: BaseNode
Definition for TFX Importer.
The Importer is a special TFX node which registers an external resource into MLMD so that downstream nodes can use the registered artifact as an input.
Here is an example to use the Importer:
importer = Importer(
source_uri="uri/to/schema",
artifact_type=standard_artifacts.Schema,
reimport=False,
).with_id("import_schema")
schema_gen = SchemaGen(
fixed_schema=importer.outputs["result"],
examples=...,
)
Init function for the Importer.
PARAMETER | DESCRIPTION |
---|---|
source_uri
|
the URI of the resource that needs to be registered.
TYPE:
|
artifact_type
|
the type of the artifact to import. |
reimport
|
whether or not to re-import as a new artifact if the URI has been imported in before. |
properties
|
Dictionary of properties for the imported Artifact. These properties should be ones declared for the given artifact_type (see the PROPERTIES attribute of the definition of the type for details). |
custom_properties
|
Dictionary of custom properties for the imported Artifact. These properties should be of type Text or int. |
output_key
|
The key to use for the imported artifact in the Importer's output dictionary. Defaults to 'result'. |
METHOD | DESCRIPTION |
---|---|
add_downstream_node |
Experimental: Add another component that must run after this one. |
add_downstream_nodes |
Experimental: Add another component that must run after this one. |
add_upstream_node |
Experimental: Add another component that must run before this one. |
add_upstream_nodes |
Experimental: Add components that must run before this one. |
from_json_dict |
Convert from dictionary data to an object. |
to_json_dict |
Convert from an object to a JSON serializable dictionary. |
ATTRIBUTE | DESCRIPTION |
---|---|
id |
Node id, unique across all TFX nodes in a pipeline.
TYPE:
|
outputs |
Output Channel dict that contains imported artifacts. |
Source code in tfx/dsl/components/common/importer.py
Attributes¶
id
property
writable
¶
id: str
Node id, unique across all TFX nodes in a pipeline.
If id
is set by the user, return it directly.
Otherwise, return
RETURNS | DESCRIPTION |
---|---|
str
|
node id. |
Functions¶
add_downstream_node
¶
Experimental: Add another component that must run after this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
It is symmetric with add_upstream_node
.
PARAMETER | DESCRIPTION |
---|---|
downstream_node
|
a component that must run after this node.
|
Source code in tfx/dsl/components/base/base_node.py
add_downstream_nodes
¶
Experimental: Add another component that must run after this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
It is symmetric with add_upstream_nodes
.
PARAMETER | DESCRIPTION |
---|---|
downstream_nodes
|
a list of components that must run after this node.
|
Source code in tfx/dsl/components/base/base_node.py
add_upstream_node
¶
Experimental: Add another component that must run before this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
It is symmetric with add_downstream_node
.
PARAMETER | DESCRIPTION |
---|---|
upstream_node
|
a component that must run before this node.
|
Source code in tfx/dsl/components/base/base_node.py
add_upstream_nodes
¶
Experimental: Add components that must run before this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
PARAMETER | DESCRIPTION |
---|---|
upstream_nodes
|
a list of components that must run before this node.
|
Source code in tfx/dsl/components/base/base_node.py
from_json_dict
classmethod
¶
Convert from dictionary data to an object.
to_json_dict
¶
Convert from an object to a JSON serializable dictionary.
Source code in tfx/dsl/components/base/base_node.py
Pipeline
¶
Pipeline(pipeline_name: str, pipeline_root: Optional[Union[str, Placeholder]] = '', metadata_connection_config: Optional[ConnectionConfigType] = None, components: Iterable[BaseNode] = (), enable_cache: bool = False, beam_pipeline_args: Optional[List[Union[str, Placeholder]]] = None, platform_config: Optional[Message] = None, execution_mode: ExecutionMode = SYNC, inputs: Optional[PipelineInputs] = None, outputs: Optional[Dict[str, OutputChannel]] = None, dsl_context_registry: Optional[DslContextRegistry] = None)
Bases: BaseNode
Logical TFX pipeline object.
Pipeline object represents the DAG of TFX components, which can be run using one of the pipeline orchestration systems that TFX supports. For details, please refer to the guide.
ATTRIBUTE | DESCRIPTION |
---|---|
components |
A deterministic list of logical components of this pipeline, which are deduped and topologically sorted.
|
enable_cache |
Whether or not cache is enabled for this run.
|
metadata_connection_config |
The config to connect to ML metadata.
|
execution_mode |
Execution mode of the pipeline. Currently only support synchronous execution mode.
|
beam_pipeline_args |
Pipeline arguments for Beam powered Components. Use
|
platform_config |
Pipeline level platform config, in proto form.
|
Initialize pipeline.
PARAMETER | DESCRIPTION |
---|---|
pipeline_name
|
Name of the pipeline;
TYPE:
|
pipeline_root
|
Path to root directory of the pipeline. This will most often be just a string. Some orchestrators may have limited support for constructing this from a Placeholder, e.g. a RuntimeInfoPlaceholder that refers to fields from the platform config. pipeline_root is optional only if the pipeline is composed within another parent pipeline, in which case it will inherit its parent pipeline's root. |
metadata_connection_config
|
The config to connect to ML metadata.
TYPE:
|
components
|
Optional list of components to construct the pipeline. |
enable_cache
|
Whether or not cache is enabled for this run.
TYPE:
|
beam_pipeline_args
|
Pipeline arguments for Beam powered Components. |
platform_config
|
Pipeline level platform config, in proto form.
TYPE:
|
execution_mode
|
The execution mode of the pipeline, can be SYNC or ASYNC.
TYPE:
|
inputs
|
Optional inputs of a pipeline.
TYPE:
|
outputs
|
Optional outputs of a pipeline. |
dsl_context_registry
|
DslContextRegistry to use for this pipeline, if not provided then the current context (potentially a new DslContext) will be used.
TYPE:
|
METHOD | DESCRIPTION |
---|---|
add_downstream_node |
Experimental: Add another component that must run after this one. |
add_downstream_nodes |
Experimental: Add another component that must run after this one. |
add_upstream_node |
Experimental: Add another component that must run before this one. |
add_upstream_nodes |
Experimental: Add components that must run before this one. |
from_json_dict |
Convert from dictionary data to an object. |
to_json_dict |
Convert from an object to a JSON serializable dictionary. |
ATTRIBUTE | DESCRIPTION |
---|---|
beam_pipeline_args |
Beam pipeline args used for all components in the pipeline.
|
components |
A deterministic list of logical components that are deduped and topologically sorted.
|
id |
Node id, unique across all TFX nodes in a pipeline.
|
Source code in tfx/orchestration/pipeline.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
|
Attributes¶
beam_pipeline_args
property
¶
Beam pipeline args used for all components in the pipeline.
components
property
writable
¶
A deterministic list of logical components that are deduped and topologically sorted.
id
property
¶
Node id, unique across all TFX nodes in a pipeline.
If id
is set by the user, return it directly.
Otherwise, return
RETURNS | DESCRIPTION |
---|---|
str
|
node id. |
Functions¶
add_downstream_node
¶
Experimental: Add another component that must run after this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
It is symmetric with add_upstream_node
.
PARAMETER | DESCRIPTION |
---|---|
downstream_node
|
a component that must run after this node.
|
Source code in tfx/dsl/components/base/base_node.py
add_downstream_nodes
¶
Experimental: Add another component that must run after this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
It is symmetric with add_upstream_nodes
.
PARAMETER | DESCRIPTION |
---|---|
downstream_nodes
|
a list of components that must run after this node.
|
Source code in tfx/dsl/components/base/base_node.py
add_upstream_node
¶
Experimental: Add another component that must run before this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
It is symmetric with add_downstream_node
.
PARAMETER | DESCRIPTION |
---|---|
upstream_node
|
a component that must run before this node.
|
Source code in tfx/dsl/components/base/base_node.py
add_upstream_nodes
¶
Experimental: Add components that must run before this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
PARAMETER | DESCRIPTION |
---|---|
upstream_nodes
|
a list of components that must run before this node.
|
Source code in tfx/dsl/components/base/base_node.py
from_json_dict
classmethod
¶
Convert from dictionary data to an object.
to_json_dict
¶
Convert from an object to a JSON serializable dictionary.
Source code in tfx/dsl/components/base/base_node.py
Resolver
¶
Resolver(strategy_class: Optional[Type[ResolverStrategy]] = None, config: Optional[Dict[str, JsonableType]] = None, **channels: BaseChannel)
Bases: BaseNode
Definition for TFX Resolver.
Resolver is a special TFX node which handles special artifact resolution logics that will be used as inputs for downstream nodes.
To use Resolver, pass the followings to the Resolver constructor:
- Name of the Resolver instance
- A subclass of ResolverStrategy
- Configs that will be used to construct an instance of ResolverStrategy
- Channels to resolve with their tag, in the form of kwargs
Here is an example:
example_gen = ImportExampleGen(...)
examples_resolver = Resolver(
strategy_class=tfx.dsl.experimental.SpanRangeStrategy,
config={"range_config": range_config},
examples=Channel(
type=Examples,
producer_component_id=example_gen.id,
),
).with_id("Resolver.span_resolver")
trainer = Trainer(
examples=examples_resolver.outputs["examples"],
...,
)
You can find experimental ResolverStrategy
classes under
tfx.v1.dsl.experimental
module, including LatestArtifactStrategy
,
LatestBlessedModelStrategy
, SpanRangeStrategy
, etc.
Init function for Resolver.
PARAMETER | DESCRIPTION |
---|---|
strategy_class
|
Optional
TYPE:
|
config
|
Optional dict of key to Jsonable type for constructing resolver_strategy.
TYPE:
|
**channels
|
Input channels to the Resolver node as keyword arguments.
TYPE:
|
METHOD | DESCRIPTION |
---|---|
add_downstream_node |
Experimental: Add another component that must run after this one. |
add_downstream_nodes |
Experimental: Add another component that must run after this one. |
add_upstream_node |
Experimental: Add another component that must run before this one. |
add_upstream_nodes |
Experimental: Add components that must run before this one. |
from_json_dict |
Convert from dictionary data to an object. |
to_json_dict |
Convert from an object to a JSON serializable dictionary. |
ATTRIBUTE | DESCRIPTION |
---|---|
id |
Node id, unique across all TFX nodes in a pipeline.
TYPE:
|
outputs |
Output Channel dict that contains resolved artifacts. |
Source code in tfx/dsl/components/common/resolver.py
Attributes¶
id
property
writable
¶
id: str
Node id, unique across all TFX nodes in a pipeline.
If id
is set by the user, return it directly.
Otherwise, return
RETURNS | DESCRIPTION |
---|---|
str
|
node id. |
outputs
property
¶
Output Channel dict that contains resolved artifacts.
Functions¶
add_downstream_node
¶
Experimental: Add another component that must run after this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
It is symmetric with add_upstream_node
.
PARAMETER | DESCRIPTION |
---|---|
downstream_node
|
a component that must run after this node.
|
Source code in tfx/dsl/components/base/base_node.py
add_downstream_nodes
¶
Experimental: Add another component that must run after this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
It is symmetric with add_upstream_nodes
.
PARAMETER | DESCRIPTION |
---|---|
downstream_nodes
|
a list of components that must run after this node.
|
Source code in tfx/dsl/components/base/base_node.py
add_upstream_node
¶
Experimental: Add another component that must run before this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
It is symmetric with add_downstream_node
.
PARAMETER | DESCRIPTION |
---|---|
upstream_node
|
a component that must run before this node.
|
Source code in tfx/dsl/components/base/base_node.py
add_upstream_nodes
¶
Experimental: Add components that must run before this one.
This method enables task-based dependencies by enforcing execution order for synchronous pipelines on supported platforms. Currently, the supported platforms are Airflow, Beam, and Kubeflow Pipelines.
Note that this API call should be considered experimental, and may not work with asynchronous pipelines, sub-pipelines and pipelines with conditional nodes. We also recommend relying on data for capturing dependencies where possible to ensure data lineage is fully captured within MLMD.
PARAMETER | DESCRIPTION |
---|---|
upstream_nodes
|
a list of components that must run before this node.
|
Source code in tfx/dsl/components/base/base_node.py
from_json_dict
classmethod
¶
Convert from dictionary data to an object.
to_json_dict
¶
Convert from an object to a JSON serializable dictionary.
Source code in tfx/dsl/components/base/base_node.py
Modules¶
components
¶
TFX DSL components module.
CLASS | DESCRIPTION |
---|---|
AsyncOutputArtifact |
Intermediate artifact object type annotation. |
BeamComponentParameter |
Component parameter type annotation. |
InputArtifact |
Input artifact object type annotation. |
OutputArtifact |
Output artifact object type annotation. |
OutputDict |
Decorator declaring component executor function outputs. |
Parameter |
Component parameter type annotation. |
FUNCTION | DESCRIPTION |
---|---|
component |
Decorator: creates a component from a typehint-annotated Python function. |
Classes¶
BeamComponentParameter
¶
BeamComponentParameter(artifact_type: Type[_BeamPipeline], _init_via_getitem=False)
Bases: _PipelineTypeGeneric
Component parameter type annotation.
Source code in tfx/dsl/component/experimental/annotations.py
InputArtifact
¶
Bases: _ArtifactGeneric
Input artifact object type annotation.
Source code in tfx/dsl/component/experimental/annotations.py
OutputArtifact
¶
Bases: _ArtifactGeneric
Output artifact object type annotation.
Source code in tfx/dsl/component/experimental/annotations.py
OutputDict
¶
Decorator declaring component executor function outputs.
Now @component can understand TypedDict return type annotation as well, so please use a TypedDict instead of using an OutputDict.
Source code in tfx/dsl/component/experimental/annotations.py
Parameter
¶
Bases: _PrimitiveAndProtoTypeGeneric
Component parameter type annotation.
Source code in tfx/dsl/component/experimental/annotations.py
Functions¶
component
¶
component(func: FunctionType) -> BaseFunctionalComponentFactory
component(*, component_annotation: Optional[type[SystemExecution]] = None, use_beam: bool = False) -> Callable[[FunctionType], BaseFunctionalComponentFactory]
component(func: Optional[FunctionType] = None, /, *, component_annotation: Optional[Type[SystemExecution]] = None, use_beam: bool = False) -> Union[BaseFunctionalComponentFactory, Callable[[FunctionType], BaseFunctionalComponentFactory]]
Decorator: creates a component from a typehint-annotated Python function.
This decorator creates a component based on typehint annotations specified for
the arguments and return value for a Python function. The decorator can be
supplied with a parameter component_annotation
to specify the annotation for
this component decorator. This annotation hints which system execution type
this python function-based component belongs to.
Specifically, function arguments can be annotated with the following types and
associated semantics:
Parameter[T]
whereT
isint
,float
,str
, orbool
: indicates that a primitive type execution parameter, whose value is known at pipeline construction time, will be passed for this argument. These parameters will be recorded in ML Metadata as part of the component's execution record. Can be an optional argument.int
,float
,str
,bytes
,bool
,Dict
,List
: indicates that a primitive type value will be passed for this argument. This value is tracked as anInteger
,Float
,String
,Bytes
,Boolean
orJsonValue
artifact (seetfx.types.standard_artifacts
) whose value is read and passed into the given Python component function. Can be an optional argument.InputArtifact[ArtifactType]
: indicates that an input artifact object of typeArtifactType
(deriving fromtfx.types.Artifact
) will be passed for this argument. This artifact is intended to be consumed as an input by this component (possibly reading from the path specified by its.uri
). Can be an optional argument by specifying a default value ofNone
.OutputArtifact[ArtifactType]
: indicates that an output artifact object of typeArtifactType
(deriving fromtfx.types.Artifact
) will be passed for this argument. This artifact is intended to be emitted as an output by this component (and written to the path specified by its.uri
). Cannot be an optional argument.
The return value typehint should be either empty or None
, in the case of a
component function that has no return values, or a TypedDict
of primitive
value types (int
, float
, str
, bytes
, bool
, dict
or list
; or
Optional[T]
, where T is a primitive type value, in which case None
can be
returned), to indicate that the return value is a dictionary with specified
keys and value types.
Note that output artifacts should not be included in the return value
typehint; they should be included as OutputArtifact
annotations in the
function inputs, as described above.
The function to which this decorator is applied must be at the top level of its Python module (it may not be defined within nested classes or function closures).
This is example usage of component definition using this decorator:
from tfx import v1 as tfx
InputArtifact = tfx.dsl.components.InputArtifact
OutputArtifact = tfx.dsl.components.OutputArtifact
Parameter = tfx.dsl.components.Parameter
Examples = tfx.types.standard_artifacts.Examples
Model = tfx.types.standard_artifacts.Model
class MyOutput(TypedDict):
loss: float
accuracy: float
@component(component_annotation=tfx.dsl.standard_annotations.Train)
def MyTrainerComponent(
training_data: InputArtifact[Examples],
model: OutputArtifact[Model],
dropout_hyperparameter: float,
num_iterations: Parameter[int] = 10,
) -> MyOutput:
"""My simple trainer component."""
records = read_examples(training_data.uri)
model_obj = train_model(records, num_iterations, dropout_hyperparameter)
model_obj.write_to(model.uri)
return {"loss": model_obj.loss, "accuracy": model_obj.accuracy}
# Example usage in a pipeline graph definition:
# ...
trainer = MyTrainerComponent(
training_data=example_gen.outputs["examples"],
dropout_hyperparameter=other_component.outputs["dropout"],
num_iterations=1000,
)
pusher = Pusher(model=trainer.outputs["model"])
# ...
When the parameter component_annotation
is not supplied, the default value
is None. This is another example usage with component_annotation
= None:
@component
def MyTrainerComponent(
training_data: InputArtifact[standard_artifacts.Examples],
model: OutputArtifact[standard_artifacts.Model],
dropout_hyperparameter: float,
num_iterations: Parameter[int] = 10,
) -> Output:
"""My simple trainer component."""
records = read_examples(training_data.uri)
model_obj = train_model(records, num_iterations, dropout_hyperparameter)
model_obj.write_to(model.uri)
return {"loss": model_obj.loss, "accuracy": model_obj.accuracy}
When the parameter use_beam
is True, one of the parameters of the decorated
function type-annotated by BeamComponentParameter[beam.Pipeline] and the
default value can only be None. It will be replaced by a beam Pipeline made
with the tfx pipeline's beam_pipeline_args that's shared with other beam-based
components:
@component(use_beam=True)
def DataProcessingComponent(
input_examples: InputArtifact[standard_artifacts.Examples],
output_examples: OutputArtifact[standard_artifacts.Examples],
beam_pipeline: BeamComponentParameter[beam.Pipeline] = None,
) -> None:
"""My simple trainer component."""
records = read_examples(training_data.uri)
with beam_pipeline as p:
...
Experimental: no backwards compatibility guarantees.
PARAMETER | DESCRIPTION |
---|---|
func
|
Typehint-annotated component executor function.
TYPE:
|
component_annotation
|
used to annotate the python function-based component. It is a subclass of SystemExecution from third_party/py/tfx/types/system_executions.py; it can be None. |
use_beam
|
Whether to create a component that is a subclass of BaseBeamComponent. This allows a beam.Pipeline to be made with tfx-pipeline-wise beam_pipeline_args.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Union[BaseFunctionalComponentFactory, Callable[[FunctionType], BaseFunctionalComponentFactory]]
|
An object that:
Today, the returned object is literally a subclass of BaseComponent, so it can be used as a |
RAISES | DESCRIPTION |
---|---|
EnvironmentError
|
if the current Python interpreter is not Python 3. |
Source code in tfx/dsl/component/experimental/decorators.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
|
experimental
¶
TFX dsl.experimental module.
CLASS | DESCRIPTION |
---|---|
LatestArtifactStrategy |
Strategy that resolves the latest n(=1) artifacts per each channel. |
LatestBlessedModelStrategy |
LatestBlessedModelStrategy resolves the latest blessed Model artifact. |
ResolverStrategy |
Base class for ResolverStrategy. |
RuntimeParameter |
Runtime parameter. |
SpanRangeStrategy |
SpanRangeStrategy resolves artifacts based on "span" property. |
FUNCTION | DESCRIPTION |
---|---|
create_container_component |
Creates a container-based component. |
Classes¶
LatestArtifactStrategy
¶
Bases: ResolverStrategy
Strategy that resolves the latest n(=1) artifacts per each channel.
Note that this ResolverStrategy is experimental and is subject to change in terms of both interface and implementation.
Don't construct LatestArtifactStrategy directly, example usage:
model_resolver.outputs['model']
model_resolver = Resolver(
strategy_class=LatestArtifactStrategy,
model=Channel(type=Model),
).with_id("latest_model_resolver")
model_resolver.outputs["model"]
METHOD | DESCRIPTION |
---|---|
resolve_artifacts |
Resolves artifacts from channels by querying MLMD. |
Source code in tfx/dsl/input_resolution/strategies/latest_artifact_strategy.py
resolve_artifacts
¶resolve_artifacts(store: MetadataStore, input_dict: Dict[str, List[Artifact]]) -> Optional[Dict[str, List[Artifact]]]
Resolves artifacts from channels by querying MLMD.
PARAMETER | DESCRIPTION |
---|---|
store
|
An MLMD MetadataStore object.
TYPE:
|
input_dict
|
The input_dict to resolve from. |
RETURNS | DESCRIPTION |
---|---|
Optional[Dict[str, List[Artifact]]]
|
If |
Source code in tfx/dsl/input_resolution/strategies/latest_artifact_strategy.py
LatestBlessedModelStrategy
¶
Bases: ResolverStrategy
LatestBlessedModelStrategy resolves the latest blessed Model artifact.
Note that this ResolverStrategy is experimental and is subject to change in terms of both interface and implementation.
Don't construct LatestBlessedModelStrategy directly, example usage:
model_resolver.outputs['model']
model_resolver = Resolver(
strategy_class=LatestBlessedModelStrategy,
model=Channel(type=Model),
model_blessing=Channel(type=ModelBlessing),
).with_id("latest_blessed_model_resolver")
model_resolver.outputs["model"]
METHOD | DESCRIPTION |
---|---|
resolve_artifacts |
Resolves artifacts from channels by querying MLMD. |
resolve_artifacts
¶resolve_artifacts(store: MetadataStore, input_dict: Dict[str, List[Artifact]]) -> Optional[Dict[str, List[Artifact]]]
Resolves artifacts from channels by querying MLMD.
PARAMETER | DESCRIPTION |
---|---|
store
|
An MLMD MetadataStore object.
TYPE:
|
input_dict
|
The input_dict to resolve from. |
RETURNS | DESCRIPTION |
---|---|
Optional[Dict[str, List[Artifact]]]
|
The latest blessed Model and its corresponding ModelBlessing, respectively in the same input channel they were contained to. |
RAISES | DESCRIPTION |
---|---|
RuntimeError
|
if input_dict contains unsupported artifact types. |
Source code in tfx/dsl/input_resolution/strategies/latest_blessed_model_strategy.py
ResolverStrategy
¶
Bases: ABC
Base class for ResolverStrategy.
ResolverStrategy is used with
tfx.dsl.Resolver
to express the input resolution logic. Currently TFX supports the following
builtin ResolverStrategy:
A resolver strategy defines a type behavior used for input selection. A
resolver strategy subclass must override the resolve_artifacts()
function
which takes a Dict[str, List[Artifact]] as parameters and returns the resolved
dict of the same type.
METHOD | DESCRIPTION |
---|---|
resolve_artifacts |
Resolves artifacts from channels, optionally querying MLMD if needed. |
resolve_artifacts
abstractmethod
¶resolve_artifacts(store: MetadataStore, input_dict: Dict[str, List[Artifact]]) -> Optional[Dict[str, List[Artifact]]]
Resolves artifacts from channels, optionally querying MLMD if needed.
In asynchronous execution mode, resolver classes may composed in sequence where the resolve_artifacts() result from the previous resolver instance would be passed to the next resolver instance's resolve_artifacts() inputs.
If resolve_artifacts() returns None, it is considered as "no inputs available", and the remaining resolvers will not be executed.
Also if resolve_artifacts() omits any key from the input_dict it will not be available from the downstream resolver instances. General recommendation is to preserve all keys in the input_dict unless you have specific reason.
PARAMETER | DESCRIPTION |
---|---|
store
|
An MLMD MetadataStore.
TYPE:
|
input_dict
|
The input_dict to resolve from. |
RETURNS | DESCRIPTION |
---|---|
Optional[Dict[str, List[Artifact]]]
|
If all entries has enough data after the resolving, returns the resolved input_dict. Otherise, return None. |
Source code in tfx/dsl/components/common/resolver.py
RuntimeParameter
¶
RuntimeParameter(name: str, ptype: Optional[Type] = None, default: Optional[Union[int, float, str]] = None, description: Optional[str] = None)
Bases: Jsonable
Runtime parameter.
Currently only supported on KubeflowV2DagRunner.
For protos, use text type RuntimeParameter, which holds the proto json
string, e.g., '{"num_steps": 5}'
for TrainArgs proto.
ATTRIBUTE | DESCRIPTION |
---|---|
name |
The name of the runtime parameter.
|
default |
Default value for runtime params when it's not explicitly specified.
|
ptype |
The type of the runtime parameter.
|
description |
Description of the usage of the parameter.
|
METHOD | DESCRIPTION |
---|---|
from_json_dict |
Convert from dictionary data to an object. |
to_json_dict |
Convert from an object to a JSON serializable dictionary. |
Source code in tfx/orchestration/data_types.py
SpanRangeStrategy
¶
SpanRangeStrategy(range_config: Any)
Bases: ResolverStrategy
SpanRangeStrategy resolves artifacts based on "span" property.
Note that this ResolverStrategy is experimental and is subject to change in terms of both interface and implementation.
Don't construct SpanRangeStrategy directly, example usage:
examples_resolver = Resolver(
strategy_class=SpanRangeStrategy,
config={"range_config": range_config},
examples=Channel(type=Examples, producer_component_id=example_gen.id),
).with_id("span_resolver")
examples_resolver.outputs["examples"]
METHOD | DESCRIPTION |
---|---|
resolve_artifacts |
Resolves artifacts from channels by querying MLMD. |
Source code in tfx/dsl/input_resolution/strategies/span_range_strategy.py
resolve_artifacts
¶resolve_artifacts(store: MetadataStore, input_dict: Dict[str, List[Artifact]]) -> Optional[Dict[str, List[Artifact]]]
Resolves artifacts from channels by querying MLMD.
PARAMETER | DESCRIPTION |
---|---|
store
|
An MLMD MetadataStore object.
TYPE:
|
input_dict
|
The input_dict to resolve from. |
RETURNS | DESCRIPTION |
---|---|
Optional[Dict[str, List[Artifact]]]
|
If |
Optional[Dict[str, List[Artifact]]]
|
Dict[Text, List[Artifact]]. Otherwise, return None. |
RAISES | DESCRIPTION |
---|---|
RuntimeError
|
if input_dict contains artifact without span property. |
Source code in tfx/dsl/input_resolution/strategies/span_range_strategy.py
Functions¶
create_container_component
¶
create_container_component(name: str, image: str, command: List[CommandlineArgumentType], inputs: Optional[Dict[str, Any]] = None, outputs: Optional[Dict[str, Any]] = None, parameters: Optional[Dict[str, Any]] = None) -> Callable[..., BaseComponent]
Creates a container-based component.
PARAMETER | DESCRIPTION |
---|---|
name
|
The name of the component
TYPE:
|
image
|
Container image name.
TYPE:
|
command
|
Container entrypoint command-line. Not executed within a shell. The command-line can use placeholder objects that will be replaced at the compilation time. The placeholder objects can be imported from tfx.dsl.component.experimental.placeholders. Note that Jinja templates are not supported.
TYPE:
|
inputs
|
The list of component inputs |
outputs
|
The list of component outputs |
parameters
|
The list of component parameters |
RETURNS | DESCRIPTION |
---|---|
Callable[..., BaseComponent]
|
Component that can be instantiated and user inside pipeline. |
Example
component = create_container_component(
name="TrainModel",
inputs={
"training_data": Dataset,
},
outputs={
"model": Model,
},
parameters={
"num_training_steps": int,
},
image="gcr.io/my-project/my-trainer",
command=[
"python3", "my_trainer",
"--training_data_uri", InputUriPlaceholder("training_data"),
"--model_uri", OutputUriPlaceholder("model"),
"--num_training-steps", InputValuePlaceholder("num_training_steps"),
],
)
Source code in tfx/dsl/component/experimental/container_component.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
io
¶
TFX DSL I/O module.
MODULE | DESCRIPTION |
---|---|
fileio |
TFX DSL file I/O module. |
Modules¶
fileio
¶
TFX DSL file I/O module.
FUNCTION | DESCRIPTION |
---|---|
copy |
Copy a file from the source to the destination. |
exists |
Return whether a path exists. |
glob |
Return the paths that match a glob pattern. |
isdir |
Return whether a path is a directory. |
listdir |
Return the list of files in a directory. |
makedirs |
Make a directory at the given path, recursively creating parents. |
mkdir |
Make a directory at the given path; parent directory must exist. |
open |
Open a file at the given path. |
remove |
Remove the file at the given path. |
rename |
Rename a source file to a destination path. |
rmtree |
Remove the given directory and its recursive contents. |
stat |
Return the stat descriptor for a given file path. |
walk |
Return an iterator walking a directory tree. |
copy
¶copy(src: PathType, dst: PathType, overwrite: bool = False) -> None
Copy a file from the source to the destination.
Source code in tfx/dsl/io/fileio.py
makedirs
¶
mkdir
¶
remove
¶
rename
¶rename(src: PathType, dst: PathType, overwrite: bool = False) -> None
Rename a source file to a destination path.
Source code in tfx/dsl/io/fileio.py
rmtree
¶
placeholders
¶
TFX placeholders module.
FUNCTION | DESCRIPTION |
---|---|
exec_property |
Returns a Placeholder that represents an execution property. |
execution_invocation |
Returns a Placeholder representing ExecutionInvocation proto. |
input |
Returns a Placeholder that represents an input artifact. |
output |
Returns a Placeholder that represents an output artifact. |
Functions¶
exec_property
¶
exec_property(key: str) -> ExecPropertyPlaceholder
Returns a Placeholder that represents an execution property.
PARAMETER | DESCRIPTION |
---|---|
key
|
The key of the output artifact.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ExecPropertyPlaceholder
|
A Placeholder that supports
|
Source code in tfx/dsl/placeholder/runtime_placeholders.py
execution_invocation
¶
Returns a Placeholder representing ExecutionInvocation proto.
RETURNS | DESCRIPTION |
---|---|
ExecInvocationPlaceholder
|
A Placeholder that will render to the ExecutionInvocation proto. Accessing a proto field is the same as if accessing a proto field in Python. Prefer to use input(key)/output(key)/exec_property(key) functions instead of input_dict/output_dict/execution_properties field from ExecutionInvocation proto. |
Source code in tfx/dsl/placeholder/runtime_placeholders.py
input
¶
input(key: str) -> ArtifactPlaceholder
Returns a Placeholder that represents an input artifact.
PARAMETER | DESCRIPTION |
---|---|
key
|
The key of the input artifact.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ArtifactPlaceholder
|
A Placeholder that supports
|
Source code in tfx/dsl/placeholder/artifact_placeholder.py
output
¶
output(key: str) -> ArtifactPlaceholder
Returns a Placeholder that represents an output artifact.
It is the same as input(...) function, except it is for output artifacts.
PARAMETER | DESCRIPTION |
---|---|
key
|
The key of the output artifact.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ArtifactPlaceholder
|
A Placeholder that supports
|
Source code in tfx/dsl/placeholder/artifact_placeholder.py
standard_annotations
¶
Public API for base type annotations.
CLASS | DESCRIPTION |
---|---|
Dataset |
Dataset is a TFX pre-defined system artifact. |
Deploy |
Deploy is a TFX pre-defined system execution. |
Evaluate |
Evaluate is a TFX pre-defined system execution. |
Metrics |
Metrics is a TFX pre-defined system artifact. |
Model |
Model is a TFX pre-defined system artifact. |
Process |
Process is a TFX pre-defined system execution. |
Statistics |
Statistics is a TFX pre-defined system artifact. |
Train |
Train is a TFX pre-defined system execution. |
Transform |
Transform is a TFX pre-defined system execution. |
Classes¶
Dataset
¶
Bases: SystemArtifact
Dataset is a TFX pre-defined system artifact.
Deploy
¶
Bases: SystemExecution
Deploy is a TFX pre-defined system execution.
This execution performs model deployment. For example, Pusher component can be annotated as Deploy execution, which checks whether the model passed the validation steps and pushes fully validated models to Servomatic, CNS/Placer, TF-Hub, and other destinations.
Evaluate
¶
Bases: SystemExecution
Evaluate is a TFX pre-defined system execution.
It computes a model’s evaluation statistics over (slices of) features.
Metrics
¶
Bases: SystemArtifact
Metrics is a TFX pre-defined system artifact.
Model
¶
Bases: SystemArtifact
Model is a TFX pre-defined system artifact.
Process
¶
Bases: SystemExecution
Process is a TFX pre-defined system execution.
It includes various executions such as ExampleGen, SchemaGen, SkewDetection, e.t.c., which performs data/model/statistics processing.
Statistics
¶
Bases: SystemArtifact
Statistics is a TFX pre-defined system artifact.
Train
¶
Bases: SystemExecution
Train is a TFX pre-defined system execution.
Train is one of the key executions that performs the actual model training.
Transform
¶
Bases: SystemExecution
Transform is a TFX pre-defined system execution.
It performs transformations and feature engineering in training and serving.