IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
log_as_crossc.m
Go to the documentation of this file.
1 %> @brief Log generated by an @ref as_crossc
2 %>
3 %> Allows one to extract elements:
4 %> @arg The average loadings matrix
5 %> @arg Each individually trained block and respective output dataset
6 %>
7 %> @sa as_crossc
8 classdef log_as_crossc < irlog
9  properties
10  sgs;
11  data_out;
12  blocks;
13  obsidxs;
14  %> This will be set at go() time and used subsequently to reorder
15  %> the classlabels of extracted dataset(s)
16  classlabels;
17  end;
18 
19  methods
20  function o = log_as_crossc()
21  o.classtitle = 'Cross-Calculation';
22  o.moreactions = [o.moreactions, {'extract_blocks', 'extract_block', 'extract_datasets', 'extract_dataset'}];
23  o.flag_ui = 0;
24  end;
25  end;
26 
27  methods
28  %> Extracts fold-wise blocks
29  function out = extract_blocks(o)
30  out = o.blocks;
31  end;
32 
33  %> Extracts a linear transform whose loadings is the average from all blocks loadings
34  function out = extract_block(o)
35  nb = numel(o.blocks);
36  L = 0;
37 
38  for i = 1:nb
39  L = L+o.blocks{i}.L;
40  end;
41  L = L/nb;
42 
43  out = fcon_linear_fixed();
44  out.L = L;
45  out.L_fea_x = o.blocks{1}.L_fea_x;
46  out.xname = o.blocks{1}.xname;
47  out.xunit = o.blocks{1}.xunit;
48  end;
49 
50  %> Extracts datasets
51  function out = extract_datasets(o)
52  out = o.data_out;
53  end;
54 
55  %> Extracts cross-calculated output dataset
56  function out = extract_dataset(o)
57  out = data_renumber_classes(data_merge_rows(o.data_out), o.classlabels);
58  end;
59  end;
60 end
Base Sub-dataset Generation Specification (SGS) class.
Definition: sgs.m:6
Base Block class.
Definition: block.m:2
Log generated by an as_crossc.
Definition: log_as_crossc.m:8
Cross-calculation Analysis Session.
Definition: as_crossc.m:19
Loadings vector specified directly.
function data_renumber_classes(in ds_ori, in ref)
Property flag_ui
(GUI setting) Whether to "publish" in blockmenu and datatool. Note that a class can be "published" wi...
Definition: irobj.m:60
Log base class.
Definition: irlog.m:5
function data_merge_rows(in datasets)