class_docstr: A TFX ml-metadata store that provides read-only methods for notebooks.
class_docstr_tok: ["A","TFX","ml-metadata","store","that","provides","read-only","methods","for","notebooks","."]
docstr: Compares TFMA metrics for `model_id` and `other_model_id`.
  
  Args:
    model_id: A `int` indicating the id of a `TFXArtifactTypes.MODEL` artifact
    other_model_id: A `int` indicating the id of another
      `TFXArtifactTypes.MODEL` artifact.
  
  Returns:
    A TimeSeriesViewer object if in Jupyter notebook; None if in Colab.
docstr_tok: ["Compares","TFMA","metrics","for","`","model_id","`","and","`","other_model_id","`",".","Args",":","model_id",":","A","`","int","`","indicating","the","id","of","a","`","TFXArtifactTypes.MODEL","`","artifact","other_model_id",":","A","`","int","`","indicating","the","id","of","another","`","TFXArtifactTypes.MODEL","`","artifact",".","Returns",":","A","TimeSeriesViewer","object","if","in","Jupyter","notebook",";","None","if","in","Colab","."]
code: def compare_tfma_analysis(self, model_id, other_model_id):
      """Compares TFMA metrics for `model_id` and `other_model_id`.
  
      Args:
        model_id: A `int` indicating the id of a `TFXArtifactTypes.MODEL` artifact
        other_model_id: A `int` indicating the id of another
          `TFXArtifactTypes.MODEL` artifact.
  
      Returns:
        A TimeSeriesViewer object if in Jupyter notebook; None if in Colab.
      """
      tfma_artifact, other_tfma_artifact = (
          self.get_dest_artifact_of_type(
              model_id, TFXArtifactTypes.MODEL_EVAL
          ),
          self.get_dest_artifact_of_type(
              other_model_id, TFXArtifactTypes.MODEL_EVAL
          ),
      )
      if tfma_artifact and other_tfma_artifact:
          eval_results = tfma.make_eval_results(
              [
                  tfma.load_eval_result(tfma_artifact.uri),
                  tfma.load_eval_result(other_tfma_artifact.uri),
              ],
              tfma.constants.MODEL_CENTRIC_MODE,
          )
          return tfma.view.render_time_series(
              eval_results, tfma.slicer.slicer.SingleSliceSpec()
          )
  
imports: import os
  import time
  import papermill
  import tensorflow_data_validation
  import tensorflow_model_analysis
  import utils
  from ml_metadata.metadata_store import metadata_store
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling the TFXReadonlyMetadataStore obj's underlying member method code with example usage: obj.compare_tfma_analysis(model_id, other_model_id) and returns: tfma