yandex-research / tab-ddpm

[ICML 2023] The official implementation of the paper "TabDDPM: Modelling Tabular Data with Diffusion Models"
https://arxiv.org/abs/2209.15421
MIT License
397 stars 89 forks source link

fix: fix to save the categorical values with type casting #19

Open koseoyoung opened 1 year ago

koseoyoung commented 1 year ago

works on #18

Previously it has such error:

 [],
 [],
 [],
 [],
 [],
 [],
 [],
 [],
 [],
 [],
 [],
 [],
 [Unable to show a serialized python object.]]

The root cause of this issue is that np.save requires np data type, which is str when we save the generated cat file (which contains string value) into the disk. I fixed it through this PR. #19

After this fix:

[['Spain', '1', '1', '0'],
 ['Germany', '0', '1', '0'],
 ['Germany', '0', '1', '0'],
 ['Germany', '1', '1', '0'],
 ['Germany', '1', '0', '0'],
 ['Spain', '0', '1', '1'],
 ['Spain', '1', '0', '0'],
 ['Germany', '0', '1', '1'],
 ['Spain', '0', '1', '0'],
 ['Spain', '1', '1', '0'],
 ['Spain', '1', '1', '0'],
 ['France', '1', '0', '0'],
 ['Germany', '1', '1', '0'],
 ['Germany', '0', '1', '0'],
 ['Spain', '0', '0', '1'],
 ['France', '1', '0', '0'],
 ['France', '0', '1', '1'],
 ['Spain', '1', '1', '0'],
 ['Spain', '1', '1', '0'],
 ['France', '0', '0', '1'],
 ['France', '0', '1', '0'],
 ['Spain', '0', '1', '0'],
 ['Germany', '0', '1', '0'],