## 2 Naive Bayesian Classifier for Mixed-Attribute Classification  
Let there be a classification data set \(\mathbb{D}=\bigcup\limits_{m=1}^{\mathcal{M}}\mathbb{D}^{(m)}\) containing \(\mathcal{N}\) samples. Each sample has \(\mathcal{D}\) condition attributes including \(\mathcal{D}_{1}\) discrete attributes and \(\mathcal{D}_{2}\) continuous attributes. Moreover, all samples are divided into \(\mathcal{M}\) different classes, where \(\mathcal{N}_{m}\) denotes the number of samples that belong to the \(m\)-th (\(m=1,2,\cdots,\mathcal{M}\)) class. \[\mathbb{D}^{(m)}=\left\{ \begin{array}{c}\left(\mathrm{x}_{n}^{(m)},y_{n}^{( m)}\right)\middle|\mathrm{x}_{n}^{(m)}=\begin{pmatrix}a_{n1}^{(m)},\cdots,a_{n \mathcal{D}_{1}}^{(m)},b_{n1}^{(m)},\cdots,b_{n\mathcal{D}_{2}}^{(m)}\end{pmatrix},\\ y_{n}^{(m)}=w_{m},n=1,2,\cdots,\mathcal{N}_{m}\end{array} \right\}, \tag{1}\]  
\(\sum\limits_{m=1}^{\mathcal{M}}\mathcal{N}_{m}=\mathcal{N}\), \(\mathcal{D}_{1}+\mathcal{D}_{2}=\mathcal{D}\), \(a_{ni}^{(m)},i\in\{1,2,\cdots,\mathcal{D}_{1}\}\) is the \(i\)-th discrete attribute value, \(b_{nj}^{(m)},j\in\{1,2,\cdots,\mathcal{D}_{2}\}\) is the \(j\)-th continuous attribute value, and \(\{w_{1},w_{2},\cdots,w_{\mathcal{M}}\}\) is the class label set. The next paragraphs explain the principles of the naive Bayesian classifier (NBC) for the mixed-attribute classification problem on data set \(\mathbb{D}\). Assume that there is a new sample \(\mathrm{x}=\left(a_{1},\cdots,a_{\mathcal{D}_{1}},b_{1},\cdots,b_{\mathcal{D} _{2}}\right)\). The NBC determines its class label by using this equation:  
\[y =\operatorname*{arg\,max}_{m=1,2,\cdots,\mathcal{M}}\mathrm{P}(w _{m}|\mathrm{x})\] \[=\operatorname*{arg\,max}_{m=1,2,\cdots,\mathcal{M}}\frac{ \mathrm{P}(\mathrm{x}|w_{m})\mathrm{P}(w_{m})}{\mathrm{P}(\mathrm{x})}, \tag{2}\] \[\propto\operatorname*{arg\,max}_{m=1,2,\cdots,\mathcal{M}}\mathrm{ P}(\mathrm{x}|w_{m})\mathrm{P}(w_{m})\]  
where \(\mathrm{P}(w_{m}|\mathrm{x})\) is the posterior probability, \(\mathrm{P}(w_{m})\) is the prior probability, and \(\mathrm{P}(\mathrm{x}|w_{m})\) is the conditional probability. Generally, the prior probability in Equation (1) can be calculated as follows. \[\mathrm{P}(w_{m})=\frac{\mathcal{N}_{m}}{\mathcal{N}}. \tag{3}\]  
The key of training an NBC for the mixed-attribute classification problem is to calculate the conditional probability based on the independent attribute assumption as follows. \[\mathrm{P}(\mathrm{x}|w_{m}) =\mathrm{P}\big{(}a_{1},\cdots,a_{\mathcal{D}_{1}},b_{1},\cdots,b_ {\mathcal{D}_{2}}|w_{m}\big{)}\] \[=\left[\prod\limits_{i=1}^{\mathcal{D}_{1}}\mathrm{P}(a_{i}|w_{m} )\right]\left[\prod\limits_{j=1}^{\mathcal{D}_{2}}\mathrm{P}(b_{j}|w_{m}) \right]. \tag{4}\]  
Conditional probability \(\mathrm{P}(a_{i}|w_{m})\) corresponding to a discrete attribute value \(a_{i}\) is calculated as follows:  
\[\mathrm{P}(a_{i}|w_{m})=\frac{\sum\limits_{n=1}^{\mathcal{N}_{m}}\mathrm{I} \Big{(}a_{i},a_{ni}^{(m)}\Big{)}}{\mathcal{N}_{m}}, \tag{5}\]  
where  
\[\mathrm{I}(u,v)=\left\{ \begin{array}{ll}1,&\text{if }u=v\\ 0,&\text{if }u\
eq v\end{array} \right. \tag{6}\]is an indicator function that is used to count the frequency of \(a_{i}\) in the \(i\)-th continuous attribute values \(a_{1i}^{(m)},a_{2i}^{(m)},\cdots,a_{N_{m,j}}^{(m)}\) corresponding to samples belonging to the \(m\)-th class.