class_docstr: DEPRECATED: Please use `Evaluator` instead.
  
  The model validator component can be used to check model metrics threshold
  and validate current model against a previously validated model. If there
  isn't a prior validated model, model validator will just make sure the
  threshold passed.  Otherwise, ModelValidator compares a newly trained models
  against a known good model, specifically the last model "blessed" by this
  component.  A model is "blessed" if the exported model's metrics are within
  predefined thresholds around the prior model's metrics.
  
  *Note:* This component includes a driver to resolve last blessed model.
  
  ## Possible causes why model validation fails
  Model validation can fail for many reasons, but these are the most common:
  
  - problems with training data.  For example, negative examples are dropped or
    features are missing.
  - problems with the test or evaluation data.  For example, skew exists between
    the training and evaluation data.
  - changes in data distribution.  This indicates the user behavior may have
    changed over time.
  - problems with the trainer.  For example, the trainer was stopped before
    model is converged or the model is unstable.
  
  ## Example
  ```
    # Performs quality validation of a candidate model (compared to a baseline).
    model_validator = ModelValidator(
        examples=example_gen.outputs['examples'],
        model=trainer.outputs['model'])
  ```
class_docstr_tok: ["DEPRECATED",":","Please","use","`","Evaluator","`","instead",".","The","model","validator","component","can","be","used","to","check","model","metrics","threshold","and","validate","current","model","against","a","previously","validated","model",".","If","there","is","n't","a","prior","validated","model",",","model","validator","will","just","make","sure","the","threshold","passed",".","Otherwise",",","ModelValidator","compares","a","newly","trained","models","against","a","known","good","model",",","specifically","the","last","model","``","blessed","''","by","this","component",".","A","model","is","``","blessed","''","if","the","exported","model","'s","metrics","are","within","predefined","thresholds","around","the","prior","model","'s","metrics",".","*","Note",":","*","This","component","includes","a","driver","to","resolve","last","blessed","model",".","#","#","Possible","causes","why","model","validation","fails","Model","validation","can","fail","for","many","reasons",",","but","these","are","the","most","common",":","-","problems","with","training","data",".","For","example",",","negative","examples","are","dropped","or","features","are","missing",".","-","problems","with","the","test","or","evaluation","data",".","For","example",",","skew","exists","between","the","training","and","evaluation","data",".","-","changes","in","data","distribution",".","This","indicates","the","user","behavior","may","have","changed","over","time",".","-","problems","with","the","trainer",".","For","example",",","the","trainer","was","stopped","before","model","is","converged","or","the","model","is","unstable",".","#","#","Example","``","`","#","Performs","quality","validation","of","a","candidate","model","(","compared","to","a","baseline",")",".","model_validator","=","ModelValidator","(","examples=example_gen.outputs","[","'examples","'","]",",","model=trainer.outputs","[","'model","'","]",")","``","`"]
docstr: Construct a ModelValidator component.
  
  Args:
    examples: A BaseChannel of type `standard_artifacts.Examples`, usually
      produced by an
      [ExampleGen](https://www.tensorflow.org/tfx/guide/examplegen) component.
        _required_
    model: A BaseChannel of type `standard_artifacts.Model`, usually produced
      by
      a [Trainer](https://www.tensorflow.org/tfx/guide/trainer) component.
        _required_
    blessing: Output channel of type `standard_artifacts.ModelBlessing` that
      contains the validation result.
docstr_tok: ["Construct","a","ModelValidator","component",".","Args",":","examples",":","A","BaseChannel","of","type","`","standard_artifacts.Examples","`",",","usually","produced","by","an","[","ExampleGen","]","(","https",":","\/\/www.tensorflow.org\/tfx\/guide\/examplegen",")","component",".","_required_","model",":","A","BaseChannel","of","type","`","standard_artifacts.Model","`",",","usually","produced","by","a","[","Trainer","]","(","https",":","\/\/www.tensorflow.org\/tfx\/guide\/trainer",")","component",".","_required_","blessing",":","Output","channel","of","type","`","standard_artifacts.ModelBlessing","`","that","contains","the","validation","result","."]
code: def __init__(
      self,
      examples: types.BaseChannel,
      model: types.BaseChannel,
      blessing: Optional[types.Channel] = None,
  ):
      """Construct a ModelValidator component.
  
      Args:
        examples: A BaseChannel of type `standard_artifacts.Examples`, usually
          produced by an
          [ExampleGen](https://www.tensorflow.org/tfx/guide/examplegen) component.
            _required_
        model: A BaseChannel of type `standard_artifacts.Model`, usually produced
          by
          a [Trainer](https://www.tensorflow.org/tfx/guide/trainer) component.
            _required_
        blessing: Output channel of type `standard_artifacts.ModelBlessing` that
          contains the validation result.
      """
      blessing = blessing or types.Channel(
          type=standard_artifacts.ModelBlessing
      )
      spec = standard_component_specs.ModelValidatorSpec(
          examples=examples, model=model, blessing=blessing
      )
      super().__init__(spec=spec)
  
file_path: tfx/tfx/components/model_validator/component.py
imports: from typing import Optional
  from tfx import types
  from tfx.components.model_validator import driver
  from tfx.components.model_validator import executor
  from tfx.dsl.components.base import base_beam_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 deprecation_utils
label_desc: Use image node_id 1 to create a new ModelValidator object from inherited base classes: base_beam_component with example: obj = ModelValidator(examples, model, blessing)