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.

DumpResults4.m 3.8KB

5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. clear;
  2. clc;
  3. dump_ged = 0;
  4. dump_time = 0;
  5. dump_addMissingAtt = 1;
  6. dump_AttThPect = 0;
  7. if dump_ged == 1
  8. name = 'GED';
  9. elseif dump_time == 1
  10. name = 'Time';
  11. else
  12. name = 'Results';
  13. end
  14. dataDir = 'D:/SocialNets/__Steam/_Exp_Oct13/Train/results8_Th35_2K_Train/F1022_Iter_1120/';
  15. dataDir = 'D:/__SN_Oct13/Results/compareTh_KM8_10K_b/F922_Iter_15/';
  16. %dataDir = 'D:/__SN_Oct13/Results/results9_Th358_101K/F922_Iter_44/';
  17. % dataDir = 'D:/__SN_Jan14_FF50/Results/results9_Th358_100K/F922_Iter_810/';
  18. % dataDir = 'D:/__SN_Jan14_FF75/Datasets_10K/testImgA/F922_Iter_14_R2M2/';
  19. %dataDir = 'D:/__SN_Jan14_FF75/Datasets_10K/testImg_noTh_10000/F922_I2P1M0_Iter_15/';
  20. files = dir(strcat(dataDir, 'res_*.mat'));
  21. dateNow = clock;
  22. dateNow = strcat(num2str(dateNow(1)),'_',num2str(dateNow(2)),'_', num2str(dateNow(3)),'_', num2str(dateNow(4)), num2str(dateNow(5)),'_', num2str(dateNow(6)));
  23. outFile = sprintf('%sDump%s_%s.txt',dataDir, name, dateNow);
  24. fileID = fopen(outFile,'w');
  25. first = 1;
  26. numAlg = 0;
  27. for f = files'
  28. data = load(strcat(dataDir,f.name));
  29. numResults = size(data.purity,2);
  30. numMissing = size(data.removed_nodes,2);
  31. line = numResults/numMissing;
  32. % print header
  33. if first == 1
  34. fprintf(fileID,'\tfile\tinx\titer\tnodes\tedges\tattEdges\tattNodes\tmissInx\tmissNum\tnumPHs\tavgPHs');
  35. for i=1:line
  36. r=data.purity(1,i);
  37. if dump_addMissingAtt == 1 || dump_AttThPect == 1
  38. if r.withAttr == 0 && r.affinity_calculation_type ~= 9
  39. numAlg = numAlg+1;
  40. end
  41. p = r.addMissingAtt;
  42. if r.addMissingAtt == 1
  43. p = 0;
  44. end
  45. if dump_AttThPect == 1 && r.attThPect < 1
  46. p = r.attThPect*10;
  47. end
  48. fprintf(fileID,'\t%d',p*100000+r.affinity_calculation_type*1000+r.withAttr);
  49. else
  50. if r.withAttr == 0 && r.affinity_calculation_type ~= 9
  51. fprintf(fileID,'\t%d_Orig',r.affinity_calculation_type);
  52. numAlg = numAlg+1;
  53. else
  54. %fprintf(fileID,'\t%d_Att%d',r.affinity_calculation_type,r.withAttr);
  55. fprintf(fileID,'\t%d_%d',r.affinity_calculation_type,r.withAttr);
  56. end
  57. end
  58. end
  59. fprintf(fileID,'\n');
  60. first = 0;
  61. end
  62. numAlgVars = line/numAlg;
  63. %print data
  64. for i=1:numResults
  65. r = data.purity(1,i);
  66. if mod(i,line)==1 || numResults==1
  67. fprintf(fileID,'\t%s',data.file);
  68. fprintf(fileID,'\t%d',data.i);
  69. fprintf(fileID,'\t%d',data.iter);
  70. fprintf(fileID,'\t%d',r.graph_size);
  71. fprintf(fileID,'\t%d',r.graph_edges); %12.12.12
  72. fprintf(fileID,'\t%d',r.graph_attr_edges); % 12.12.12
  73. fprintf(fileID,'\t%d', data.purity(1,i).num_attr_nodes);
  74. fprintf(fileID,'\t%d',r.num_missing_nodes_idx);
  75. fprintf(fileID,'\t%d',r.num_missing_nodes);
  76. fprintf(fileID,'\t%d',r.num_placeholders);
  77. fprintf(fileID,'\t%d',r.num_placeholders/r.num_missing_nodes);
  78. end
  79. % if mod(i,numAlgVars)==1
  80. % fprintf(fileID,'\t'); % place for min calculation
  81. % end
  82. if dump_ged == 1
  83. fprintf(fileID,'\t%d',r.edit_distance);
  84. elseif dump_time == 1
  85. total_time = r.affinity_calc_time+r.reduce_dim_time+r.graph_predict_time+r.att_affinity_calc_time;
  86. fprintf(fileID,'\t%d',total_time);
  87. else
  88. fprintf(fileID,'\t%d',r.score);
  89. end
  90. if mod(i,line)==0
  91. fprintf(fileID,'\n');
  92. end
  93. end
  94. end
  95. fclose(fileID);
  96. LogMsg(sprintf('Completed Dump%s at%s',name,outFile));