-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgraphfuzzyperf.m
More file actions
48 lines (45 loc) · 1.53 KB
/
graphfuzzyperf.m
File metadata and controls
48 lines (45 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%
function graphfuzzyperf()
dataSets = {'VOC2006','VOC2007','VOC2010','Scene15'};
nDataSet = max(size(dataSets));
rootDir = '/vol/vssp/diplecs/ash/Data/';
% initialize matlab
cdir = pwd;
cd ~;
startup;
cd (cdir);
%
subspaceMethod = 'PCA';
clustMethods = {'Kmeans';'FCM';'GK';'GG'};
resultDir = 'Result/';
coeffPerfDir = '/CoeffPerf/';
algo = 'dl';
param = 'neg';
nMethods = max(size(clustMethods));
resultFileName = strcat(rootDir,resultDir,'fuzzyclassperf.csv');
resultFile = fopen(resultFileName,'w');
fprintf(resultFile,'%s,%s,%s,%s,%s\n', 'DataSet', 'Category', 'Method', 'mAP', 'AUC');
for iDataSet = 1 : nDataSet
dataSet = dataSets{iDataSet};
categoryListFileName = 'categoryList.txt';
categoryListPath = strcat(rootDir,dataSet,'/',categoryListFileName);
fid = fopen(categoryListPath);
categoryList = textscan(fid,'%s');
categoryList = categoryList{1};
fclose(fid);
nCategory = size(categoryList,1);
for iMethod = 1 : nMethods
method = clustMethods{iMethod};
coeffPerfFileAvg = strcat(rootDir,dataSet,coeffPerfDir,algo,num2str(param),method,subspaceMethod,'.avg');
coeffPerfAvg = dlmread(coeffPerfFileAvg,',');
for iCategory = 1 : nCategory
category = categoryList{iCategory};
map = coeffPerfAvg(iCategory,1);
auc = coeffPerfAvg(iCategory,2);
fprintf(resultFile,'%s,%s,%s,%f,%f\n',dataSet,category,method,map,auc);
fprintf('%s,%s,%s,%f,%f\n',dataSet,category,method,map,auc);
end
end
end
fclose(resultFile);
end