worldbank / REaLTabFormer

A suite of auto-regressive and Seq2Seq (sequence-to-sequence) transformer models for tabular and relational synthetic data generation.
https://worldbank.github.io/REaLTabFormer/
MIT License
203 stars 23 forks source link

Problem when fitting dataframe with only categorical features. #6

Closed echatzikyriakidis closed 1 year ago

echatzikyriakidis commented 1 year ago

@avsolatorio Hi!

This line of code fails when fitting a dataframe that contains only Categorical features. Because no numerical or datetime features exists the list is empty and the pd.concat fails.

https://github.com/avsolatorio/REaLTabFormer/blob/311470accc400e4c7fae6fb2d8a7f9c3988b7b19/src/realtabformer/data_utils.py#L495

echatzikyriakidis commented 1 year ago

Maybe this is a good solution?

processed_df = pd.concat([pd.DataFrame()] + processed_series, axis=1)
avsolatorio commented 1 year ago

@echatzikyriakidis good catch, thank you so much for reporting this! I have made the patch of the suggested change. I will deploy an updated release by end of the month. 😃