sdv-dev / SDV

Synthetic data generation for tabular data
https://docs.sdv.dev/sdv
Other
2.36k stars 310 forks source link

Encountered with an error when excecuting the 'Quick usage' module in PAR model #221

Closed Haris-uni closed 4 years ago

Haris-uni commented 4 years ago

Description

Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.

Description: I was trying to just execute the 'Quick Usage' with Demo data from PAR model. which is described in SDV module under userguide --> time series data --> Models. I have given the complete code below. It did not executed and given the following error.

What I Did

##########the Script what I did is given here####################### from sdv.demo import load_timeseries_demo from sdv.timeseries import PAR

data = load_timeseries_demo()

print(data)

data.head() entity_columns = ['Symbol']

context_columns = ['MarketCap', 'Sector', 'Industry']

sequence_index = 'Date'

model = PAR(entity_columns=entity_columns, context_columns=context_columns, sequence_index=sequence_index, )

model.fit(data)

model.save('my_model.pkl')

Encountered error here

Traceback (most recent call last): File "/tmp/pycharm_project_988/sdv_module_trial_demo.py", line 18, in model.fit(data) File "/usr/local/lib/python3.7/dist-packages/sdv/timeseries/base.py", line 193, in fit self._metadata.fit(timeseries_data) File "/usr/local/lib/python3.7/dist-packages/sdv/metadata/table.py", line 487, in fit self._fit_hyper_transformer(constrained, extra_columns) File "/usr/local/lib/python3.7/dist-packages/sdv/metadata/table.py", line 385, in _fit_hyper_transformer self._hyper_transformer.fit(data[list(dtypes.keys())]) File "/usr/local/lib/python3.7/dist-packages/pandas/core/frame.py", line 2908, in getitem indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1] File "/usr/local/lib/python3.7/dist-packages/pandas/core/indexing.py", line 1254, in _get_listlike_indexer self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing) File "/usr/local/lib/python3.7/dist-packages/pandas/core/indexing.py", line 1293, in _validate_read_indexer missing = (missing_mask).sum() File "/usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py", line 47, in _sum return umr_sum(a, axis, dtype, out, keepdims, initial, where) TypeError: int() argument must be a string, a bytes-like object or a number, not '_NoValueType'

Process finished with exit code 1

Thanks in advance

csala commented 4 years ago

Hi @Haris-uni thanks for all the details.

I did several trials and I'm not able to reproduce the error :-(

Would you mind pasting (or attaching) the output of the following command?

pip freeze

Also, from the paths in the traceback it seems to me that you installed sdv systemwide, not within a virtualenv. If so, would you mind creating a virtualenv and installing sdv within it?

Haris-uni commented 4 years ago

Hello @csala , thank you very much for the help it is now working.