IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
blmisc_rowsout.m
Go to the documentation of this file.
1 %> @brief Outlier Removal base class
2 %>
3 %> There are two possible ways to generate output from the @c use() method:
4 %> <ol>
5 %> <li> @c flag_mark_only = 0. Generates two datasets. The first one contains the inliers and the second one the
6 %outliers.</li>
7 %> <li> @c flag_mark_only = 1. Marks the outliers with class -2.</li>
8 %> </ol>
9 %> train() and use() don't need to be called with the same dataset, but
10 %> the datasets do need to have the same number of rows.
11 %>
12 %> block_cascade will skip blmisc_rowsout blocks at <code>use()</code>
13 %>
15  properties(SetAccess=protected)
16  map = [];
17  end;
18 
19  properties
20  %> =1. Whether to mark outliers class as -2, or else to generate two datasets in the output.
21  flag_mark_only = 0;
22  end;
23 
24  methods(Access=protected)
25  function o = do_train(o, data)
26  o = o.calculate_map(data);
27  end;
28 
29  function datasets = do_use(o, data)
30  map_out = 1:data.no;
31  map_out(o.map) = [];
32  if o.flag_mark_only
33  datasets = data;
34  datasets.classes(map_out) = -2;
35  datasets = datasets.eliminate_unused_classlabels();
36  else
37  datasets = [data.map_rows(o.map), data.map_rows(map_out)];
38  end;
39  end;
40  end;
41 
42  methods
43  function o = blmisc_rowsout(o)
44  o.classtitle = 'Outlier Removal';
45  o.flag_trainable = 1;
46  o.flag_fixednf = 0;
47  o.flag_fixedno = 1;
48  end;
49 
50  %> Abstract. This function must assign the @ref map property with the indexes of the <b>inliers</b>.
51  function o = calculate_map(o, data)
52  end;
53  end;
54 end
55 
Cascade block: final instantializable class.
Definition: block_cascade.m:4
Outlier Removal base class.
Miscellaneous block.
Definition: blmisc.m:4
Analysis Session (AS) base class.
Definition: as.m:6