# A Hierarchical Multi-Label Classification Algorithm for Gene Function Prediction
## The Proposed Algorithm
### Evaluation Metrics  
Due to the hierarchy and multi-label pecularities of the HMC problem, two sorts of metrics are used to evaluate the proposed algorithm. The first metric category is the classical precision (_Prec_), recall (_Rec_), and \(F_{1}\)[35]. These metrics are mainly designed for the binary classification task with only two classes. We don't select the accuracy (_Acc_) as the evaluation metric because it is not suitable for the imbalanced data set problem. Precision expresses the ratio of positive predictions that are labelled correctly, and recall is the percentage of positive instances that are exactly predicted as positive. \(F_{1}\) is a parameter to combine the tradeoff of _Prec_ and _Rec_ in a single formula. These three metrics are used to evaluate the binary base classifiers:  
\[Prec=\frac{TP}{TP+FP}, \tag{9}\]  
\[Rec=\frac{TP}{TP+FN}, \tag{10}\]  
\[F_{1}=\frac{2\times Prec\times Rec}{Prec+Rec}, \tag{11}\]  
where \(TP\) is the number of true positives (positive instances that are correctly predicted as positive), \(FP\) is the number of false positives (negative predictions that are incorrectly predicted as positive), and \(FN\) is the number of false negatives (positive instances that are incorrectly predicted as negative). Note that these measures do not take into account the number of the negative instances that are predicted correctly. How to evaluate the performance of hierarchical classification algorithms is an open question. Some researchers used the above-defined classical metrics as evaluation measures, but these metrics might not show enough information about which algorithm is really better by not considering the structure of the hierarchy taxonomy [36]. Some authors proposed their own evaluation measures for hierarchical classification, but these measures are used by themselves only. Some evaluation measures such as h-loss are proposed for the tree-structured problems but can not cope with DAGs. Although at present, for all possible hierarchical classification tasks and applications, no hierarchical classification measure can be regarded as the best one, a set of relational metrics is proposed and suggested in [23] to use for evaluation. They are hierarchical precision, hierarchical recall and hierarchical \(F_{1}\), which are denoted as \(hPre\), \(hRec\) and \(hF_{1}\). These metrics are used widely by researchers. The hierarchical precision, hierarchical recall and hierarchical \(F_{1}\) for the \(i\)-th example \(hPre_{i}\), \(hRec_{i}\) and \(hF_{1,i}\) are defined as :  
\[hPre_{i}=\frac{|\hat{P}_{i}\bigcap\hat{T}_{i}|}{|\hat{P}_{i}|}, \tag{12}\]  
\[hRec_{i}=\frac{|\hat{P}_{i}\bigcap\hat{T}_{i}|}{|\hat{T}_{i}|}, \tag{13}\]  
\[hF_{1,i}=\frac{2\times hPre_{i}\times hRec_{i}}{hPre+hRec}, \tag{14}\]  
where, for a test instance \(i\), \(\hat{P}_{i}\) is the set containing all of the predicted classes and their ancestor classes, and \(\hat{T}_{i}\) is the set including all of its true classes and their ancestor classes. These measures are extended versions of the widely used metrics of precision, recall and \(F_{1}\), and are specially designed for the hierarchical classification problem. Furthermore, they can be effectively adapted to both the tree and the DAG structures. Supposing the evaluation of the results measured on a data set with \(n\) instances labeled with \(m\) hierarchical structured classes, there are two methods to combine the performance of all instances: the micro-averaging version and the macro-averaging version [37].