IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
data_eliminate_var0.m
Go to the documentation of this file.
1 %>@ingroup maths datasettools demo
2 %>@file
3 %>@brief Eliminates low-variance features
4 %>
5 %> Features are selected above a variance threshold.
6 %>
7 %> This file also demonstrates how objtool can be used to generate MATLAB code to create a function.
8 %
9 %> @param data Input dataset
10 %> @param threshold =1e-10. Variance threshold
11 %> @return feature-selected dataset
12 function ds = data_eliminate_var0(ds, threshold)
13 
14 if nargin < 2 || isempty(threshold)
15  threshold = 1e-10;
16 end;
17 
18 u = fsg_test_var();
19 fsg_test_var01 = u;
20 
22 u.blocks{1}.fsg = fsg_test_var01;
23 u.blocks{2}.type = 'threshold';
24 u.blocks{2}.threshold = threshold;
25 u.blocks{2}.sortmode = 'index';
26 cascade_fsel_grades_fsg01 = u;
27 cascade_fsel_grades_fsg01 = cascade_fsel_grades_fsg01.boot();
28 cascade_fsel_grades_fsg01 = cascade_fsel_grades_fsg01.train(ds);
29 out = cascade_fsel_grades_fsg01.use(ds);
30 fsel_fsg01 = out;
31 
32 ds = fsel_fsg01.use(ds);
Feature subset grader - variance.
Definition: fsg_test_var.m:2
function objtool(in varargin)
Property blocks
Cell of block objects.
function data_eliminate_var0(in ds, in threshold)
Cascade block: as_grades_fsg->as_fsel_grades->(extract_fsel)