Official TFX CsvExampleGen component.
Inherits From: BaseBeamComponent
, BaseComponent
, BaseNode
tfx.v1.components.CsvExampleGen(
input_base: Optional[str] = None,
input_config: Optional[Union[tfx.v1.proto.Input
, tfx.v1.dsl.experimental.RuntimeParameter
]] = None,
output_config: Optional[Union[tfx.v1.proto.Output
, tfx.v1.dsl.experimental.RuntimeParameter
]] = None,
range_config: Optional[Union[placeholder.Placeholder, range_config_pb2.RangeConfig,
data_types.RuntimeParameter]] = None
)
Used in the notebooks
Used in the tutorials |
---|
The csv examplegen component takes csv data, and generates train and eval examples for downstream components.
The csv examplegen encodes column values to tf.Example int/float/byte feature.
For the case when there's missing cells, the csv examplegen uses:
-- tf.train.Feature(type
_list=tf.train.type
List(value=[])), when the
type
can be inferred.
-- tf.train.Feature() when it cannot infer the type
from the column.
Note that the type inferring will be per input split. If input isn't a single split, users need to ensure the column types align in each pre-splits.
For example, given the following csv rows of a split:
header:A,B,C,D row1: 1,,x,0.1 row2: 2,,y,0.2 row3: 3,,,0.3 row4:
The output example will be example1: 1(int), empty feature(no type), x(string), 0.1(float) example2: 2(int), empty feature(no type), x(string), 0.2(float) example3: 3(int), empty feature(no type), empty list(string), 0.3(float)
Note that the empty feature is tf.train.Feature()
while empty list string
feature is tf.train.Feature(bytes_list=tf.train.BytesList(value=[]))
.
Component outputs
contains:
examples
: Channel of typestandard_artifacts.Examples
for output train and eval examples.
Attributes | |
---|---|
outputs
|
Component's output channel dict. |
Methods
with_beam_pipeline_args
with_beam_pipeline_args(
beam_pipeline_args: Iterable[Union[str, placeholder.Placeholder]]
) -> 'BaseBeamComponent'
Add per component Beam pipeline args.
Args | |
---|---|
beam_pipeline_args
|
List of Beam pipeline args to be added to the Beam executor spec. |
Returns | |
---|---|
the same component itself. |
with_node_execution_options
with_node_execution_options(
node_execution_options: utils.NodeExecutionOptions
) -> typing_extensions.Self
Class Variables | |
---|---|
POST_EXECUTABLE_SPEC |
None
|
PRE_EXECUTABLE_SPEC |
None
|