Module core.components.transform_simple.component

Classes

SimpleTransform(name: str, source: str, source_args: Dict[str, Any], instance_name: Union[str, NoneType] = None, examples: Union[tfx.types.component_spec.ChannelParameter, NoneType] = None) : A TFX component to transform the input examples.

The Transform component wraps TensorFlow Transform (tf.Transform) to
preprocess data in a TFX pipeline. This component will load the
preprocessing_fn from input module file, preprocess both 'train' and 'eval'
splits of input examples, generate the `tf.Transform` output, and save both
transform function and transformed examples to orchestrator desired locations.

## Providing a preprocessing function
The TFX executor will use the estimator provided in the `module_file` file
to train the model.  The Transform executor will look specifically for the
`preprocessing_fn()` function within that file.

An example of `preprocessing_fn()` can be found in the [user-supplied
code]((https://github.com/tensorflow/tfx/blob/master/tfx/examples/chicago_taxi_pipeline/taxi_utils.py))
of the TFX Chicago Taxi pipeline example.

## Example
```
# Performs transformations and feature engineering in training and serving.
transform = Transform(
    examples=example_gen.outputs['examples'],
    schema=infer_schema.outputs['schema'],
    module_file=module_file)
```

Please see https://www.tensorflow.org/tfx/transform for more details.

Interface for all SimpleTransform components, the main component responsible
for reading data and converting to TFRecords. This is how we handle
versioning data for now.

Args:
    name: name of datasource.
    source:
    source_args:
    instance_name:
    examples:

### Ancestors (in MRO)

* tfx.components.transform.component.Transform
* tfx.dsl.components.base.base_component.BaseComponent
* tfx.dsl.components.base.base_node.BaseNode
* tfx.utils.json_utils.Jsonable

### Class variables

`EXECUTOR_SPEC`
:

`SPEC_CLASS`
:   A specification of the inputs, outputs and parameters for a component.
    
    Components should have a corresponding ComponentSpec inheriting from this
    class and must override:
    
      - PARAMETERS (as a dict of string keys and ExecutionParameter values),
      - INPUTS (as a dict of string keys and ChannelParameter values) and
      - OUTPUTS (also a dict of string keys and ChannelParameter values).
    
    Here is an example of how a ComponentSpec may be defined:
    
    class MyCustomComponentSpec(ComponentSpec):
      PARAMETERS = {
          'internal_option': ExecutionParameter(type=str),
      }
      INPUTS = {
          'input_examples': ChannelParameter(type=standard_artifacts.Examples),
      }
      OUTPUTS = {
          'output_examples': ChannelParameter(type=standard_artifacts.Examples),
      }
    
    To create an instance of a subclass, call it directly with any execution
    parameters / inputs / outputs as kwargs.  For example:
    
    spec = MyCustomComponentSpec(
        internal_option='abc',
        input_examples=input_examples_channel,
        output_examples=output_examples_channel)
    
    Attributes:
      PARAMETERS: a dict of string keys and ExecutionParameter values.
      INPUTS: a dict of string keys and ChannelParameter values.
      OUTPUTS: a dict of string keys and ChannelParameter values.

SimpleTransformSpec(**kwargs) : A specification of the inputs, outputs and parameters for a component.

Components should have a corresponding ComponentSpec inheriting from this
class and must override:

  - PARAMETERS (as a dict of string keys and ExecutionParameter values),
  - INPUTS (as a dict of string keys and ChannelParameter values) and
  - OUTPUTS (also a dict of string keys and ChannelParameter values).

Here is an example of how a ComponentSpec may be defined:

class MyCustomComponentSpec(ComponentSpec):
  PARAMETERS = {
      'internal_option': ExecutionParameter(type=str),
  }
  INPUTS = {
      'input_examples': ChannelParameter(type=standard_artifacts.Examples),
  }
  OUTPUTS = {
      'output_examples': ChannelParameter(type=standard_artifacts.Examples),
  }

To create an instance of a subclass, call it directly with any execution
parameters / inputs / outputs as kwargs.  For example:

spec = MyCustomComponentSpec(
    internal_option='abc',
    input_examples=input_examples_channel,
    output_examples=output_examples_channel)

Attributes:
  PARAMETERS: a dict of string keys and ExecutionParameter values.
  INPUTS: a dict of string keys and ChannelParameter values.
  OUTPUTS: a dict of string keys and ChannelParameter values.

Initialize a ComponentSpec.

Args:
  **kwargs: Any inputs, outputs and execution parameters for this instance
    of the component spec.

### Ancestors (in MRO)

* tfx.types.component_spec.ComponentSpec
* tfx.utils.json_utils.Jsonable

### Class variables

`INPUTS`
:

`OUTPUTS`
:

`PARAMETERS`
: