Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMA sampling fails when child table is given a distribution other than beta #2306

Open
amontanez24 opened this issue Nov 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@amontanez24
Copy link
Contributor

Environment Details

Please indicate the following details about the environment in which you found the bug:

  • SDV version: 1.17.2
  • Python version: Any
  • Operating System: Any

Error Description

If you use a distribution other than beta on a child column when using HMASynthesizer, it fails with the following warning:

Preprocess Tables: 100%|██████████| 2/2 [00:00<00:00,  3.55it/s]

Learning relationships:
(1/1) Tables 'hotels' and 'guests' ('hotel_id'): 100%|██████████| 10/10 [00:06<00:00,  1.60it/s]

Modeling Tables: 100%|██████████| 2/2 [00:01<00:00,  1.17it/s]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-0fddabb97028> in <cell line: 16>()
     14 # )
     15 synthesizer.fit(data)
---> 16 synthetic_data = synthesizer.sample()
     17 
     18 synthesizer.get_learned_distributions('hotels')

11 frames
/usr/local/lib/python3.10/dist-packages/scipy/stats/_distn_infrastructure.py in ppf(self, q, *args, **kwds)
   2233 
   2234         """
-> 2235         args, loc, scale = self._parse_args(*args, **kwds)
   2236         q, loc, scale = map(asarray, (q, loc, scale))
   2237         args = tuple(map(asarray, args))

TypeError: _parse_args() got an unexpected keyword argument 'a'

It seems that somewhere we hardcoded a check for beta parameters.

Steps to reproduce

from sdv.datasets.demo import download_demo
from sdv.multi_table import HMASynthesizer

data, metadata = download_demo('multi_table', 'fake_hotels')

synthesizer = HMASynthesizer(metadata)
guests_distributions = {'room_type': 'norm', 'amenities_fee': 'norm'}
synthesizer.set_table_parameters(
    'guests', {'numerical_distributions': guests_distributions}
)
# synthesizer.set_table_parameters(
#     'hotels',
#     {'numerical_distributions': {'rating': 'norm'}},
# )
synthesizer.fit(data)
synthetic_data = synthesizer.sample()

synthesizer.get_learned_distributions('hotels')
@amontanez24 amontanez24 added the bug Something isn't working label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant