<jupyter_start><jupyter_text>1. Load the dataset<jupyter_code>real_data = pd.read_csv(HOME_PATH + TRAIN_FILE)
real_data
real_data.dtypes
discrete_columns = ['gender','cholesterol','gluc','smoke','alco','active','cardio']
discrete_columns
ctgan = CTGANSynthesizer()
ctgan.fit(real_data, discrete_columns)
synthetic_data = ctgan.sample(len(real_data))
synthetic_data
synthetic_data['weight'] = np.round(synthetic_data['weight'],1)
synthetic_data
real_data.describe()
synthetic_data.describe()
synthetic_data.to_csv(HOME_PATH + SYNTHETIC_FILE, index = False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13333333333333333, 'fraction_numerical': 0.003418803418803419, 'mean_word_length': 12.318181818181818, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '463793', 'license': 'MIT', 'n_tokens_mistral': 231, 'n_tokens_neox': 214, 'n_words': 27, 'path': 'notebooks/Dataset B - Cardiovascular Disease/Synthetic data generation/CTGAN Dataset B - Cardio.ipynb', 'repo_name': 'Vicomtech/STDG-evaluation-metrics', 'size': '585'}