IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
fcon_linear.m
Go to the documentation of this file.
1 %> @brief Feature Construction - Linear Transformations base class
2 classdef fcon_linear < fcon
3  properties
4  %> Prefix for the factos space variables, e.g., "PC", "LD"
5  L_fea_prefix = 'LIN';
6  %> Names of the factors!
7  L_fea_names = [];
8  %> Loadings vector
9  L = [];
10  %> Loadings x-axis (in this case, the up-to-down dimension)
11  L_fea_x;
12  %> Name of loadings x-axis
13  xname;
14  xunit;
15  end;
16 
17 
18  methods
19  function o = fcon_linear()
20  o.classtitle = 'Linear Transformation';
21  end;
22 
23  function a = get_L_fea_names(o, idxs)
24  if ~isempty(o.L_fea_names)
25  if any(idxs > numel(o.L_fea_names))
26  ii = find(idxs > numel(o.L_fea_names));
27  irerror(sprintf('L_fea_names size %d < %d', numel(o.L_fea_names), idxs(ii(1))));
28  end;
29  a = o.L_fea_names(idxs);
30  else
31  if ~isempty(o.L_fea_prefix)
32  prefix = o.L_fea_prefix;
33  else
34  prefix = 'Factor ';
35  end;
36  a = arrayfun(@(x) [prefix, int2str(x)], idxs, 'UniformOutput', 0);
37  end;
38  end;
39  end;
40 
41  methods(Access=protected)
42  function data = do_use(o, data)
43  data = data.transform_linear(o.L, o.L_fea_prefix);
44  end;
45  end;
46 end
Feature Construction - Linear Transformations base class.
Definition: fcon_linear.m:2
function irerror(in s)
Feature Construction (FCon) base class.
Definition: fcon.m:2