def compute_benchmark(synthesizer, datasets=DEFAULT_DATASETS, iterations=3):
    'Compute the scores of a synthesizer over a list of datasets.\n\n    The results are returned in a raw format as a ``pandas.DataFrame`` containing:\n        - One row for each dataset+scoring method (for example, a classifier)\n        - One column for each computed metric\n        - The columns:\n            - dataset\n            - distance\n            - name (of the scoring method)\n            - iteration\n\n    For example, evaluating a synthesizer on the ``adult`` and ``asia`` datasets with 2\n    iterations produces a table similar to this::\n\n        dataset             name  iter  distance  accuracy    f1  syn_likelihood  test_likelihood\n          adult  DecisionTree...     0       0.0      0.79  0.65             NaN              NaN\n          adult      AdaBoost...     0       0.0      0.85  0.67             NaN              NaN\n          adult      Logistic...     0       0.0      0.79  0.66             NaN              NaN\n          adult           MLP...     0       0.0      0.84  0.67             NaN              NaN\n          adult  DecisionTree...     1       0.0      0.80  0.66             NaN              NaN\n          adult      AdaBoost...     1       0.0      0.86  0.68             NaN              NaN\n          adult      Logistic...     1       0.0      0.79  0.65             NaN              NaN\n          adult           MLP...     1       0.0      0.84  0.64             NaN              NaN\n           asia     Bayesian ...     0       0.0       NaN   NaN           -2.23            -2.24\n           asia     Bayesian ...     1       0.0       NaN   NaN           -2.23            -2.24\n    '
    results = list()
    for dataset_name in datasets:
        LOGGER.info('Evaluating dataset %s', dataset_name)
        (train, test, meta, categoricals, ordinals) = load_dataset(dataset_name, benchmark=True)
        for iteration in range(iterations):
            try:
                synthesized = synthesizer(train, categoricals, ordinals)
                scores = compute_scores(train, test, synthesized, meta)
                scores['dataset'] = dataset_name
                scores['iteration'] = iteration
                results.append(scores)
            except Exception:
                LOGGER.exception('Error computing scores for %s on dataset %s - iteration %s', _get_synthesizer_name(synthesizer), dataset_name, iteration)
    return pd.concat(results, sort=False)
Compute the scores of a synthesizer over a list of datasets.

The results are returned in a raw format as a ``pandas.DataFrame`` containing:
    - One row for each dataset+scoring method (for example, a classifier)
    - One column for each computed metric
    - The columns:
        - dataset
        - distance
        - name (of the scoring method)
        - iteration

For example, evaluating a synthesizer on the ``adult`` and ``asia`` datasets with 2
iterations produces a table similar to this::

    dataset             name  iter  distance  accuracy    f1  syn_likelihood  test_likelihood
      adult  DecisionTree...     0       0.0      0.79  0.65             NaN              NaN
      adult      AdaBoost...     0       0.0      0.85  0.67             NaN              NaN
      adult      Logistic...     0       0.0      0.79  0.66             NaN              NaN
      adult           MLP...     0       0.0      0.84  0.67             NaN              NaN
      adult  DecisionTree...     1       0.0      0.80  0.66             NaN              NaN
      adult      AdaBoost...     1       0.0      0.86  0.68             NaN              NaN
      adult      Logistic...     1       0.0      0.79  0.65             NaN              NaN
      adult           MLP...     1       0.0      0.84  0.64             NaN              NaN
       asia     Bayesian ...     0       0.0       NaN   NaN           -2.23            -2.24
       asia     Bayesian ...     1       0.0       NaN   NaN           -2.23            -2.24
def compute_benchmark(synthesizer, datasets=DEFAULT_DATASETS, iterations=3):
    'Compute the scores of a synthesizer over a list of datasets.\n\n    The results are returned in a raw format as a ``pandas.DataFrame`` containing:\n        - One row for each dataset+scoring method (for example, a classifier)\n        - One column for each computed metric\n        - The columns:\n            - dataset\n            - distance\n            - name (of the scoring method)\n            - iteration\n\n    For example, evaluating a synthesizer on the ``adult`` and ``asia`` datasets with 2\n    iterations produces a table similar to this::\n\n        dataset             name  iter  distance  accuracy    f1  syn_likelihood  test_likelihood\n          adult  DecisionTree...     0       0.0      0.79  0.65             NaN              NaN\n          adult      AdaBoost...     0       0.0      0.85  0.67             NaN              NaN\n          adult      Logistic...     0       0.0      0.79  0.66             NaN              NaN\n          adult           MLP...     0       0.0      0.84  0.67             NaN              NaN\n          adult  DecisionTree...     1       0.0      0.80  0.66             NaN              NaN\n          adult      AdaBoost...     1       0.0      0.86  0.68             NaN              NaN\n          adult      Logistic...     1       0.0      0.79  0.65             NaN              NaN\n          adult           MLP...     1       0.0      0.84  0.64             NaN              NaN\n           asia     Bayesian ...     0       0.0       NaN   NaN           -2.23            -2.24\n           asia     Bayesian ...     1       0.0       NaN   NaN           -2.23            -2.24\n    '
    results = list()
    for dataset_name in datasets:
        LOGGER.info('Evaluating dataset %s', dataset_name)
        (train, test, meta, categoricals, ordinals) = load_dataset(dataset_name, benchmark=True)
        for iteration in range(iterations):
            try:
                synthesized = synthesizer(train, categoricals, ordinals)
                scores = compute_scores(train, test, synthesized, meta)
                scores['dataset'] = dataset_name
                scores['iteration'] = iteration
                results.append(scores)
            except Exception:
                LOGGER.exception('Error computing scores for %s on dataset %s - iteration %s', _get_synthesizer_name(synthesizer), dataset_name, iteration)
    return pd.concat(results, sort=False)