# Thermal Runaway Diagnosis of Lithium-Ion Cells Using Data-Driven Method
## 3 Data-Driven Thermal Runaway Diagnosis
### Decision Tree Ensemble  
A classifier ensemble combines multiple classification models to enhance the prediction accuracy and generalization compared to a single classifier [24]. We use the decision tree as the weak classification model where the standard CART algorithm [25; 26] is used to build trees.  
We use the adaptive boosting aggregation method, which sequentially trains learners as the classifier ensemble [27]. The algorithm calculates the weighted pseudo-loss of each classifier \(t\) over \(N\) samples and \(K\) classes:  
\[e_{t}=\frac{1}{2}\sum_{i=1}^{N}\sum_{k\
eq y_{i}}d_{i,k}^{t}(1-h_{t}(\mathbf{x }_{i},y_{i})+h_{t}(\mathbf{x}_{i},k)) \tag{1}\]  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Range** & **Selected** & **Note** \\ \hline Box constraint & \([10^{-3},10^{3}]\) & 374.73 & - \\ \hline Strategy & [OvR, OvO] & OvO & - \\ \hline Kernel function & [Linear, Gaussian, Polynomial] & Gaussian & - \\ \hline Feature scale & \([10^{-3},10^{3}]\) & 6.14 & - \\ \hline Polynomial order & \([2,4]\) & - & Polynomial \\ \hline \hline \end{tabular}
\end{table}
Table 2: Hyperparameter of SVM.  
where \(y_{i}\in\{1,\ldots,K\}\) is the class label of sample \(i\), \(h_{t}(\mathbf{x}_{i},k)\) is the confidence probability of classifier obtained by model \(t\) to class \(k\) of sample \(i\), and \(d_{i,k}^{t}\) is the weight of classifier \(t\) to class \(k\) of sample \(i\). Note that the second part of the sum is over all erroneous classes \(k\
eq y_{i}\).  
It essentially increases and decreases weights for misclassified samples and correctly classified samples, respectively, by classifier \(t\). The data are then used to train the next classifier \(t+1\) using the updated weights \(d_{i,k}^{t+1}\). The decision trees use the pseudo-loss as a metric of classification accuracy. After training finishes, it uses the weighted combination of the multiple models to estimate the class of new sample \(\mathbf{x}\):  
\[h_{fin}(\mathbf{x})=\arg\,\max_{k\in K}\sum_{t=1}^{T}\eta\alpha_{t}h_{t}( \mathbf{x},k) \tag{2}\]  
where \(\eta\) is the learning rate and \(\alpha_{t}=\log\Bigl{(}\frac{1-e_{t}}{e_{t}}\Bigr{)}\) are weights of the classifier within the ensemble.  
Table 3 summarizes the hyperparameter to optimize for the aggregation method and decision tree model. We adapt the number of ensemble learning cycles where we train one weak tree learner at every learning cycle. Furthermore, we optimize the learning rate \(\eta\) for shrinkage of the adaptive boosting aggregation method by multiplying \(\eta\) by \(\alpha_{t}\), essentially the shrink in the contribution of each new model learned in the ensemble. This parameter controls how much the new model contributes to the existing one. The hyperparameters of the decision tree model include the maximal number of node splits, the minimum number of samples per leaf, and the split criterion [26]. The depth of a tree affects the training time, memory consumption, and classification accuracy. Large values of the maximal number of node splits per tree and small values of the minimum number of samples per leaf generate deep trees. A decision tree splits nodes according to various criteria, including Gini's diversity, deviance (also known as cross-entropy), and the twoing rule.