# A Hierarchical Multi-Label Classification Algorithm for Gene Function Prediction
## The Proposed Algorithm
### Step 4: Prediction  
In this step, the instances that need to be predicted are first classified by \(|C|\) base classifiers and get the probabilistic preliminary results. As the base classifiers are trained separately, these preliminary results usually violate the TPR rule, so we need some method to ensure that the final results are consistent with the hierarchy constraint. The TPR rule is also described as the hierarchy constraint, which guarantees the consistency of the function annotations in the GO [28]. In practice, for a given instance \(x_{i}\), considering a node \(k\), \(d_{ik}^{*}\) is the preliminary result calculated by the binary classifier at this node, if \(y_{ik}^{*}\) shows that \(x_{i}\) has the label 0 at this node \(k\), but some preliminary results of its children nodes \(d_{ichild(k)}^{*}\) are 1; in this case, the preliminary results for the given instance \(x_{i}\) violate the TPR rule. When such case occurs, we need to use some methods to revise the results of \(x_{i}\) to ensure the final results obey the TPR rule. In this paper, a novel method based on the Bayesian network is proposed to tackle this problem [29], which is called the nodes interaction method. The nodes interaction method is designed to resolve the problem that the results of parent and children nodes are inconsistent with the hierarchy. The key idea of this method is that, when determining the final predicted labels, the hierarchy of the classes should be considered. As the GO hierarchy is a DAG structure, the prediction of a node is not only decided by its base classifier, but also influenced by its adjacent nodes, such as parent or children nodes. There are two phases in the nodes interaction method: preliminary results correction phase and final decision determination phase. In the preliminary results correction phase, for each instance, the DAG is visited from top to bottom across the hierarchy to correct the predictions that violate the TPR rule. The main purpose of this step is to consider the influence of its parent and children nodes when making decisions for a node. As the base classifier of each node provides the probability for which label an instance should have at this node, this preliminary result can be seen as prior probability of this instance at this node. These nodes are organized as a DAG, and we want to get the final result of an instance at each node, which is to calculate the posterior probability of this instance at each node. This circumstance is very similar to the Bayesian network [30]. Given an instance \(x_{i}\), its preliminary result at node \(k\) is \(d_{ik}^{*}\), and \(d_{ik}^{*}\) along with the results at parent nodes \(d_{ipar(k)}^{*}\) or at children nodes \(d_{ichild(k)}^{*}\) violate the true path rule. In the preliminary results' correction phase, the Bayesian network is used to make the decision at the node \(k\). For the instance \(x_{i}\), considering the node \(k\), its parent nodes \(par(k)\) and children nodes \(child(k)\), the DAG is detached into two parts: the parent nodes part and the children nodes part. The Bayesian network is utilized in each part, respectively, to calculate the posterior probability \(P(k=1)\). When only considering the parent nodes of a particular node \(k\), the posterior probability \(P(k=1)\) is denoted as \(P_{par}(k)\), and the formula to get \(P_{par}(k)\) is:  
\[\left\{ \begin{array}{l}P_{par}(k=1)=P^{*}(k=1)\prod_{j\in par(i)}P^{*}(j=1), \\ P_{par}(k=0)=1-P_{par}(k=1).\end{array} \right. \tag{5}\]  
As in [13], two thirds of each data set is used as the training data set and the remaining one third for testing. In each training set, two thirds of it is used for the actual training and the remaining one third is for optimizing parameters. In addition, as some of the data sets contain missing features, the mean of the non-missing values for that feature have managed to replace the missing values of that feature [32]. We downloaded the GO file from the GO website [21], which includes hierarchical relationships between different GO terms [33].