IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
data_calculate_scatters.m
Go to the documentation of this file.
1 %>@ingroup maths
2 %>@file
3 %>@brief Calculates scatter matrices from dataset
4 %>
5 %> @sa calculate_scatters.m
6 %
7 %> @param data @ref irdata object
8 %> @param flag_modified_s_b if 1, S_B will be calculated in an alternative way which is class terms will not be weighet by class sample size, which
9 %> will cause all classes to have equal importance.
10 %> @param P penalty matrix to be added to @c S_W
11 %> @return <em>[S_B, S_W]</em> Respectively "inter-class scatter matrix" and "within-class scatter matrix"
12 function [S_B, S_W] = data_calculate_scatters(data, flag_modified_s_b, P)
13 
14 if ~exist('flag_modified_s_b', 'var')
15  flag_modified_s_b = 0;
16 end;
17 
18 if ~exist('P', 'var')
19  P = 0;
20 end;
21 
22 [S_B, S_W] = calculate_scatters(data.X, data.classes, flag_modified_s_b, P);
Dataset class.
Definition: irdata.m:30
function calculate_scatters(in X, in classes, in flag_modified_s_b, in P)
function data_calculate_scatters(in data, in flag_modified_s_b, in P)