## 3 Methodology
### Modeling
#### 3.4.2 Extra Tree Classifier (ETC)  
The extra tree classifier (ETC), also known as extremely randomized trees, is an ensemble learning method that combines multiple decision trees to create a robust and accurate predictive model. It introduces an extra level of randomization during the tree-buildingprocess by randomly selecting splitting thresholds for each feature, thereby increasing diversity and reducing overfitting. This makes it well-suited for handling noisy data, outliers, and high-dimensional features [34].  
The extra tree classifier pseudocode provided in Algorithm 2 outlines the step-by-step procedure and hyperparameter choices that were used to construct an effective model in this research. These hyperparameters included the number of decision trees, the number of features to consider at each split, the random state for reproducibility, the number of estimators, the minimum number of samples required to split an internal node, the minimum number of samples required to be at a leaf node, the maximum number of features to consider at each split, the maximum depth of each tree, the split criterion, the class weights, and the use of bootstrap sampling.  
By adjusting these hyperparameters, the behavior and performance of the extra tree classifier could be fine-tuned to meet the requirements of the dataset. For example, the number of decision trees influenced the complexity and diversity of the model. The number of features to consider at each split controlled the subset of features used for splitting nodes, while the random state ensured the reproducibility of the results. The number of estimators determined the number of trees in the ensemble. The minimum number of samples required to split an internal node and the minimum number of samples required to be at a leaf node defined the stopping criteria for tree growth. The maximum number of features to consider at each split limited the feature space explored during tree construction. The maximum depth of each tree restricted the depth of the decision trees, preventing overfitting. The split criterion determined the measure of impurity used to evaluate the split quality. Class weights could be assigned to balance the contributions of different classes during training. Finally, the bootstrap hyperparameter enabled sampling with replacement, allowing each tree in the ensemble to have a different subset of training data.
```
1:training dataset: \(D\)
2:\(n\_estimators\): [100, 200, 300]
3:\(max\_features\): ['sqrt', 'log2', None]
4:\(random\_state\): [42, 123]
5:\(min\_samples\_split\): [2, 5, 10]
6:\(min\_samples\_leaf\): [1, 2, 5]
7:\(max\_depth\): [5, 10, 15]
8:\(class\_weight\): [None, \"balanced\"]
9:\(bootstrap\): [True, False]
10:\(criterion\): [\"gini\", \"entropy\"]
11:
12: Ensemble prediction: \(E(X)\)
13:procedureExtraTreesClassifier(\(D\), \(n\_estimators\), \(max\_features\), \(random\_state\), \(min\_samples\_split\), \(min\_samples\_leaf\), \(max\_features\), \(max\_depth\), \(criterion\), \(class\_weight\), \(bootstrap\), \(Random\_state\))
14:for\(t=1\) to \(n\_estimators\)do
15:\(D_{t}\leftarrow\) Bootstrap sample from \(D\)
16:Build a decision tree on \(D_{t}\) using \(max\_features\) and random split thresholds
17:endfor
18:\(E(X)\leftarrow\) Majority vote of predictions from all trees on input \(X\)
19:return\(E(X)\)
20:endprocedure
```
**Algorithm 2** The extra trees classifier pseudocode