sdv-dev / SDV

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

Problem in fitting demo timeseries data! #217

Closed Haris-uni closed 4 years ago

Haris-uni commented 4 years ago

Description

Just i am trying to execute the demo data fitting for PAR model with sdv.timeseries module. but the following error occured.

What I Did

from sdv.demo import load_timeseries_demo from sdv.timeseries import PAR

data = load_timeseries_demo()

print(data)

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)

Error occurered

File "C:\Users\xyz\Anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 670, in astype_nansafe "to [{to_dtype}]".format(from_dtype=arr.dtype, to_dtype=dtype) TypeError: cannot astype a datetimelike from [datetime64[ns]] to [int32]

csala commented 4 years ago

Hi @Haris-uni I think the problem is similar to what was reported on #205

The problem seems to happen only on Windows systems, which we do not fully support at the moment, so I just opened a new issue with a more accurate description to keep track of this until we find a fix and add support work Windows systems.

Meanwhile, if you switch to *nix environments like Mac or Linux, there should be no problem.

Haris-uni commented 4 years ago

Thanks for the response @csala . As you sugggested i tried in a Linux OS system and I was encountered withe following error while fitting the sample time series data. Can you please help with this issue. Thanks

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

TypeError: int() argument must be a string, a bytes-like object or a number, not '_NoValueType'

csala commented 4 years ago

Hi @Haris-uni ! I'm afraid I need some more details to know what's going on.

Since this is a different error than the one that you reported before, would you mind opening a new issue for this one?

Please make sure to include all the details:

  1. The versions (SDV and python) that you are using
  2. The OS which you are running on
  3. The steps that you executed and the output that you obtained.