def compare_stats_for_examples()

in tfx_airflow/notebooks/tfx_utils.py [0:0]


  def compare_stats_for_examples(self, examples_id, other_examples_id,
                                 name='', other_name=''):
    """Compares stats for `examples_id` and `other_examples_id`.

    Args:
      examples_id: A `int` indicating the id of one `TFXArtifactTypes.EXAMPLES`
          artifact.
      other_examples_id: A `int` indicating the id of another
          `TFXArtifactTypes.EXAMPLES` artifact.
      name: (Optional) A `str` indicating the label to use for stats of
          `examples_id`.
      other_name: (Optional) A `str` indicating the label to use for stats of
          `other_examples_id`.
    """
    stats_artifact, other_stats_artifact = (
        self.get_dest_artifact_of_type(
            examples_id, TFXArtifactTypes.EXAMPLE_STATS),
        self.get_dest_artifact_of_type(
            other_examples_id, TFXArtifactTypes.EXAMPLE_STATS)
    )
    if stats_artifact and other_stats_artifact:
      tfdv.visualize_statistics(
          tfdv.load_statistics(stats_artifact.uri),
          rhs_statistics=tfdv.load_statistics(other_stats_artifact.uri),
          lhs_name=name, rhs_name=other_name)