# HG changeset patch # User Christopher Hummersone # Date 1490789508 -3600 # Node ID 77b523a874c16ff0060f14750156da9086f04dac # Parent 8074e1bf0c0c8575531f0c0515c17cd06bdfa83c Corrected table output when performing aggregating functions. Added boxPlot() method to automatically plot performance data for each algorithm/estimate. diff -r 8074e1bf0c0c -r 77b523a874c1 MASSEFresults.m --- a/MASSEFresults.m Wed Mar 29 13:09:59 2017 +0100 +++ b/MASSEFresults.m Wed Mar 29 13:11:48 2017 +0100 @@ -35,6 +35,8 @@ % MASSEFRESULTS methods: % MASSEFresults - Create a MASSEFresults object. % algorithmInfo - Add algorithm information. +% boxPlot - Analyse the results data by plotting notched +% box plots. % filter - Filter the results set. % input - Add performance data. % merge - Combine results array into singular object. @@ -304,6 +306,33 @@ end + function bph = boxPlot(obj) + %BOXPLOT Analyse the results data by plotting notched box plots + % + % R.BOXPLOT() produces a series of box plots, one for each + % metric, plotting the performance of each algorithms/estimate + % aggregated across all mixtures. + % + % BPH = R.BOXPLOT() returns an array of IOSR.STATISTICS.BOXPLOT + % objects BPH for the plots. + + for m = numel(obj.metrics):-1:1 + + tabData = obj.filter('metric', @(x) strcmp(x, obj.metrics{m}), 'channel', 'max'); + tabData.name = strcat(tabData.algorithmLabel, ':', {' '}, tabData.estTag); + + [y, x] = iosr.statistics.tab2box(tabData.name, tabData.value); + + figure + bph(m) = iosr.statistics.boxPlot(x, y, 'notch', true); + ylabel(obj.metrics{m}) + xlabel('Algorithm') + box on + + end + + end + end % public methods methods (Hidden) @@ -331,15 +360,16 @@ end % do stats try - dataTable = varfun(fhandle,dataTable,'InputVariables','value',... + filteredTable = varfun(fhandle,dataTable,'InputVariables','value',... 'GroupingVariables',group); catch - dataTable = varfun(fhandle,dataTable,'InputVariables','value',... + filteredTable = varfun(fhandle,dataTable,'InputVariables','value',... 'GroupingVariables',altgroup); end % rename value column and delete GroupCount column - dataTable = obj.findRenameVar(dataTable,'value','value'); - dataTable.GroupCount = []; + filteredTable = obj.findRenameVar(filteredTable,'value','value'); + filteredTable.GroupCount = []; + dataTable = join(filteredTable, dataTable); else % normal filter function dataTable = obj.filterRows(dataTable,filterval,col);