## 2 Methods  
Predicting parameters of seminal quality such as sperm concentration can be viewed as a binary classification problem. Given the training dataset of \(n\) labeled observations \(D=\{(\mathbf{x}_{i},y_{i})|i=1,2,\cdots,n\}\), where \(\mathbf{x}=(x_{1},x_{2},\cdots,x_{p})^{T}\in X\) is a vector of variables (life habits, environmental factors, _etc._), \(y\in Y=\{0,1\}\) is the class label (0 for \"Normal\" sperm concentrations and 1 for \"Altered\" ones in our case). Our goal is to predict unknown sperm concentration result \(y\) on new test variables \(\mathbf{x}^{\prime}\) with the learning model \(Y=f(X)\) built upon training data \(D\). As we point out above, most standard learning algorithms do not perform well on imbalanced datasets, which is frequently met in medical decision making practices. Some classification models might work well in the case of easier imbalance classification problem, as shown in the left panel of Figure 1. However, when majority class samples overlap with the minority class data due to ambiguous boundary or noisy samples (shown in the right panel of Figure 1), it is rather difficult to find a satisfactory classification model for such data. Here, we use a three-stage ensemble learning framework called Clustering-Based Decision Forests (CBDF) to tackle such problems. In the first stage, to deal with the class imbalance problem, the majority class data are cleaned using the Tomek Links approach. In the second stage, a majority subset and a bagging minority data are combined together to form a balanced dataset to train each base learner. In the third stage, random subspace method is applied to generate a diverse forest of decision trees. We will elaborate the proposed learning algorithm in the following. Stage One: Removal of majority Tomek Links. Suppose \(\mathbf{x}_{i},\mathbf{x}_{j}\) belong to different classes (_i.e._, \(y_{i}\
eq y_{j}\)), and \(d(\mathbf{x}_{i},\mathbf{x}_{j})\) is the distance between them. A \((\mathbf{x}_{i},\mathbf{x}_{j})\) pair is called a _Tomek Link_[9] if there is no example \(\mathbf{x}_{l}\), such that \(d(\mathbf{x}_{i},\mathbf{x}_{l})<d(\mathbf{x}_{i},\mathbf{x}_{j})\) or \(d(\mathbf{x}_{j},\mathbf{x}_{l})<d(\mathbf{x}_{i},\mathbf{x}_{j})\). In other words, if the nearest neighbors of \(\mathbf{x}_{i}\) and \(\mathbf{x}_{j}\) have different class labels, then these two observations are called a pair of Tomek Links. Tomek Link observations are usually noisy and borderline samples and can be removed to increase prediction accuracy. In unbalanced learning settings, due to scarcity of minority data, for pairs of Tomek Links, we only remove the majority observations and reserve the minority ones. Stage Two: Balancing the training data. In medical decision making, only a small portion of the samples are minority ones and in the seminal prediction case the altered ones are rare and of interest. Thus, the normal samples are collected to complement the altered ones during the classification process. The chosen semen samples are normal for various reasons and might be further divided into several subsets based on some kind of similarity measure. If a training set is composed of one subset of majority  
Figure 1: Why the majority class samples must be clustered. samples and all the minority samples, it would be easy to train a better base classifier using such more balanced training samples. Based on this consideration, in the proposed algorithm, the majority samples are clustered into \(k\) majority subsets. The parameter \(k\) is determined by the class imbalance ratio (number of majority samples divided by number of minority examples). One may notice that common clustering algorithms do not necessarily produce \(k\) majority subsets of equal size. Thus, to prevent prediction accuracy problems caused by very small sized samples, majority subsets whose sizes are less than a threshold are discarded. In practice, the number of base classifiers in the ensemble \(l\) is usually much larger than \(k\) to ensure prediction accuracy.