# An Adaptive Ensemble Approach to Ambient Intelligence Assisted People Search
## 3 Adaptive Ensemble of Classifiers
### Decision Function  
Given that \(G_{w}(X)\) and \(G_{b}(X)\) are two sets of different features, if the feature number of \(G_{w}(X)\) is \(N_{w}\), and the feature number of \(G_{b}(X)\) is \(N_{b}\), they can be written as below:  
\[G_{w}(X)=\frac{1}{\left(2\pi\right)^{N_{w}/2}}\frac{1}{\left|C_{w}\right|^{1/ 2}}\exp\left\{-\frac{1}{2}\sum\limits_{n\in N_{w}}\frac{1}{c_{wn}}\big{(}x_{ n}-x_{n}^{\prime}\big{)}^{2}\right\} \tag{5}\]  
\[G_{b}(X)=\frac{1}{\left(2\pi\right)^{N_{b}/2}}\frac{1}{\left|C_{b}\right|^{1/ 2}}\exp\left\{-\frac{1}{2}\sum\limits_{n\in N_{b}}\frac{1}{c_{bn}}\big{(}x_{ n}-x_{n}^{\prime}\big{)}^{2}\right\} \tag{6}\]  
To simplify the decision function and to express our question more clearly, we can write \(G_{w}(X)\) and \(G_{b}(X)\) as a proportion (Equation (7)):  
\[\frac{G_{w}(X)}{G_{b}(X)}=\frac{\left(2\pi\right)^{\frac{N_{b}}{2}}}{\left(2 \pi\right)^{\frac{N_{b}}{2}}}\frac{\left|C_{b}\right|^{\frac{1}{2}}}{\left|C_ {w}\right|^{\frac{1}{2}}}\exp\left\{-\frac{1}{2}\left(\sum\limits_{n\in N_{w}} \frac{1}{c_{wn}}\big{(}x_{n}-x_{n}^{\prime}\big{)}^{2}-\sum\limits_{n\in N_{b} }\frac{1}{c_{bn}}\big{(}x_{n}-x_{n}^{\prime}\big{)}^{2}\right)\right\} \tag{7}\]  
Let \(z_{n}=\left(x_{n}-x_{n}^{\prime}\right)^{2}\) and \(f(Z)=\sum\limits_{n\in N_{w}}\frac{1}{c_{wn}}z_{n}-\sum\limits_{n\in N_{b}}\frac {1}{c_{bn}}z_{n}\). Because \(N_{w}\) and \(N_{b}\) embody two sets of different features on the face, i.e., \(N_{w}\cup N_{b}=N\) and \(N_{w}\cap N_{b}=\varnothing\), it can be simplified as below:  
\[f(Z)=\sum\limits_{n\in\text{N}}w_{n}z_{n}=W^{t}Z \tag{8}\]  
where \(w_{n}=\left\{\begin{array}{rl}1/c_{wn},&\text{for }G_{w}(X)\\ -1/c_{bn},&\text{for }G_{b}(X)\end{array}\right..\) Hence, Equation (7) can be simplified as Equation (9):  
\[G_{w}(X)/G_{b}(X)=\frac{\left(2\pi\right)^{N_{b}/2}}{\left(2\pi\right)^{N_{w}/ 2}}\frac{\left|C_{b}\right|^{1/2}}{\left|C_{w}\right|^{1/2}}\exp\left\{-\frac {1}{2}f(Z)\right\} \tag{9}\]If we substitute the above \(G_{w}(\mathrm{X})/G_{b}(\mathrm{X})\) into Equation (4), then \(G_{w}(X)\geq a\cdot G_{b}(X)\) becomes as follows:  
\[\frac{(2\pi)^{N_{b}/2}}{(2\pi)^{N_{w}/2}}\frac{|C_{b}|^{1/2}}{|C_{w}|^{1/2}}\exp \biggl{\{}-\frac{1}{2}f(Z)\biggr{\}}\geq\mathrm{a}\]  
By reorganizing the above equation, we have:  
\[\exp\biggl{\{}-\frac{1}{2}f(Z)\biggr{\}}\geq\mathrm{a}\frac{(2\pi)^{N_{w}/2}} {(2\pi)^{N_{b}/2}}\frac{|C_{w}|^{1/2}}{|C_{b}|^{1/2}}\]  
Then:  
\[-\frac{1}{2}f(Z)\geq\ln\biggl{(}\mathrm{a}\frac{(2\pi)^{N_{w}/2}}{(2\pi)^{N_{ b}/2}}\frac{|C_{w}|^{1/2}}{|C_{b}|^{1/2}}\biggr{)}\]  
Then:  
\[f(Z)+2\ln\biggl{(}\mathrm{a}\frac{(2\pi)^{N_{w}/2}}{(2\pi)^{N_{b}/2}}\frac{|C _{w}|^{1/2}}{|C_{b}|^{1/2}}\biggr{)}\leq 0\]  
Letting \(d=2\ln\biggl{(}\mathrm{a}\frac{(2\pi)^{N_{w}/2}}{(2\pi)^{N_{b}/2}}\frac{|C_{w} |^{1/2}}{|C_{b}|^{1/2}}\biggr{)}\), we have obtained the decision function from Equation (4) as follows:  
\[y=\left\{\begin{array}{c}-1,\,if\,f(Z)+d\leq 0\\ 1,\,otherwise\end{array}\right. \tag{10}\]  
where \(d\) is a threshold parameter related to \(a\), and \(f(Z)+d\) is a linear function. Each weight parameter \(w_{n}\) of \(f(Z)\) is determined by the standard deviation \(c_{n}\) of \(g_{n}(x_{n})\), which is independent and can be adjusted separately.