SDV
SDV copied to clipboard
HMA likelihood match should respect cardinality
Environment Details
Please indicate the following details about the environment in which you found the bug:
- SDV version:
- Python version:
- Operating System:
Error Description
Currently, demo datasets that have children with multiple parents do not have a DiagnosticScore of 1 for RelationshipValidity. This is most likely due to the likelihood match step, which does not take cardinality into account when assigning parent values as foreign keys.
The likelihood match step should be updated so that cardinality is respected.
Steps to reproduce
from sdv.datasets.demo import download_demo
from sdv.multi_table import HMASynthesizer
from sdmetrics.reports.multi_table import DiagnosticReport
data, metadata = download_demo('multi_table', 'Dunur_v1')
synthesizer = HMASynthesizer(metadata)
synthesizer.fit(data)
sample = synthesizer.sample()
report = DiagnosticReport()
report.generate(data, sample, metadata.to_dict(), verbose=False)
report.get_details('Relationship Validity')