-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e85536
commit 2e1a271
Showing
8 changed files
with
62 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function featureNames = GetAllFeatureNames(doCatch24) | ||
% Retrieve all feature names from featureList.txt | ||
|
||
if nargin < 1 || isempty(doCatch24) | ||
doCatch24 = true; | ||
end | ||
%------------------------------------------------------------------------------- | ||
|
||
fid = fopen('../featureList.txt','r'); | ||
i = 1; | ||
tline = fgetl(fid); | ||
featureNames{i} = tline; | ||
while ischar(tline) | ||
i = i + 1; | ||
tline = fgetl(fid); | ||
if ischar(tline) | ||
featureNames{i} = tline; | ||
end | ||
end | ||
fclose(fid); | ||
|
||
%------------------------------------------------------------------------------- | ||
% Filter out the two extra features: 'DN_Mean' and 'DN_Spread_Std' | ||
isMeanStd = strcmp(featureNames,'DN_Mean') | strcmp(featureNames,'DN_Spread_Std'); | ||
assert(sum(isMeanStd) == 2) | ||
if ~doCatch24 | ||
featureNames = featureNames(~isMeanStd); | ||
fprintf(1,'Using catch22\n'); | ||
else | ||
fprintf(1,'Using catch24\n'); | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,34 @@ | ||
% get function names | ||
fid = fopen('../featureList.txt','r'); | ||
i = 1; | ||
tline = fgetl(fid); | ||
featureNames{i} = tline; | ||
while ischar(tline) | ||
i = i+1; | ||
tline = fgetl(fid); | ||
featureNames{i} = tline; | ||
end | ||
fclose(fid); | ||
%------------------------------------------------------------------------------- | ||
% Get the function names | ||
featureNames = GetAllFeatureNames(); | ||
numFeatures = length(featureNames); | ||
|
||
% get the data | ||
%------------------------------------------------------------------------------- | ||
% Get the data | ||
dataFileNames = {'../testData/test.txt', '../testData/test2.txt'}; | ||
for j = 1:2 | ||
|
||
numTestFiles = length(dataFileNames); | ||
|
||
fprintf(1,'Testing %u compiled features on %u data files\n',numFeatures,numTestFiles); | ||
|
||
%------------------------------------------------------------------------------- | ||
% Test all functions on all the data files | ||
for j = 1:numTestFiles | ||
|
||
dataFileName = dataFileNames{j}; | ||
fprintf('\n%s\n', dataFileName) | ||
fprintf('\n%s\n\n', dataFileName) | ||
|
||
fileID = fopen(dataFileName,'r'); | ||
|
||
data = fscanf(fileID,'%f'); | ||
|
||
for featureInd = 1:length(featureNames)-1 | ||
|
||
featureName = featureNames{featureInd}; | ||
|
||
fh = str2func(['catch22_', featureName]); | ||
for featureInd = 1:numFeatures | ||
|
||
featureName = featureNames{featureInd}; | ||
fh = str2func(['catch22_', featureName]); | ||
out = fh(data'); | ||
|
||
fprintf("%s: %1.6f\n", featureName, out); | ||
end | ||
|
||
fclose(fileID); | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.