此页面由 Cloud Translation API 翻译。
Switch to English

TensorFlow模型分析

扩展TensorFlow的一个关键组成部分的例子(TFX)

这个例子colab笔记本显示TensorFlow模型分析(TFMA)如何被用于研究和可视化数据集的特性和模型的性能。我们将使用一个模型,我们以前训练的,现在你得到的结果玩!

我们训练的模型是为芝加哥出租车例子 ,它使用了出租车旅程数据集由芝加哥市的释放。

了解更多关于在数据集中谷歌的BigQuery 。探索在完整数据集的BigQuery UI

数据集中的列有:

pickup_community_area 票价 trip_start_month
trip_start_hour trip_start_day trip_start_timestamp
pickup_latitude pickup_longitude dropoff_latitude
dropoff_longitude trip_miles pickup_census_tract
dropoff_census_tract 付款方式公司
trip_seconds dropoff_community_area 提示

安装Jupyter扩展

 jupyter nbextension enable --py widgetsnbextension
jupyter nbextension install --py --symlink tensorflow_model_analysis
jupyter nbextension enable --py tensorflow_model_analysis
 

安装TensorFlow模型分析(TFMA)

这将拉动在所有的依赖关系,并将采取一分钟。请忽略这些警告。

 import sys

# Confirm that we're using Python 3
assert sys.version_info.major is 3, 'Oops, not running Python 3. Use Runtime > Change runtime type'
 
 import tensorflow as tf
print('TF version: {}'.format(tf.__version__))

print('Installing Apache Beam')
!pip install -Uq apache_beam==2.17.0
import apache_beam as beam
print('Beam version: {}'.format(beam.__version__))

# Install TFMA
# This will pull in all the dependencies, and will take a minute
# Please ignore the warnings
!pip install -q tensorflow-model-analysis==0.21.3

import tensorflow as tf
import tensorflow_model_analysis as tfma
print('TFMA version: {}'.format(tfma.version.VERSION_STRING))
 
TF version: 2.2.0
Installing Apache Beam
Beam version: 2.17.0
ERROR: tfx-bsl 0.22.1 has requirement apache-beam[gcp]<3,>=2.20, but you'll have apache-beam 2.17.0 which is incompatible.
ERROR: tfx-bsl 0.22.1 has requirement pyarrow<0.17,>=0.16.0, but you'll have pyarrow 0.15.1 which is incompatible.
ERROR: tfx-bsl 0.22.1 has requirement tensorflow-metadata<0.23,>=0.22.2, but you'll have tensorflow-metadata 0.21.2 which is incompatible.

Error importing tfx_bsl_extension.coders. Some tfx_bsl functionalities are not available
TFMA version: 0.21.3

载入的文件

我们将下载的一切,我们需要一个tar文件。包括了:

  • 培训和评估数据集
  • 数据模式
  • 培训结果EvalSavedModels
 # Download the tar file from GCP and extract it
import io, os, tempfile
BASE_DIR = tempfile.mkdtemp()
TFMA_DIR = os.path.join(BASE_DIR, 'eval_saved_models-0.15.0')
DATA_DIR = os.path.join(TFMA_DIR, 'data')
OUTPUT_DIR = os.path.join(TFMA_DIR, 'output')
SCHEMA = os.path.join(TFMA_DIR, 'schema.pbtxt')

!wget https://storage.googleapis.com/artifacts.tfx-oss-public.appspot.com/datasets/eval_saved_models-0.15.0.tar
!tar xf eval_saved_models-0.15.0.tar
!mv eval_saved_models-0.15.0 {BASE_DIR}
!rm eval_saved_models-0.15.0.tar

print("Here's what we downloaded:")
!ls -R {TFMA_DIR}
 
--2020-07-27 09:11:38--  https://storage.googleapis.com/artifacts.tfx-oss-public.appspot.com/datasets/eval_saved_models-0.15.0.tar
Resolving storage.googleapis.com (storage.googleapis.com)... 64.233.189.128, 108.177.97.128, 108.177.125.128, ...
Connecting to storage.googleapis.com (storage.googleapis.com)|64.233.189.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4311040 (4.1M) [application/x-tar]
Saving to: ‘eval_saved_models-0.15.0.tar’

eval_saved_models-0 100%[===================>]   4.11M  12.3MB/s    in 0.3s    

2020-07-27 09:11:39 (12.3 MB/s) - ‘eval_saved_models-0.15.0.tar’ saved [4311040/4311040]

Here's what we downloaded:
/tmp/tmpgq6r13oe/eval_saved_models-0.15.0:
data  run_0  run_1  run_2  schema.pbtxt

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/data:
eval  train

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/data/eval:
data.csv

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/data/train:
data.csv

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_0:
eval_model_dir

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_0/eval_model_dir:
1578507304

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_0/eval_model_dir/1578507304:
assets  saved_model.pb  variables

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_0/eval_model_dir/1578507304/assets:
vocab_compute_and_apply_vocabulary_1_vocabulary
vocab_compute_and_apply_vocabulary_vocabulary

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_0/eval_model_dir/1578507304/variables:
variables.data-00000-of-00001  variables.index

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_1:
eval_model_dir

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_1/eval_model_dir:
1578507304

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_1/eval_model_dir/1578507304:
assets  saved_model.pb  variables

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_1/eval_model_dir/1578507304/assets:
vocab_compute_and_apply_vocabulary_1_vocabulary
vocab_compute_and_apply_vocabulary_vocabulary

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_1/eval_model_dir/1578507304/variables:
variables.data-00000-of-00001  variables.index

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_2:
eval_model_dir

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_2/eval_model_dir:
1578507304

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_2/eval_model_dir/1578507304:
assets  saved_model.pb  variables

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_2/eval_model_dir/1578507304/assets:
vocab_compute_and_apply_vocabulary_1_vocabulary
vocab_compute_and_apply_vocabulary_vocabulary

/tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_2/eval_model_dir/1578507304/variables:
variables.data-00000-of-00001  variables.index

解析模式

在我们下载的东西是为被创造我们的数据架构TensorFlow数据验证 。现在我们进一步分析,现在让我们可以与TFMA使用它。

 from google.protobuf import text_format
from tensorflow.python.lib.io import file_io
from tensorflow_metadata.proto.v0 import schema_pb2
from tensorflow.core.example import example_pb2

schema = schema_pb2.Schema()
contents = file_io.read_file_to_string(SCHEMA)
schema = text_format.Parse(contents, schema)
 

使用模式来创建TFRecords

我们需要给我们的数据TFMA访问,让我们创建一个TFRecords文件。我们可以用我们的模式来创建它,因为它给了我们正确的类型每个功能。

 import csv

datafile = os.path.join(DATA_DIR, 'eval', 'data.csv')
reader = csv.DictReader(open(datafile, 'r'))
examples = []
for line in reader:
  example = example_pb2.Example()
  for feature in schema.feature:
    key = feature.name
    if len(line[key]) > 0:
      if feature.type == schema_pb2.FLOAT:
        example.features.feature[key].float_list.value[:] = [float(line[key])]
      elif feature.type == schema_pb2.INT:
        example.features.feature[key].int64_list.value[:] = [int(line[key])]
      elif feature.type == schema_pb2.BYTES:
        example.features.feature[key].bytes_list.value[:] = [line[key].encode('utf8')]
    else:
      if feature.type == schema_pb2.FLOAT:
        example.features.feature[key].float_list.value[:] = []
      elif feature.type == schema_pb2.INT:
        example.features.feature[key].int64_list.value[:] = []
      elif feature.type == schema_pb2.BYTES:
        example.features.feature[key].bytes_list.value[:] = []
  examples.append(example)

TFRecord_file = os.path.join(BASE_DIR, 'train_data.rio')
with tf.io.TFRecordWriter(TFRecord_file) as writer:
  for example in examples:
    writer.write(example.SerializeToString())
  writer.flush()
  writer.close()

!ls {TFRecord_file}
 
/tmp/tmpgq6r13oe/train_data.rio

运行TFMA和渲染指标

现在,我们可以创建一个函数,我们将用它来运行TFMA和渲染指标。它需要一个EvalSavedModel ,列表SliceSpecs和索引到SliceSpec列表。它将使用创建EvalResult tfma.run_model_analysis ,并用它来创建一个SlicingMetricsViewer使用tfma.view.render_slicing_metrics ,这将使用我们创建切片使我们的数据集的可视化。

 def run_and_render(eval_model=None, slice_list=None, slice_idx=0):
  """Runs the model analysis and renders the slicing metrics

  Args:
      eval_model: An instance of tf.saved_model saved with evaluation data
      slice_list: A list of tfma.slicer.SingleSliceSpec giving the slices
      slice_idx: An integer index into slice_list specifying the slice to use

  Returns:
      A SlicingMetricsViewer object if in Jupyter notebook; None if in Colab.
  """
  eval_result = tfma.run_model_analysis(eval_shared_model=eval_model,
                                          data_location=TFRecord_file,
                                          file_format='tfrecords',
                                          slice_spec=slice_list,
                                          output_path='sample_data',
                                          extractors=None)
  return tfma.view.render_slicing_metrics(eval_result, slicing_spec=slice_list[slice_idx])
 

切片和切块

我们以前训练的模型,现在我们已经加载的结果。让我们来看看我们的可视化,开始使用TFMA沿着特定的功能片。但首先,我们需要从我们以前的训练运行的一个在EvalSavedModel阅读。

情节是互动的:

  • 单击并拖动以平移
  • 滚动缩放
  • 右键点击重置视图

只需将光标悬停所需的数据点看到更多的细节。从四种不同类型的使用底部的选择地块的选择。

例如,我们将设置slicing_columntrip_start_hour在我们的功能SliceSpec

 # Load the TFMA results for the first training run
# This will take a minute
eval_model_base_dir_0 = os.path.join(TFMA_DIR, 'run_0', 'eval_model_dir')
eval_model_dir_0 = os.path.join(eval_model_base_dir_0, next(os.walk(eval_model_base_dir_0))[1][0])
eval_shared_model_0 = tfma.default_eval_shared_model(eval_saved_model_path=eval_model_dir_0)

# Slice our data by the trip_start_hour feature
slices = [tfma.slicer.SingleSliceSpec(columns=['trip_start_hour'])]

run_and_render(eval_model=eval_shared_model_0, slice_list=slices, slice_idx=0)
 
WARNING:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta
WARNING:tensorflow:From /tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow_model_analysis/eval_saved_model/load.py:169: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0.

Warning:tensorflow:From /tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow_model_analysis/eval_saved_model/load.py:169: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0.

INFO:tensorflow:Restoring parameters from /tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_0/eval_model_dir/1578507304/variables/variables

INFO:tensorflow:Restoring parameters from /tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_0/eval_model_dir/1578507304/variables/variables

Warning:tensorflow:From /tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow_model_analysis/eval_saved_model/graph_ref.py:189: get_tensor_from_tensor_info (from tensorflow.python.saved_model.utils_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.utils.get_tensor_from_tensor_info or tf.compat.v1.saved_model.get_tensor_from_tensor_info.

Warning:tensorflow:From /tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow_model_analysis/eval_saved_model/graph_ref.py:189: get_tensor_from_tensor_info (from tensorflow.python.saved_model.utils_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.utils.get_tensor_from_tensor_info or tf.compat.v1.saved_model.get_tensor_from_tensor_info.

Warning:tensorflow:From /tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/ops/resource_variable_ops.py:1666: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.

Warning:tensorflow:From /tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow/python/ops/resource_variable_ops.py:1666: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
WARNING:root:Couldn't find python-snappy so the implementation of _TFRecordUtil._masked_crc32c is not as fast as it could be.

Warning:tensorflow:From /tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow_model_analysis/writers/metrics_and_plots_serialization.py:125: tf_record_iterator (from tensorflow.python.lib.io.tf_record) is deprecated and will be removed in a future version.
Instructions for updating:
Use eager execution and: 
`tf.data.TFRecordDataset(path)`

Warning:tensorflow:From /tmpfs/src/tf_docs_env/lib/python3.6/site-packages/tensorflow_model_analysis/writers/metrics_and_plots_serialization.py:125: tf_record_iterator (from tensorflow.python.lib.io.tf_record) is deprecated and will be removed in a future version.
Instructions for updating:
Use eager execution and: 
`tf.data.TFRecordDataset(path)`

SlicingMetricsViewer(config={'weightedExamplesColumn': 'post_export_metrics/example_count'}, data=[{'slice': '…

片概述

默认的可视化是片概述当片的数量较少。它显示了度量为每个切片的值。既然我们已经选择trip_start_hour以上,它向我们展示像准确性和AUC每个小时,这使得我们可以寻找特定于几个小时,而不是别人的问题指标。

在可视化以上:

  • 尝试排序功能列,这是我们trip_start_hours列标题功能,通过点击
  • 尝试通过精密排序和通知,对于一些与实例小时精度为0,这可能表明有问题

该图表还允许我们选择在我们的切片显示不同的指标。

  • 尝试从“查看”菜单中选择不同的指标
  • 尝试在“显示”菜单中选择召回,并通知说对一些与实例小时召回是0,这可能表明一个问题

另外,也可以设置一个阈值来滤除与更小的数字的例子,或“权重”切片。您可以键入的例子最小数,或使用滑块。

指标柱状图

此视图还支持度量直方图作为替代可视化,这也是默认视图时片的数目是大的。结果将分为水桶和切片/总权重的数目/既可以可视化。列可以通过单击列标题进行排序。具有小权重的切片可以通过设置阈值来滤除。进一步的过滤可以通过拖动灰带被应用。要重置的范围内,双击带。过滤还可以用于除去在可视化和异常值的指标表。点击齿轮图标切换到一个对数标度,而不是线性刻度。

  • 尝试在可视化菜单中选择“指标柱状图”

多个片

让我们创建的整个列表SliceSpec s,这将使我们能够选择列表中的任何切片的。我们将选择trip_start_day由设置切片(本周日) slice_idx1尝试改变slice_idx02并再次运行检查不同的切片。

 slices = [tfma.slicer.SingleSliceSpec(columns=['trip_start_hour']),
          tfma.slicer.SingleSliceSpec(columns=['trip_start_day']),
          tfma.slicer.SingleSliceSpec(columns=['trip_start_month'])]
run_and_render(eval_model=eval_shared_model_0, slice_list=slices, slice_idx=1)
 
WARNING:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta

Warning:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta
WARNING:root:Deleting 1 existing files in target path matching: 
WARNING:root:Deleting 1 existing files in target path matching: 
WARNING:root:Deleting 1 existing files in target path matching: 

SlicingMetricsViewer(config={'weightedExamplesColumn': 'post_export_metrics/example_count'}, data=[{'slice': '…

您可以创建功能交叉分析的特征的组合。让我们创建一个SliceSpec看的横trip_start_daytrip_start_hour

 slices = [tfma.slicer.SingleSliceSpec(columns=['trip_start_day', 'trip_start_hour'])]
run_and_render(eval_shared_model_0, slices, 0)
 
WARNING:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta

Warning:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta
WARNING:root:Deleting 1 existing files in target path matching: 
WARNING:root:Deleting 1 existing files in target path matching: 
WARNING:root:Deleting 1 existing files in target path matching: 

SlicingMetricsViewer(config={'weightedExamplesColumn': 'post_export_metrics/example_count'}, data=[{'slice': '…

跨越两列创造了很多的组合!让我们的跨只能看看缩小那个开始在中午人次 。然后我们选择accuracy从可视化:

 slices = [tfma.slicer.SingleSliceSpec(columns=['trip_start_day'], features=[('trip_start_hour', 12)])]
run_and_render(eval_shared_model_0, slices, 0)
 
WARNING:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta

Warning:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta
WARNING:root:Deleting 1 existing files in target path matching: 
WARNING:root:Deleting 1 existing files in target path matching: 
WARNING:root:Deleting 1 existing files in target path matching: 

SlicingMetricsViewer(config={'weightedExamplesColumn': 'post_export_metrics/example_count'}, data=[{'slice': '…

跟踪模型性能随时间

你的训练数据集将被用于训练模型,并有望能代表您的测试数据集,并会在生产中被发送到你的模型中的数据。然而,虽然在推断请求的数据可以保持相同的训练数据,在许多情况下,开始改变足以使你的模型的性能会发生变化。

这意味着你需要监测和持续的基础上衡量模型的性能,这样就可以做到心中有数和对变化做出反应。让我们来看看TFMA如何帮助。

衡量业绩的新数据

我们下载了上述三个不同的培训运行的结果,让我们负担他们现在使用TFMA,看看他们如何比较使用render_time_series 。我们可以指定特定的切片来看待。让我们比较一下我们的训练运行的车次是开始于中午。

  • 从下拉菜单中选择一个指标,添加的时间序列图的该指标
  • 关闭不必要的图表
  • 将鼠标悬停在数据点(线段图中的端部),以获得更多的细节
 def get_eval_result(base_dir, output_dir, data_loc, slice_spec):
  eval_model_dir = os.path.join(base_dir, next(os.walk(base_dir))[1][0])
  eval_shared_model = tfma.default_eval_shared_model(eval_saved_model_path=eval_model_dir)

  return tfma.run_model_analysis(eval_shared_model=eval_shared_model,
                                          data_location=data_loc,
                                          file_format='tfrecords',
                                          slice_spec=slice_spec,
                                          output_path=output_dir,
                                          extractors=None)

slices = [tfma.slicer.SingleSliceSpec()]
output_dir_0 = os.path.join(TFMA_DIR, 'output', 'run_0')
result_ts0 = get_eval_result(os.path.join(TFMA_DIR, 'run_0', 'eval_model_dir'),
                             output_dir_0, TFRecord_file, slices)
output_dir_1 = os.path.join(TFMA_DIR, 'output', 'run_1')
result_ts1 = get_eval_result(os.path.join(TFMA_DIR, 'run_1', 'eval_model_dir'),
                             output_dir_1, TFRecord_file, slices)
output_dir_2 = os.path.join(TFMA_DIR, 'output', 'run_2')
result_ts2 = get_eval_result(os.path.join(TFMA_DIR, 'run_2', 'eval_model_dir'),
                             output_dir_2, TFRecord_file, slices)
 
WARNING:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta

Warning:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta

INFO:tensorflow:Restoring parameters from /tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_0/eval_model_dir/1578507304/variables/variables

INFO:tensorflow:Restoring parameters from /tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_0/eval_model_dir/1578507304/variables/variables

Warning:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta

Warning:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta

INFO:tensorflow:Restoring parameters from /tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_1/eval_model_dir/1578507304/variables/variables

INFO:tensorflow:Restoring parameters from /tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_1/eval_model_dir/1578507304/variables/variables

Warning:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta

Warning:tensorflow:Tensorflow version (2.2.0) found. Note that TFMA support for TF 2.0 is currently in beta

INFO:tensorflow:Restoring parameters from /tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_2/eval_model_dir/1578507304/variables/variables

INFO:tensorflow:Restoring parameters from /tmp/tmpgq6r13oe/eval_saved_models-0.15.0/run_2/eval_model_dir/1578507304/variables/variables

它是如何今天看?

首先,我们假设我们已经训练和部署我们的模型昨天,现在我们想看看它是如何做的新的数据在今天到来。可视化将通过显示精度启动。通过使用“添加公制系列”菜单中选择Add AUC和平均损失。

 eval_results_from_disk = tfma.load_eval_results([output_dir_0, output_dir_1],
                                                tfma.constants.MODEL_CENTRIC_MODE)

tfma.view.render_time_series(eval_results_from_disk, slices[0])
 
TimeSeriesViewer(config={'isModelCentric': True}, data=[{'metrics': {'': {'': {'precision': {'doubleValue': 0.…

现在我们来想象,又一天过去了,我们想看看它是如何做的新的数据在今天到来,相比前两天。再次使用“添加公制系列”菜单中添加AUC和平均损失:

 eval_results_from_disk = tfma.load_eval_results([output_dir_0, output_dir_1, output_dir_2],
                                                tfma.constants.MODEL_CENTRIC_MODE)

tfma.view.render_time_series(eval_results_from_disk, slices[0])
 
TimeSeriesViewer(config={'isModelCentric': True}, data=[{'metrics': {'': {'': {'label/mean': {'doubleValue': 0…