The codes and documentation for my BSc project in the area of Cancer Genomics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

runner.py 894B

12345678910111213141516171819202122232425262728293031
  1. import os
  2. import copy
  3. from mogonet.feat_importance import cal_feat_imp, summarize_imp_feat
  4. from mogonet.train_test import train_test
  5. data_folder = 'ICGC'
  6. view_list = [1, 2]
  7. def run_mogonet(num_class):
  8. os.chdir('./mogonet')
  9. num_epoch_pretrain = 500
  10. num_epoch = 2500
  11. lr_e_pretrain = 1e-3
  12. lr_e = 5e-4
  13. lr_c = 1e-3
  14. train_test(data_folder, view_list, num_class,
  15. lr_e_pretrain, lr_e, lr_c,
  16. num_epoch_pretrain, num_epoch)
  17. def run_biomarker(num_class):
  18. os.chdir('./mogonet')
  19. model_folder = os.path.join(data_folder, 'models')
  20. featimp_list_list = []
  21. for rep in range(5):
  22. featimp_list = cal_feat_imp(data_folder, os.path.join(model_folder, str(rep + 1)),
  23. view_list, num_class)
  24. featimp_list_list.append(copy.deepcopy(featimp_list))
  25. summarize_imp_feat(featimp_list_list)