Пример #1
0
def make_eval_results(results, mode):
    """Run model analysis for a single model on multiple data sets.

  Args:
    results: A list of TFMA evaluation results.
    mode: The mode of the evaluation. Currently, tfma.DATA_CENTRIC_MODE and
    tfma.MODEL_CENTRIC_MODE are supported.

  Returns:
    An EvalResults containing all evaluation results. This can be used to
    construct a time series view.
  """
    return api_types.EvalResults(results, mode)
Пример #2
0
def multiple_model_analysis(model_locations, data_location, **kwargs):
    """Run model analysis for multiple models on the same data set.

  Args:
    model_locations: A list of paths to the export eval saved model.
    data_location: The location of the data files.
    **kwargs: The args used for evaluation. See tfma.run_model_analysis() for
      details.

  Returns:
    A tfma.EvalResults containing all the evaluation results with the same order
    as model_locations.
  """
    results = []
    for m in model_locations:
        results.append(run_model_analysis(m, data_location, **kwargs))
    return api_types.EvalResults(results, constants.MODEL_CENTRIC_MODE)
Пример #3
0
def multiple_data_analysis(model_location, data_locations, **kwargs):
    """Run model analysis for a single model on multiple data sets.

  Args:
    model_location: The location of the exported eval saved model.
    data_locations: A list of data set locations.
    **kwargs: The args used for evaluation. See tfma.run_model_analysis() for
      details.

  Returns:
    A tfma.EvalResults containing all the evaluation results with the same order
    as data_locations.
  """
    results = []
    for d in data_locations:
        results.append(run_model_analysis(model_location, d, **kwargs))
    return api_types.EvalResults(results, constants.DATA_CENTRIC_MODE)
Пример #4
0
    def _makeEvalResults(self):
        result_a = api_types.EvalResult(
            slicing_metrics=self._makeTestData(),
            plots=None,
            config=api_types.EvalConfig(example_weight_metric_key=None,
                                        slice_spec=None,
                                        data_location=self.data_location_1,
                                        model_location=self.model_location_1))

        result_b = api_types.EvalResult(
            slicing_metrics=[self.result_c2],
            plots=None,
            config=api_types.EvalConfig(
                example_weight_metric_key=None,
                slice_spec=None,
                data_location=self.full_data_location_2,
                model_location=self.full_model_location_2))
        return api_types.EvalResults([result_a, result_b],
                                     constants.MODEL_CENTRIC_MODE)