class_docstr: A TFX component to validate input examples.
  
  The ExampleValidator component uses [Tensorflow Data
  Validation](https://www.tensorflow.org/tfx/data_validation/api_docs/python/tfdv)
  to validate the statistics of some splits on input examples against a schema.
  
  The ExampleValidator component identifies anomalies in training and serving
  data. The component can be configured to detect different classes of anomalies
  in the data. It can:
    - perform validity checks by comparing data statistics against a schema that
      codifies expectations of the user.
    - run custom validations based on an optional SQL-based config.
  
  Schema Based Example Validation
  The ExampleValidator component identifies any anomalies in the example data by
  comparing data statistics computed by the StatisticsGen component against a
  schema. The schema codifies properties which the input data is expected to
  satisfy, and is provided and maintained by the user.
  
  ## Example
  ```
  # Performs anomaly detection based on statistics and data schema.
  validate_stats = ExampleValidator(
      statistics=statistics_gen.outputs['statistics'],
      schema=infer_schema.outputs['schema'])
  ```
  
  Component `outputs` contains:
   - `anomalies`: Channel of type `standard_artifacts.ExampleAnomalies`.
  
  See [the ExampleValidator
  guide](https://www.tensorflow.org/tfx/guide/exampleval) for more details.
class_docstr_tok: ["A","TFX","component","to","validate","input","examples",".","The","ExampleValidator","component","uses","[","Tensorflow","Data","Validation","]","(","https",":","\/\/www.tensorflow.org\/tfx\/data_validation\/api_docs\/python\/tfdv",")","to","validate","the","statistics","of","some","splits","on","input","examples","against","a","schema",".","The","ExampleValidator","component","identifies","anomalies","in","training","and","serving","data",".","The","component","can","be","configured","to","detect","different","classes","of","anomalies","in","the","data",".","It","can",":","-","perform","validity","checks","by","comparing","data","statistics","against","a","schema","that","codifies","expectations","of","the","user",".","-","run","custom","validations","based","on","an","optional","SQL-based","config",".","Schema","Based","Example","Validation","The","ExampleValidator","component","identifies","any","anomalies","in","the","example","data","by","comparing","data","statistics","computed","by","the","StatisticsGen","component","against","a","schema",".","The","schema","codifies","properties","which","the","input","data","is","expected","to","satisfy",",","and","is","provided","and","maintained","by","the","user",".","#","#","Example","``","`","#","Performs","anomaly","detection","based","on","statistics","and","data","schema",".","validate_stats","=","ExampleValidator","(","statistics=statistics_gen.outputs","[","'statistics","'","]",",","schema=infer_schema.outputs","[","'schema","'","]",")","``","`","Component","`","outputs","`","contains",":","-","`","anomalies","`",":","Channel","of","type","`","standard_artifacts.ExampleAnomalies","`",".","See","[","the","ExampleValidator","guide","]","(","https",":","\/\/www.tensorflow.org\/tfx\/guide\/exampleval",")","for","more","details","."]
docstr: Construct an ExampleValidator component.
  
  Args:
    statistics: A BaseChannel of type `standard_artifacts.ExampleStatistics`.
    schema: A BaseChannel of type `standard_artifacts.Schema`. _required_
    exclude_splits: Names of splits that the example validator should not
      validate. Default behavior (when exclude_splits is set to None) is
      excluding no splits.
    custom_validation_config: Optional configuration for specifying SQL-based
      custom validations.
docstr_tok: ["Construct","an","ExampleValidator","component",".","Args",":","statistics",":","A","BaseChannel","of","type","`","standard_artifacts.ExampleStatistics","`",".","schema",":","A","BaseChannel","of","type","`","standard_artifacts.Schema","`",".","_required_","exclude_splits",":","Names","of","splits","that","the","example","validator","should","not","validate",".","Default","behavior","(","when","exclude_splits","is","set","to","None",")","is","excluding","no","splits",".","custom_validation_config",":","Optional","configuration","for","specifying","SQL-based","custom","validations","."]
code: def __init__(
      self,
      statistics: types.BaseChannel,
      schema: types.BaseChannel,
      exclude_splits: Optional[List[str]] = None,
      custom_validation_config: Optional[
          custom_validation_config_pb2.CustomValidationConfig
      ] = None,
  ):
      """Construct an ExampleValidator component.
  
      Args:
        statistics: A BaseChannel of type `standard_artifacts.ExampleStatistics`.
        schema: A BaseChannel of type `standard_artifacts.Schema`. _required_
        exclude_splits: Names of splits that the example validator should not
          validate. Default behavior (when exclude_splits is set to None) is
          excluding no splits.
        custom_validation_config: Optional configuration for specifying SQL-based
          custom validations.
      """
      if exclude_splits is None:
          exclude_splits = []
          logging.info(
              "Excluding no splits because exclude_splits is not set."
          )
      anomalies = types.Channel(
          type=standard_artifacts.ExampleAnomalies
      )
      spec = standard_component_specs.ExampleValidatorSpec(
          statistics=statistics,
          schema=schema,
          exclude_splits=json_utils.dumps(exclude_splits),
          custom_validation_config=custom_validation_config,
          anomalies=anomalies,
      )
      super().__init__(spec=spec)
  
file_path: tfx/tfx/components/example_validator/component.py
imports: from typing import List, Optional
  from absl import logging
  from tensorflow_data_validation.anomalies.proto import custom_validation_config_pb2
  from tfx import types
  from tfx.components.example_validator import executor
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import executor_spec
  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 ExampleValidator object from inherited base classes: base_component with example: obj = ExampleValidator(statistics, schema, exclude_splits, custom_validation_config)