Source code for sdmetrics.multi_table.base

"""Base Multi Table metric class."""

from sdmetrics.base import BaseMetric


[docs]class MultiTableMetric(BaseMetric): """Base class for metrics that apply to multiple tables. Attributes: name (str): Name to use when reports about this metric are printed. goal (sdmetrics.goal.Goal): The goal of this metric. min_value (Union[float, tuple[float]]): Minimum value or values that this metric can take. max_value (Union[float, tuple[float]]): Maximum value or values that this metric can take. """ name = None goal = None min_value = None max_value = None @staticmethod def compute(real_data, synthetic_data, metadata=None): """Compute this metric. Args: real_data (dict[str, pandas.DataFrame]): The tables from the real dataset, passed as a dictionary of table names and pandas.DataFrames. synthetic_data (dict[str, pandas.DataFrame]): The tables from the synthetic dataset, passed as a dictionary of table names and pandas.DataFrames. metadata (dict): Multi-table metadata dict. If not passed, it is build based on the real_data fields and dtypes. Returns: Union[float, tuple[float]]: Metric output. """ raise NotImplementedError()