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.

DumpResults4th.m 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. clear;
  2. clc;
  3. dump_ged = 0;
  4. dump_time = 0;
  5. if dump_ged == 1
  6. name = 'GED';
  7. elseif dump_time == 1
  8. name = 'Time';
  9. else
  10. name = 'Results';
  11. end
  12. dataDir = 'D:/SocialNets/Steam/Exp_March13/Test/Th/Iter15/';
  13. files = dir(strcat(dataDir, 'res_Steam*.mat'));
  14. dateNow = clock;
  15. dateNow = strcat(num2str(dateNow(1)),'_',num2str(dateNow(2)),'_', num2str(dateNow(3)),'_', num2str(dateNow(4)), num2str(dateNow(5)),'_', num2str(dateNow(6)));
  16. outFile = sprintf('%sDump%s_%s.txt',dataDir, name, dateNow);
  17. fileID = fopen(outFile,'w');
  18. first = 1;
  19. numAlg = 0;
  20. for f = files'
  21. data = load(strcat(dataDir,f.name));
  22. numResults = size(data.purity,2);
  23. numMissing = size(data.removed_nodes,2);
  24. line = numResults/numMissing;
  25. % print header
  26. if first == 1
  27. fprintf(fileID,'\tfile\tinx\titer\tnodes\tedges\tattEdges\tattNodes\tmissInx\tmissNum\tnumPHs\tavgPHs');
  28. for i=1:line
  29. r=data.purity(1,i);
  30. if r.withAttr == 0 && r.affinity_calculation_type ~= 9
  31. fprintf(fileID,'\t%d_Orig',r.affinity_calculation_type);
  32. numAlg = numAlg+1;
  33. else
  34. fprintf(fileID,'\t%d_Att%d_%d',r.affinity_calculation_type,r.withAttr,r.topAttrTh/10);
  35. end
  36. end
  37. fprintf(fileID,'\n');
  38. first = 0;
  39. end
  40. numAlgVars = line/numAlg;
  41. %print data
  42. for i=1:numResults
  43. r = data.purity(1,i);
  44. if mod(i,line)==1 || numResults==1
  45. fprintf(fileID,'\t%s',data.file);
  46. fprintf(fileID,'\t%d',data.i);
  47. fprintf(fileID,'\t%d',data.iter);
  48. fprintf(fileID,'\t%d',r.graph_size);
  49. fprintf(fileID,'\t%d',r.graph_edges); %12.12.12
  50. fprintf(fileID,'\t%d',r.graph_attr_edges); % 12.12.12
  51. fprintf(fileID,'\t%d', data.purity(1,i).num_attr_nodes);
  52. fprintf(fileID,'\t%d',r.num_missing_nodes_idx);
  53. fprintf(fileID,'\t%d',r.num_missing_nodes);
  54. fprintf(fileID,'\t%d',r.num_placeholders);
  55. fprintf(fileID,'\t%d',r.num_placeholders/r.num_missing_nodes);
  56. end
  57. % if mod(i,numAlgVars)==1
  58. % fprintf(fileID,'\t'); % place for min calculation
  59. % end
  60. if dump_ged == 1
  61. fprintf(fileID,'\t%d',r.edit_distance);
  62. elseif dump_time == 1
  63. total_time = r.affinity_calc_time+r.reduce_dim_time+r.graph_predict_time+r.att_affinity_calc_time;
  64. fprintf(fileID,'\t%d',total_time);
  65. else
  66. fprintf(fileID,'\t%d',r.score);
  67. end
  68. if mod(i,line)==0
  69. fprintf(fileID,'\n');
  70. end
  71. end
  72. end
  73. fclose(fileID);
  74. LogMsg(sprintf('Completed DumpResults at%s',outFile));