IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
fcon_pls.m
Go to the documentation of this file.
1 %> @brief Partial Least Squares Transformation aka PLSDA
2 %>
3 %> This function uses @c plsregress() from MATLAB's Statistics Toolbox
4 %>
5 %> The "Y" in the PLS formulation used is <code>classes2boolean(data.classes)</code>
6 %>
7 %> @sa uip_fcon_pls.m
8 classdef fcon_pls < fcon_linear
9  properties
10  %> Number of factors to feature in the transformed dataset (default: 10).
11  no_factors = 10;
12  end;
13 
14  methods
15  function o = fcon_pls(o)
16  o.classtitle = 'Partial Least Squares';
17  o.short = 'PLS';
18  o.flag_trainable = 1;
19  o.L_fea_prefix = 'PLS';
20  end;
21  end;
22 
23  methods(Access=protected)
24  function o = do_train(o, data)
25 % o.L = irootlab_pls(data.X, data.classes, o.no_factors);
26  [o.L, dummy] = plsregress(data.X, classes2boolean(data.classes), o.no_factors);
27  o.L_fea_x = data.fea_x;
28  o.xname = data.xname;
29  o.xunit = data.xunit;
30  end;
31  end;
32 end
Feature Construction - Linear Transformations base class.
Definition: fcon_linear.m:2
function classes2boolean(in classes, in no_different)
function irootlab_pls(in X, in Y, in no_factors)
Important: X-variables (columns of X) need to be standardized, otherwise the function will give an er...
Partial Least Squares Transformation aka PLSDA.
Definition: fcon_pls.m:8