# Decision Support System for Medical Diagnosis Utilizing Imbalanced Clinical Data
## 3 Proposed Methodology
### COCOA Method for Class-Imbalanced Data  
The task of multi-label learning is to learn a multi-label classifier \(h:\mathrm{X}\to 2^{\mathrm{Y}}\) from the training set. In other words, this is for learning \(q\) real-valued functions \(f_{j}:\mathrm{X}\to\mathbb{R}(1\leq j\leq q)\), and each function is combined with a threshold \(t_{j}:\mathrm{X}\to\mathbb{R}\). For each inputting example \(x\in\mathrm{X},f_{j}(x)\) denotes a confidence of relating \(x\) to class label \(y_{j}\), and the predictive class label set is established as follows:  
\[h(x)=\left\{y^{j}|f_{j}(x)>t_{j}(x),1\leq j\leq q\right\} \tag{2}\]  
For the class label \(y_{j}\), \(D_{j}\) denotes the binary training set from original training set \(D\):  
\[D_{j}=\left\{(x_{i},\phi(Y_{i},y_{j}))\big{|}1\leq i\leq N\right\} \tag{3}\] \[\text{where }\phi(Y_{i},y_{j})=\left\{ \begin{array}{rl}+1,& \text{if }y_{j}\in Y_{i}\\ -1,&\text{otherwise}\end{array} \right.\]  
Instead of learning a binary classifier from \(D_{j}\), i.e., \(g_{j}\gets B(D_{j})\), which considers that labels are independent, COCOA tries to incorporate label correlations in the learning classification model. In COCOA, another class label \(y_{k}(k\
eq j)\) is randomly selected to couple with \(y_{j}\). Given the label pair \((y_{j},y_{k})\), a multi-class training set is presented as follows:  
\[D_{jk}=\left\{(x_{i},\phi(Y_{i},y_{j},y_{k}))\big{|}1\leq i\leq N\right\} \tag{4}\] \[\text{where }\phi(Y_{i},y_{j},y_{k})=\left\{ \begin{array}{rl}0,& \text{if }y_{j}\
otin Y_{i}\text{ and }y_{k}\
otin Y_{i}\\ +1,&\text{if }y_{j}\
otin Y_{i}\text{ and }y_{k}\in Y_{i}\\ +2,&\text{if }y_{j}\in Y_{i}\text{ and }y_{k}\
otin Y_{i}\\ +3,&\text{if }y_{j}\in Y_{i}\text{ and }y_{k}\in Y_{i}\end{array} \right.\]  
Supposing that the minority class in binary training set \(D_{j}/D_{k}\) corresponds to the positive examples of label \(y_{j}/y_{k}\), the first class and the fourth class in \(D_{jk}\) would consist of largest and smallest number of examples. While the original imbalance ratios in binary training sets are \(\mathrm{Im}R_{j}\) and \(\mathrm{Im}R_{k}\), respectively, the imbalance ratio would roughly turn into \(\mathrm{Im}R_{j}\cdot\mathrm{Im}R_{k}\) in four-class training set \(D_{jk}\), which implies that the worst-case imbalance ratio in a four-class training set would be much larger than that in a binary training set. To deal with this problem, COCOA converts the four-class training set into tri-class training set as follows:  
\[D_{jk}^{tri}=\left\{(x_{i},\phi^{tri}(Y_{i},y_{j},y_{k}))|1\leq i\leq N\right\} \tag{5}\] \[\text{where }\phi^{tri}(Y_{i},y_{j},y_{k})=\left\{ \begin{array}{rl} 0,&\text{if }y_{j}\
otin Y_{i}\text{ and }y_{k}\
otin Y_{i}\\ +1,&\text{if }y_{j}\
otin Y_{i}\text{ and }y_{k}\in Y_{i}\\ +2,&\text{if }y_{j}\in Y_{i}\end{array} \right.\]  
In this case, for the new third class, its imbalance ratio of the first class and that of the second class would roughly turn into \(\frac{\mathrm{Im}R_{j}\cdot\mathrm{Im}R_{k}}{1+\mathrm{Im}R_{k}}\) and \(\frac{\mathrm{Im}R_{j}}{1+\mathrm{Im}R_{k}}\), which are much smaller than the imbalance ratio \(\mathrm{Im}R_{j}\cdot\mathrm{Im}R_{k}\) of the worst case in a four-class training set. By applying a multi-class learner on \(D_{jk}^{tri}\), the multi-class classifier can be induced as \(g_{jk}\gets M(D_{jk}^{tri})\). \(g_{ik}(+2|x)\) represents the predictive confidence that example \(x\) ought to have positive assignment of label \(i\), regardless of \(x\) having positive or negative assignment of label \(k\). In COCOA, a subset of \(K\) class labels \(L_{k}\subseteq Y\backslash y_{j}\) is selected randomly for each class label for pairwise coupling. The predictive confidences of a binary-class learner and \(K\) multi-class learners aggregate to determine the real-value function \(f_{j}(x)\):  
\[f_{j}(x)=g_{j}(+1|x)+\sum\
olimits_{y_{k}\in L_{k}}g_{ik}(+2|x) \tag{6}\]  
COCOA chooses a constant function \(t_{j}(x)=a_{j}\) to set the thresholding function \(t_{j}(\cdot)\).