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.

DumpResults3.m 2.4KB

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