IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
demo_rater.m
Go to the documentation of this file.
1 %>@brief Classification of Chemicals using LDC and cross-validation
2 %>@ingroup demos
3 %>@file
4 %>
5 %> Note that the averages in the scatterplots are the confusion matrix diagonal values.
6 %>
7 %>@image html demo_rater_result03.png
9 
10 ddemo = load_data_she5trays;
11 ddemo = data_select_hierarchy(ddemo, 1); % Selects B/C/E/F/G classes only
12 
13 o = rater();
14 o.clssr = [];
15 o.postpr_est = [];
16 o.sgs = [];
17 o.ttlog = [];
18 rater01 = o;
19 
20 log_raterout = rater01.use(ddemo); % The calculation
21 
22 %%
23 
24 % Creates report with all confusion matrices
25 o = report_estlog();
26 o = o.setbatch({'flag_individual', 1});
27 htmllog = o.use(log_raterout);
28 
29 htmllog.open_in_browser();
30 
31 % The next plots show the distributions of the classification rates along the diagonal of the confusion matrix
32 %
33 % ds_rows is an array of datasets. Each dataset contains the data from one row of the confusion matrix.
34 % The variables in the dataset are the columns of the confusion matrix. The rows in the dataset are the foldwise percentages
35 ds_rows = log_raterout.extract_datasets();
36 
37 o = vis_scatter1d();
38 o = o.setbatch({'type_distr', 1, ...
39 'idx_fea', NaN});
40 visobj = o;
41 
42 figure;
43 no_plots = numel(ds_rows);
44 for i = 1:no_plots
45  subplot(1, no_plots, i);
46  ds_row = ds_rows(i);
47  visobj.idx_fea = i+1;
48  visobj.use(ds_row);
49  title(ds_row.title);
50  legend off;
51  p = get(gca, 'position');
52  p(2) = 0.21; % y
53  p(4) = 0.62; % height;
54  set(gca, 'position', p);
55 end;
56 maximize_window([], no_plots);
function data_select_hierarchy(in data, in hierarchy)
"Rater" class
Definition: rater.m:14
function maximize_window(in h, in aspectratio, in normalizedsize)
estlog 's HTML (confusion matrices)
Definition: report_estlog.m:4
1D Scatterplot
Definition: vis_scatter1d.m:4
function colors_markers()
function load_data_she5trays()