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.

DumpResults2.m 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. clear;
  2. clc;
  3. dataDir = 'D:/SocialNets/Steam/Results_Test/FF75_50Att/GED_25w3/test/';
  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. for f = files'
  12. data = load(strcat(dataDir,f.name));
  13. numResults = size(data.purity,2);
  14. numMissing = size(data.removed_nodes,2);
  15. line = numResults/numMissing;
  16. % print header
  17. if first == 1
  18. fprintf(fileID,'\tfile\tinx\titer\tnodes\tedges\tattEdges\tattNodes\tmissInx\tmissNum\tnumPHs\tavgPHs');
  19. for i=1:line
  20. r=data.purity(1,i);
  21. if r.withAttr == 1
  22. fprintf(fileID,'\tAtt %d\tDiff %d',r.affinity_calculation_type,r.affinity_calculation_type);
  23. else
  24. fprintf(fileID,'\tAlg %d',r.affinity_calculation_type);
  25. end
  26. end
  27. fprintf(fileID,'\n');
  28. first = 0;
  29. end
  30. %print data
  31. for i=1:numResults
  32. r = data.purity(1,i);
  33. if mod(i,line)==1
  34. fprintf(fileID,'\t%s',data.file);
  35. fprintf(fileID,'\t%d',data.i);
  36. fprintf(fileID,'\t%d',data.iter);
  37. fprintf(fileID,'\t%d',r.graph_size);
  38. fprintf(fileID,'\t%d',r.graph_edges); %12.12.12
  39. fprintf(fileID,'\t%d',r.graph_attr_edges); % 12.12.12
  40. fprintf(fileID,'\t%d', data.purity(1,i+1).num_attr_nodes);
  41. fprintf(fileID,'\t%d',r.num_missing_nodes_idx);
  42. fprintf(fileID,'\t%d',r.num_missing_nodes);
  43. fprintf(fileID,'\t%d',r.num_placeholders);
  44. fprintf(fileID,'\t%d',r.num_placeholders/r.num_missing_nodes);
  45. end
  46. if ged == 1
  47. fprintf(fileID,'\t%d',r.edit_distance);
  48. if mod(i,2)==0
  49. fprintf(fileID,'\t%d',data.purity(1,i-1).edit_distance-r.edit_distance);
  50. end
  51. else
  52. fprintf(fileID,'\t%d',r.score);
  53. if mod(i,2)==0
  54. fprintf(fileID,'\t%d',data.purity(1,i-1).score-r.score);
  55. end
  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));