class_docstr: A TFX SchemaGen component to generate a schema from the training data.
  
  The SchemaGen component uses [TensorFlow Data
  Validation](https://www.tensorflow.org/tfx/data_validation/api_docs/python/tfdv)
  to generate a schema from input statistics. The following TFX libraries use
  the schema:
    - TensorFlow Data Validation
    - TensorFlow Transform
    - TensorFlow Model Analysis
  
  In a typical TFX pipeline, the SchemaGen component generates a schema which
  is consumed by the other pipeline components.
  
  ## Example
  ```
    # Generates schema based on statistics files.
    infer_schema = SchemaGen(statistics=statistics_gen.outputs['statistics'])
  ```
  
  Component `outputs` contains:
   - `schema`: Channel of type `standard_artifacts.Schema` for schema
   result.
  
  See [the SchemaGen guide](https://www.tensorflow.org/tfx/guide/schemagen)
  for more details.
class_docstr_tok: ["A","TFX","SchemaGen","component","to","generate","a","schema","from","the","training","data",".","The","SchemaGen","component","uses","[","TensorFlow","Data","Validation","]","(","https",":","\/\/www.tensorflow.org\/tfx\/data_validation\/api_docs\/python\/tfdv",")","to","generate","a","schema","from","input","statistics",".","The","following","TFX","libraries","use","the","schema",":","-","TensorFlow","Data","Validation","-","TensorFlow","Transform","-","TensorFlow","Model","Analysis","In","a","typical","TFX","pipeline",",","the","SchemaGen","component","generates","a","schema","which","is","consumed","by","the","other","pipeline","components",".","#","#","Example","``","`","#","Generates","schema","based","on","statistics","files",".","infer_schema","=","SchemaGen","(","statistics=statistics_gen.outputs","[","'statistics","'","]",")","``","`","Component","`","outputs","`","contains",":","-","`","schema","`",":","Channel","of","type","`","standard_artifacts.Schema","`","for","schema","result",".","See","[","the","SchemaGen","guide","]","(","https",":","\/\/www.tensorflow.org\/tfx\/guide\/schemagen",")","for","more","details","."]
docstr: Constructs a SchemaGen component.
  
  Args:
    statistics: A BaseChannel of `ExampleStatistics` type (required if spec is
      not passed). This should contain at least a `train` split. Other splits
      are currently ignored. _required_
    infer_feature_shape: Boolean (or RuntimeParameter) value indicating
      whether or not to infer the shape of features. If the feature shape is
      not inferred, downstream Tensorflow Transform component using the schema
      will parse input as tf.SparseTensor. Default to True if not set.
    exclude_splits: Names of splits that will not be taken into consideration
      when auto-generating a schema. Default behavior (when exclude_splits is
      set to None) is excluding no splits.
docstr_tok: ["Constructs","a","SchemaGen","component",".","Args",":","statistics",":","A","BaseChannel","of","`","ExampleStatistics","`","type","(","required","if","spec","is","not","passed",")",".","This","should","contain","at","least","a","`","train","`","split",".","Other","splits","are","currently","ignored",".","_required_","infer_feature_shape",":","Boolean","(","or","RuntimeParameter",")","value","indicating","whether","or","not","to","infer","the","shape","of","features",".","If","the","feature","shape","is","not","inferred",",","downstream","Tensorflow","Transform","component","using","the","schema","will","parse","input","as","tf.SparseTensor",".","Default","to","True","if","not","set",".","exclude_splits",":","Names","of","splits","that","will","not","be","taken","into","consideration","when","auto-generating","a","schema",".","Default","behavior","(","when","exclude_splits","is","set","to","None",")","is","excluding","no","splits","."]
code: def __init__(
      self,
      statistics: types.BaseChannel,
      infer_feature_shape: Optional[
          Union[bool, data_types.RuntimeParameter]
      ] = True,
      exclude_splits: Optional[List[str]] = None,
  ):
      """Constructs a SchemaGen component.
  
      Args:
        statistics: A BaseChannel of `ExampleStatistics` type (required if spec is
          not passed). This should contain at least a `train` split. Other splits
          are currently ignored. _required_
        infer_feature_shape: Boolean (or RuntimeParameter) value indicating
          whether or not to infer the shape of features. If the feature shape is
          not inferred, downstream Tensorflow Transform component using the schema
          will parse input as tf.SparseTensor. Default to True if not set.
        exclude_splits: Names of splits that will not be taken into consideration
          when auto-generating a schema. Default behavior (when exclude_splits is
          set to None) is excluding no splits.
      """
      if exclude_splits is None:
          exclude_splits = []
          logging.info(
              "Excluding no splits because exclude_splits is not set."
          )
      schema = types.Channel(type=standard_artifacts.Schema)
      if isinstance(infer_feature_shape, bool):
          infer_feature_shape = int(infer_feature_shape)
      spec = standard_component_specs.SchemaGenSpec(
          statistics=statistics,
          infer_feature_shape=infer_feature_shape,
          exclude_splits=json_utils.dumps(exclude_splits),
          schema=schema,
      )
      super().__init__(spec=spec)
  
file_path: tfx/tfx/components/schema_gen/component.py
imports: from typing import List, Optional, Union
  from absl import logging
  from tfx import types
  from tfx.components.schema_gen import executor
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import executor_spec
  from tfx.orchestration import data_types
  from tfx.types import standard_artifacts
  from tfx.types import standard_component_specs
  from tfx.utils import json_utils
label_desc: Use image node_id 1 to create a new SchemaGen object from inherited base classes: base_component with example: obj = SchemaGen(statistics, infer_feature_shape, exclude_splits)