# Research on a Mixed Gas Classification Algorithm Based on Extreme Random Tree
## 2 Hybrid Gas Detection Method
### Extreme Random Tree Algorithm
#### 2.4.2 Extreme Random Tree Algorithm  
The Extreme Random Tree is similar to the random forest algorithm [57]; it is integrated by multiple decision trees and thus has many of the same advantages. For example, it has an excellent classification effect and high accuracy, and high-dimensional feature data can be processed effectively without using feature selection. The execution process can be parallelized for efficiency. For mixed gas detection and classification, the integrated learning algorithm has higher classification accuracy, but each decision tree uses all the original data in the extreme random tree algorithm, while the random forest algorithm uses bootstrap sampling to generate the training samples. When the extreme random tree splits at a node, the splitting node is randomly selected, and the optimal splitting threshold or feature is not selected. Figure 4 is a schematic diagram of an extreme random tree algorithm. The following is an analysis of the difference between the extreme random tree and the random forest algorithm:  
Figure 4: Extreme random tree algorithm. First, the training samples of the random forest algorithm are generated by bootstrap sampling. However, each decision tree in the extreme random tree uses all the original training sample data, which helps to reduce the variation of the model. Second, when the node is split, the random forest classification algorithm first selects some features from all features, and then accurately selects the best split mode (such as the Gini index) through splitting according to these features to generate the decision tree. The extreme random tree algorithm is a random splitting selection method. The specific implementation process is as follows: for splitting the category form, randomly select some categories of data to put into one branch and put the other categories of data into another branch; for numerical form splitting, a threshold between the maximum and minimum value is randomly selected, which is the data principle of the left and right branches. Data larger than the threshold value are put into one branch, while data smaller than the threshold value are put into another branch. Then, for the classification problem in this paper, the GINI index is used to calculate the split value. Traverse all the features of the node and obtain all the feature split values, and select the feature with the largest split value for splitting (for the regression problem, use the mean square error to calculate the split value). In the extreme random tree algorithm, since all the training data samples are OOB (out of bag) data samples, the calculation of the prediction error for the extreme random tree is the error calculation for the OOB sample. In the research of this subject, it is found that the extreme random tree is superior to the random forest algorithm in terms of the time efficiency of training, accuracy of classification, and ability to fit training data [58]. The specific implementation steps of the extreme random tree are as follows:  
The extreme random tree algorithm is represented by \(\{E(K,X,D)\}\), where E denotes a classifier model, D denotes a raw data sample, and K denotes the number of decision trees. Each decision tree produces a prediction result based on the sample input \(X=\{x_{1}x_{2},\ldots x_{M}\}\) and finally obtains a classification decision according to the voting rule. (1) In the classification model of the extreme random tree, each base classifier uses all the training samples (OOB samples) for training, assuming the original dataset, D, the number of samples, N, and the number of features, M.  
(2) Generate a decision tree according to the classification and regression tree (CART) algorithm. In the process of node splitting, M features are randomly selected from the M features in each splitting node, some categories are randomly selected and put into one branch, and the remaining categories are put into another branch.