<jupyter_start><jupyter_text>Training the synthesizer only on the fraudulent eventsFor the process of synthesis we shall only consider the fraudulent data. Import the required packages<jupyter_code>#ave here YData's lib to be called and used in the Jupyter Notebook
from ydata.connectors.filetype import FileType
from ydata.connectors import LocalConnector

from ydata.synthesizers.regular import RegularSynthesizer<jupyter_output><empty_output><jupyter_text>Reading the fraudulent dataset<jupyter_code>conn = LocalConnector()
fraud = conn.read_file(path='outputs/fraud.csv', file_type=FileType.CSV)
fraud_synth = RegularSynthesizer()
fraud_synth.fit(fraud)<jupyter_output>INFO: 2022-02-20 23:34:48,392 [SYNTHESIZER] - Calculating metadata
INFO: 2022-02-20 23:34:57,978 Start data preprocessing.<jupyter_text>Saving the trained synthesizerFor the next steps of the pipeline we need the trained synthesizer to generate synthetic fraudulent samples. To enable the synthesizer for the next pipelien steps, it is required to save it as a pickle file.<jupyter_code>fraud_synth.save('outputs/synth_model.pkl')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06972639011473963, 'fraction_numerical': 0.03000882612533098, 'mean_word_length': 7.526315789473684, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '121954', 'license': 'MIT', 'n_tokens_mistral': 392, 'n_tokens_neox': 349, 'n_words': 106, 'path': '5 - synthetic-data-applications/regular-tabular/credit_card_fraud-balancing/pipeline/train-synth.ipynb', 'repo_name': 'ydataai/Blog', 'size': '1133'}