class_docstr: TFMA benchmark base class.
class_docstr_tok: ["TFMA","benchmark","base","class","."]
docstr: Benchmark a "mini" version of TFMA - predict, slice and compute metrics.
  
  Runs a "mini" version of TFMA in a Beam pipeline. Records the wall time
  taken for the whole pipeline.
docstr_tok: ["Benchmark","a","``","mini","''","version","of","TFMA","-","predict",",","slice","and","compute","metrics",".","Runs","a","``","mini","''","version","of","TFMA","in","a","Beam","pipeline",".","Records","the","wall","time","taken","for","the","whole","pipeline","."]
code: def benchmarkMiniPipeline(self):
      """Benchmark a "mini" version of TFMA - predict, slice and compute metrics.
  
      Runs a "mini" version of TFMA in a Beam pipeline. Records the wall time
      taken for the whole pipeline.
      """
      pipeline = self._create_beam_pipeline()
      raw_data = (
          pipeline
          | "Examples"
          >> beam.Create(
              self._dataset.read_raw_dataset(
                  deserialize=False, limit=self._max_num_examples()
              )
          )
          | "InputsToExtracts" >> tfma.InputsToExtracts()
      )
  
      eval_shared_model = tfma.default_eval_shared_model(
          eval_saved_model_path=self._dataset.tfma_saved_model_path()
      )
  
      _ = (
          raw_data
          | "PredictExtractor"
          >> tfma.extractors.PredictExtractor(
              eval_shared_model=eval_shared_model
          ).ptransform
          | "SliceKeyExtractor"
          >> tfma.extractors.SliceKeyExtractor().ptransform
          | "ComputeMetricsAndPlots"
          >> tfma.evaluators.MetricsAndPlotsEvaluator(
              eval_shared_model=eval_shared_model
          ).ptransform
      )
  
      start = time.time()
      result = pipeline.run()
      result.wait_until_finish()
      end = time.time()
      delta = end - start
  
      self.report_benchmark(
          iters=1,
          wall_time=delta,
          extras={
              "num_examples": self._dataset.num_examples(
                  limit=self._max_num_examples()
              )
          },
      )
  
file_path: tfx/tfx/benchmarks/tfma_benchmark_base.py
imports: import time
  import apache_beam
  import tensorflow_model_analysis
  from tensorflow_model_analysis.eval_saved_model import load
  import tfx
  from tfx.benchmarks import benchmark_utils
  from tfx.benchmarks import benchmark_base
label_desc: Use image node_id 4 for calling the TFMABenchmarkBase obj's underlying member method code with example usage: obj.benchmarkMiniPipeline() without return types