# \[Resolved\] Error when fitting HSASynthesizer

**URL:** <https://forum.datacebo.com/t/resolved-error-when-fitting-hsasynthesizer/174>\
**Category:** Synthetic Data Creation\
**Tags:** bug\
**Created:** [May 2, 2024, 8:05am UTC](https://forum.datacebo.com/t/resolved-error-when-fitting-hsasynthesizer/174 "2024-05-02T08:05:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashok.kumar.muthimen](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@ashok.kumar.muthimen](https://forum.datacebo.com/u/ashok.kumar.muthimen)\
**Post date:** [May 2, 2024, 8:05am UTC](https://forum.datacebo.com/t/resolved-error-when-fitting-hsasynthesizer/174/1 "2024-05-02T08:05:53Z")

</div>

Hi @neha , facing issue while creating datafarme from synthsized data.

> > > hsas = HSASynthesizer(metadata)  
> > > hsas.fit(data)  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in   
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/sdv/multi\_table/base.py”, line 385, in fit  
> > > processed\_data = self.preprocess(data)  
> > > File “packaging/sdv\_enterprise/sdv/multi\_table/hsa/hsa.pyx”, line 29, in sdv\_enterprise.sdv.multi\_table.hsa.hsa.expirable.wrapper  
> > > File “packaging/sdv\_enterprise/sdv/multi\_table/hsa/hsa.pyx”, line 89, in sdv\_enterprise.sdv.multi\_table.hsa.hsa.HSASynthesizer.preprocess  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/sdv/multi\_table/base.py”, line 338, in preprocess  
> > > processed\_data[table\_name] = synthesizer.\_preprocess(table\_data)  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/sdv/single\_table/base.py”, line 347, in \_preprocess  
> > > self.\_data\_processor.fit(data)  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/sdv/data\_processing/data\_processor.py”, line 754, in fit  
> > > self.\_fit\_hyper\_transformer(constrained)  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/sdv/data\_processing/data\_processor.py”, line 669, in \_fit\_hyper\_transformer  
> > > self.\_hyper\_transformer.fit(data)  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/rdt/hyper\_transformer.py”, line 749, in fit  
> > > data = self.\_fit\_field\_transformer(data, field, self.field\_transformers[field])  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/rdt/hyper\_transformer.py”, line 671, in \_fit\_field\_transformer  
> > > transformer.fit(data, field)  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/rdt/transformers/base.py”, line 55, in wrapper  
> > > return function(self, \*args, \*\*kwargs)  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/rdt/transformers/base.py”, line 390, in fit  
> > > self.\_fit(columns\_data)  
> > > File “packaging/sdv\_enterprise/rdt/transformers/email/email.pyx”, line 189, in sdv\_enterprise.rdt.transformers.email.email.DomainBasedAnonymizer.\_fit  
> > > File “packaging/sdv\_enterprise/rdt/transformers/email/utils.pyx”, line 50, in sdv\_enterprise.rdt.transformers.email.utils.validate\_email\_address  
> > > rdt.errors.InvalidDataError: The input data must be email addresses. Data contains (‘Y’, ‘Y’, + 887 more).  
> > > hsas.save(‘/saswork/sample\_single.pkl’)  
> > > synthesizer = HSASynthesizer.load(‘/saswork/sample\_single.pkl’)  
> > > synthetic\_data = synthesizer.sample(scale=1)  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in   
> > > File “packaging/sdv\_enterprise/sdv/multi\_table/hsa/hsa.pyx”, line 29, in sdv\_enterprise.sdv.multi\_table.hsa.hsa.expirable.wrapper  
> > > File “packaging/sdv\_enterprise/sdv/multi\_table/hsa/hsa.pyx”, line 113, in sdv\_enterprise.sdv.multi\_table.hsa.hsa.HSASynthesizer.sample  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/sdv/multi\_table/base.py”, line 414, in sample  
> > > sampled\_data = self.\_sample(scale=scale)  
> > > File “/sasdata/python3.8/lib/python3.8/site-packages/sdv/sampling/independent\_sampler.py”, line 148, in \_sample  
> > > num\_rows = int(self.\_table\_sizes[table] \* scale)  
> > > KeyError: ‘master’

---

<div class="post-metadata">

**Author:** ![neha](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.datacebo.com/neha/32/15_2.png) [@neha](https://forum.datacebo.com/u/neha)\
**Post date:** [May 2, 2024, 2:35pm UTC](https://forum.datacebo.com/t/resolved-error-when-fitting-hsasynthesizer/174/2 "2024-05-02T14:35:02Z")

</div>

Hi @ashok.kumar.muthimen thank you for providing us with the detailed information. From the detailed error message, this particular line stands out to me:

> The input data must be email addresses. Data contains (‘Y’, ‘Y’, + 887 more).

This indicates that there is a **mismatch between the data and the metadata**. The metadata mentions that a column contains emails (eg. `"johndoe@gmail.com"`), but in reality the data contains other values such as `"Y"`.

From looking at your metadata, I see that there are 5 columns currently specified as sdtype `"email"`. Could you double-check to ensure that this is correct? If any of these columns _do not_ contain email addresses, it is best to change them to the proper sdtype such as `"categorical"`.

_Do note that the SDV uses metadata as the ground source-of-truth about your data. To prevent bugs during fitting, sampling, and evaluation it is crucial to ensure that the metadata is accurate._
