CategoryAdherence
This metric measures whether a synthetic column adheres to the same category values as the real data. (The synthetic data should not be inventing new category values that are not originally present in the real data.)
Data Compatibility
Categorical: This metric is meant for discrete, categorical data
Ordinal: This metric is meant for discrete, ordinal data
Boolean: This metric is meant for boolean data
If you have missing values in the real data, then the metric will consider them valid in the synthetic data. Otherwise, they will be marked as an invalid category. All types of missing values (NaN, None, etc. will be counted as the same category of 'missing'.)
Score
(best) 1.0: All category values in the synthetic data were present in the real data
(worst) 0.0: None of the category values in the synthetic data were present in the real data
Any score in between tells us the proportion of data points that are adhering to the correct values. For example, 0.6 means that 60% of synthetic data points have a value present in in the real data. Meanwhile, the remaining 40% contain new values that were never present in the real data.
How does it work?
This metric extracts the set of unique categories, that are present in the real column, Cr.
Then it finds the of data points of the synthetic data, s, that are found in the set C. The score is the proportion of these data points as compared to all the synthetic data points.
In some cases the allowable set of categories (C) as well as the allowable missing values may be more expansive than what is present in the real data. This can happen when your real data is actually a smaller subset of the entire database. In this case you can override the allowable ranges by providing the range_values and range_is_nullable parameters. If provided, these values will be used for checking the synthetic data rather than category values derived from the real data.
Usage
To manually apply this metric, access the single_column module and use the compute method.
Parameters
(required)
real_data: A pandas.Series object with the column of real data(required)
synthetic_data: A pandas.Series object with the column of synthetic datarange_values: A list containing all the allowable category values that the data can possible have. This may be more expansive than the values present in the real training data. If provided, this will be used as the set of unique categories, rather than compute it from thereal_data.range_is_nullable: A boolean describing whether the column is allowed to be null. This can beTrueeven if the real training data does not have any missing values. If provided, this value will be used instead of computing it from thereal_data.
FAQs
Last updated
