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.

DumpResults4spss.m 3.0KB

5 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. clear;
  2. clc;
  3. name = 'Results4Spss';
  4. dataDir = 'D:/SocialNets/__Steam/_Exp_Oct13/Train/results8_Th35_2K_Train/F1022_Iter_1120/';
  5. dataDir = 'D:/__SN_Oct13/Datasets_10K/extNoise_Th358_10K/F922_Iter_13/';
  6. %dataDir = 'D:/__SN_Oct13/Results/results8_Th35_10K_F/F1022_Iter_110/';
  7. dataDir = 'D:/__SN_Jan14_FF50/Results/results9_Th358_100K/F922_Iter_610/';
  8. files = dir(strcat(dataDir, 'res_*.mat'));
  9. dateNow = clock;
  10. dateNow = strcat(num2str(dateNow(1)),'_',num2str(dateNow(2)),'_', num2str(dateNow(3)),'_', num2str(dateNow(4)), num2str(dateNow(5)),'_', num2str(dateNow(6)));
  11. outFile = sprintf('%sDump%s_%s.txt',dataDir, name, dateNow);
  12. fileID = fopen(outFile,'w');
  13. withAttr = 1;
  14. withAttrNoise = 0;
  15. withAddMissingAtt = 1;
  16. first = 1;
  17. for f = files'
  18. data = load(strcat(dataDir,f.name));
  19. numResults = size(data.purity,2);
  20. numMissing = size(data.removed_nodes,2);
  21. line = numResults/numMissing;
  22. % print header
  23. if first == 1
  24. fprintf(fileID,'file\tinx\titer\tnodes\tedges\tmissInx\tmissNum\tnumPHs\tavgPHs');
  25. if withAttr == 1 || withAddMissingAtt == 1
  26. fprintf(fileID,'\tAlgId\tAttId\tgId');
  27. else
  28. fprintf(fileID,'\tAlgId');
  29. end
  30. if withAttrNoise == 1
  31. fprintf(fileID,'\tNoise');
  32. end
  33. fprintf(fileID,'\tPurity\tAffTime\tClusterTime\tTotalTime\n');
  34. first = 0;
  35. end
  36. %print data
  37. for i=1:numResults
  38. r = data.purity(1,i);
  39. fprintf(fileID,'%s',data.file);
  40. fprintf(fileID,'\t%d',data.i);
  41. fprintf(fileID,'\t%d',data.iter);
  42. fprintf(fileID,'\t%d',r.graph_size);
  43. fprintf(fileID,'\t%d',r.graph_edges); %12.12.12
  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. fprintf(fileID,'\t%d',r.affinity_calculation_type);
  49. if withAddMissingAtt == 1
  50. p = r.addMissingAtt;
  51. if r.addMissingAtt == 1
  52. p = 0;
  53. end
  54. if withAttrNoise == 1
  55. n = 10000;
  56. else
  57. n = 1;
  58. end
  59. fprintf(fileID,'\t%d',r.withAttr);
  60. fprintf(fileID,'\t%d',p*100000+r.affinity_calculation_type*1000*n+r.withAttr);
  61. elseif withAttr == 1
  62. fprintf(fileID,'\t%d',r.withAttr);
  63. fprintf(fileID,'\t%d',r.affinity_calculation_type*1000+r.withAttr);
  64. end
  65. if withAttrNoise == 1
  66. fprintf(fileID,'\t%d',r.noiseNumAdded);
  67. end
  68. fprintf(fileID,'\t%d',r.score);
  69. time1_aff = r.affinity_calc_time;
  70. time2_cluster = r.reduce_dim_time+r.graph_predict_time;
  71. fprintf(fileID,'\t%d',time1_aff);
  72. fprintf(fileID,'\t%d',time2_cluster);
  73. fprintf(fileID,'\t%d',time1_aff+time2_cluster);
  74. fprintf(fileID,'\n');
  75. end
  76. end
  77. fclose(fileID);
  78. LogMsg(sprintf('Completed DumpResults at%s',outFile));