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.

DumpResults4top.m 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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/TopPerc/Iter15_ThC/';
  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,size(r.topAttr,2));
  35. th = r.topAttrTh/10;
  36. if th > 0
  37. fprintf(fileID,'_%d',th);
  38. end
  39. end
  40. end
  41. fprintf(fileID,'\n');
  42. first = 0;
  43. end
  44. numAlgVars = line/numAlg;
  45. %print data
  46. for i=1:numResults
  47. r = data.purity(1,i);
  48. if mod(i,line)==1 || numResults==1
  49. fprintf(fileID,'\t%s',data.file);
  50. fprintf(fileID,'\t%d',data.i);
  51. fprintf(fileID,'\t%d',data.iter);
  52. fprintf(fileID,'\t%d',r.graph_size);
  53. fprintf(fileID,'\t%d',r.graph_edges); %12.12.12
  54. fprintf(fileID,'\t%d',r.graph_attr_edges); % 12.12.12
  55. fprintf(fileID,'\t%d', data.purity(1,i).num_attr_nodes);
  56. fprintf(fileID,'\t%d',r.num_missing_nodes_idx);
  57. fprintf(fileID,'\t%d',r.num_missing_nodes);
  58. fprintf(fileID,'\t%d',r.num_placeholders);
  59. fprintf(fileID,'\t%d',r.num_placeholders/r.num_missing_nodes);
  60. end
  61. % if mod(i,numAlgVars)==1
  62. % fprintf(fileID,'\t'); % place for min calculation
  63. % end
  64. if dump_ged == 1
  65. fprintf(fileID,'\t%d',r.edit_distance);
  66. elseif dump_time == 1
  67. total_time = r.affinity_calc_time+r.reduce_dim_time+r.graph_predict_time+r.att_affinity_calc_time;
  68. fprintf(fileID,'\t%d',total_time);
  69. else
  70. fprintf(fileID,'\t%d',r.score);
  71. end
  72. if mod(i,line)==0
  73. fprintf(fileID,'\n');
  74. end
  75. end
  76. end
  77. fclose(fileID);
  78. LogMsg(sprintf('Completed DumpResults at%s',outFile));