IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
demo_as_dsperc_x_rate.m
Go to the documentation of this file.
1 %>@brief (dataset %) x (classification rate %) curve to check sample size
2 %>@ingroup demo
3 %>@file
4 %>
5 %> Allows to verify whether the classification rate would tend to improve if there were more data; or whether apparently there is more data than needed.
6 %>
7 %> @sa as_dsperc_x_rate
8 fig_assert();
9 
10 ddemo = load_data_she5trays;
11 ddemo = data_select_hierarchy(ddemo, 2);
12 
13 % Applied some feature reduction to eliminate the problem with singular pooled covariance matrix in classify()
14 o = fcon_pca();
15 o = o.setbatch({'no_factors', 20, ...
16 'flag_rotate_factors', 0});
17 fcon_pca01 = o;
18 fcon_pca01 = fcon_pca01.train(ddemo);
19 ddemo = fcon_pca01.use(ddemo);
20 
21 
22 
23 % Classifiers to be used
24 
25 o = clssr_d();
26 o = o.setbatch({'type', 'linear'});
27 o.title = 'LDC';
28 clssr_d01 = o;
29 
30 o = clssr_d();
31 o = o.setbatch({'type', 'quadratic'});
32 o.title = 'QDC';
33 clssr_d02 = o;%o;
34 
35 clssr_d03 = clssr_svm();%o;
36 clssr_d03.title = 'SVM';
37 
38 
39 o = estlog_classxclass();
40 o.title = 'accuracy';
41 o.estlabels = ddemo.classlabels;
42 o.testlabels = ddemo.classlabels;
43 estlog_classxclass01 = o;
44 
45 o = sgs_randsub();
46 o = o.setbatch({'flag_group', 0, ...
47 'flag_perclass', 1, ...
48 'randomseed', 0, ...
49 'type', 'simple', ...
50 'bites', [0.9 0.1], ...
51 'bites_fixed', [90 10], ...
52 'no_reps', 50});
53 sgs01 = o;
54 
55 o = decider();
56 o = o.setbatch({'decisionthreshold', 0});
57 decider01 = o;
58 
59 o = reptt_blockcube();
60 o = o.setbatch({'postpr_test', [], ...
61 'postpr_est', decider01, ...
62 'log_mold', {estlog_classxclass01}, ...
63 'block_mold', {clssr_d01, clssr_d02, clssr_d03}, ...
64 'sgs', sgs01});
65 cube = o;
66 
67 
68 
69 o = as_dsperc_x_rate();
70 o.evaluator = cube;
71 o.percs_train = .1:.05:.90;
72 o.perc_test = .1;
73 lc = o;
74 
75 %%
76 
77 lo = lc.use(ddemo);
78 
79 %%
80 
81 o = vis_log_celldata();
82 o.idx = [1, 2];
83 figure;
84 o.use(lo);
85 title(sprintf('Number of spectra in dataset: %d', ddemo.no));
86 maximize_window([], 1.618);
87 save_as_png([], 'irr_dsperc_x_rate');
Principal Component Analysis.
Definition: fcon_pca.m:4
function data_select_hierarchy(in data, in hierarchy)
Linear and Quadratic discriminant.
Definition: clssr_d.m:9
function maximize_window(in h, in aspectratio, in normalizedsize)
Block that resolves estimato posterior probabilities into classes.
Definition: decider.m:10
function setbatch(in o, in params)
function save_as_png(in h, in fn, in dpi)
Records (test class)x([rejected, estimation class]) hits.
Random Sub-sampling.
Definition: sgs_randsub.m:5
function load_data_she5trays()
Visualization - Histograms from log_celldata.
function fig_assert()
Support Vector Machine Classifier using LibSVM.
Definition: clssr_svm.m:23
(dataset %) x (classification rate) curve
REpeated Train-Test - Block Cube.