# A Bi-LSTM Based Ensemble Algorithm for Prediction of Protein Secondary Structure
## 2 Materials and Performance Measure
### Performance Measure  
Overall, accuracy (Q\({}_{3}\)) [19], Matthews correlation coefficients (MCC) [20], and segment overlap measure (SOV) [21] are widely used to evaluate the prediction performance of protein secondary structure. For the individual amino acid, Q\({}_{3}\) accuracy and MCC are fairly good evaluation indexes. Generally, several adjacent amino acids compose the \(\alpha\)-helices and \(\beta\)-strands structures. Even a high accuracy of the individual amino acid does not mean that the prediction of protein secondary structure is truly correct. Therefore, we adopted the SOV index, which is a more appropriate measure for the prediction accuracy of protein secondary structure. (a) Q\({}_{3}\) accuracy  
The confusion matrix has broadly been applied to measure the performance of classifiers. A confusion matrix used to evaluate the prediction accuracy of protein secondary structure was first proposed in Ref [17]. It defined M with a size of \(3\times 3\), the number of residues observed in the state i but predicted as the state j was denoted as Mij, where i, j \(\in\{\text{H},\text{E},\text{C}\}\). The following formula is the definition of Q\({}_{3}\):  
\[\text{Q}_{3}=\frac{1}{\text{N}}\sum\limits_{\text{i=1}}^{3}\text{M}_{\text{ ii}} \tag{1}\]  
where N is the total number of the residues in the dataset. The accuracy of each secondary structure can be calculated as  
\[\text{Q}_{\text{i}}=\frac{1}{\text{n}_{\text{i}}}\text{M}_{\text{ii}} \tag{2}\]  
where n\({}_{\text{i}}\) in the denominator denotes the total number of the amino acid residues which are observed in the state i. (b) Matthews correlation coefficient (MCC)  
The Matthews correlation coefficient is used in machine learning as a measure for the quality of binary classifications, and also to evaluate the prediction accuracy of protein secondary structure. Specifically, for a particular state i \(\in\{\text{H},\text{E},\text{C}\}\), the corresponding MCC is given by  
\[\text{MCC}_{\text{i}}=\frac{\text{p}_{\text{i}}\times\text{n}_{\text{i}}- \text{u}_{\text{i}}\times\text{o}_{\text{i}}}{\sqrt{\left(\text{p}_{\text{i }}+\text{u}_{\text{i}}\right)\times\left(\text{p}_{\text{i}}+\text{o}_{\text{i }}\right)\times\left(\text{n}_{\text{i}}+\text{u}_{\text{i}}\right)\times\left( \text{n}_{\text{i}}+\text{o}_{\text{i}}\right)}} \tag{3}\]  
where \(\text{p}_{\text{i}}=\text{M}_{\text{ii}}\), \(\text{n}_{\text{i}}=\sum\limits_{\text{j}\
eq\text{i}}^{3}\sum\limits_{\text {k}\
eq\text{i}}^{3}\text{M}_{\text{jk}}\), \(\text{o}_{\text{i}}=\sum\limits_{\text{j}\
eq\text{i}}^{3}\text{M}_{\text{ jj}}\), \(\text{u}_{\text{i}}=\sum\limits_{\text{j}\
eq\text{i}}^{3}\text{M}_{\text{ jj}}\). (c) The segment overlap measure (SOV)  
Differing from Q\({}_{3}\) and MCC, SOV represents the true prediction performance by calculating the average overlap between the observed and predicted states. For a particular state i \(\in\{\text{H},\text{E},\text{C}\}\), it is defined as  
\[\text{SOV}_{\text{i}}=\frac{1}{\text{n}_{\text{i}}}\sum\limits_{\text{S}_{ \text{i}}}\frac{\text{MINOV}(\text{S}_{1},\text{S}_{2})+\text{DELTA}(\text{S} _{1},\text{S}_{2})}{\text{MAXOV}(\text{S}_{1},\text{S}_{2})} \tag{4}\]  
where S\({}_{1}\) and S\({}_{2}\) denote the observed and predicted results for the state i \(\in\{\text{C},\text{E},\text{H}\}\), S\({}_{\text{i}}\) is the number of all overlapping segment pairs \((\text{S}_{1},\text{S}_{2})\) in the state i; MINOV\((\text{S}_{1},\text{S}_{2})\) represents the length of the actual overlap between S\({}_{1}\) and S\({}_{2}\); MAXOV\((\text{S}_{1},\text{S}_{2})\) is the length of the total extent for which either the segments S\({}_{1}\) or S\({}_{2}\) has a residue in the state i; n\({}_{\text{i}}\) denotes the total number of amino acids residues that are observed in the state i. The definition of DELTA\((\text{S}_{1};\text{S}_{2})\) is  
\[\text{DELTA}(\text{S}_{1},\text{S}_{2})=\text{MIN}\left\{