<jupyter_start><jupyter_text>61% data ( 155 images ) are tumorous and 39% of the data ( 98 images ) are non - tumorous. so, in order to balance the data we can generate 9 new images for every image that belongs to 'no' class and 6 images for every image that belongs the 'yes' class<jupyter_code>start_time  = time.time()
augmented_data_path = 'augmented_data/'

augment_data(file_dir = yes_path, n_generated_samples = 6, save_to_dir = augmented_data_path + 'yes')
augment_data(file_dir = no_path, n_generated_samples = 9, save_to_dir = augmented_data_path + 'no')

end_time = time.time()
execution_time = (end_time - start_time)
print(f"time : {hms_string(execution_time)}")<jupyter_output><empty_output><jupyter_text>time : 0:16:12.3how many tumorous and non-tumorous example after performing data augmentation<jupyter_code>def data_summary(main_path):
  yes_path = main_path + 'yes'
  no_path = main_path + 'no'
  m_pos = len(list_dir(yes_path))
  m_neg = len(list_dir(no_path))

  # number of all examples
  m = (m_pos + m_neg)

  pos_prec = (m_pos * 100.0) / m
  neg_prec = (m_neg * 100.0) / m

  print(f"number of examples : {m}")
  print(f"number of positive examples : {pros_prec} %, number of examples : {m_pos}")
  print(f"number of negative examples : {neg_prec} %, number of examples : {m_neg}")
data_summary(augmented_data_path)<jupyter_output><empty_output><jupyter_text>number of examples : 2065percentage of positive example : 52.54237288135593 %, number of examples : 1085percentage of negative example : 47.45762711864407%, number of examples : 980<jupyter_code><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1062111801242236, 'fraction_numerical': 0.043478260869565216, 'mean_word_length': 5.7125, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '121414', 'license': 'MIT', 'n_tokens_mistral': 623, 'n_tokens_neox': 566, 'n_words': 150, 'path': 'data_augmentation.ipynb', 'repo_name': 'slowy07/brain-tumor-detection', 'size': '1610'}