Data Quality
Quality checks compare the statistical similarity between the real and synthetic data. Run through these to evaluate whether the synthetic data captures patterns from the real data. We don't expect the scores to be a perfect, 100%, but the results can point you towards the strengths and weaknesses of your synthesizer.
Quality Report
The Quality Report checks for statistical similarity between the real and the synthetic data for all the tables. Use this to discover which patterns the synthetic data has captured from the real data
evaluate_quality
Use this function to evaluate the quality of your synthetic data.
from sdv.evaluation import evaluate_quality
quality_report = evaluate_quality(
real_data=real_data,
synthetic_data=synthetic_data,
metadata=metadata)Generating report ...
(1/4) Evaluating Column Shapes: |██████████| 15/15 [00:00<00:00, 564.15it/s]|
Column Shapes Score: 85.61%
(2/4) Evaluating Column Pair Trends: |██████████| 55/55 [00:00<00:00, 110.40it/s]|
Column Pair Trends Score: 71.97%
(3/4) Evaluating Cardinality: |██████████| 1/1 [00:00<00:00, 53.27it/s]|
Cardinality Score: 70.0%
(4/4) Evaluating Intertable Trends: |██████████| 50/50 [00:00<00:00, 86.54it/s]|
Intertable Trends Score: 68.49%
Overall Score (Average): 74.02%Parameters:
(required)
real_data: The original training data, a dictionary mapping each table name (string) to a pandas.DataFrame containing the data.(required)
synthetic_data: Your synthetic data, a dictionary mapping each table name (string) to a pandas.DataFrame containing the data.(required)
metadata: A Metadata object with your metadataverbose: A boolean describing whether or not to print the report progress and results. Defaults toTrue. Set this toFalseto run the report silently.
Returns: An SDMetrics QualityReport object generated with your real and synthetic data
Interpreting the Score
The different types of data quality are summarized in the table below.
Column Shapes
The statistical similarity between the real and synthetic data for single columns of data. This is often called the marginal distribution of each column.
Column Pair Trends
The statistical similarity between the real and synthetic data for pairs of columns (within the same table). This is often called the correlation or bivariate distributions of the columns.
Cardinality
For multi-table data only. Within each parent/child relationship, the cardinality refers to the number of children that each parent has.
Intertable Trends
For multi-table data only. This is similar to column pair trends, but instead refers to columns between different tables. For example a column between a parent table and a different column in a child table.
get_details
This function returns details about the report's properties. Use it to pinpoint the exact columns or tables that are causing issues.
Parameters:
(required)
property_name: A string with the name of the property. One of:'Column Shapes','Column Pair Trends','Cardinality'or'Intertable Trends'.table_name: For multi table data, a string with the name of the table. If provided, you'll receive filtered results for the table.
Returns A pandas.DataFrame object with the detailed scores
save
Use this function to save the report object
Parameters:
(required)
filepath: The name of file to save the object. This must end with.pkl
Returns (None) Saves the report as a file
QualityReport.load
Use this function to load in a previously-saved quality report.
Parameters:
(required)
filepath: The name of the file where the report is stored
Returns An SDMetrics QualityReport object
FAQs
See the SDMetrics QualityReport for even more details about the metrics and properties included in the report.
Last updated