# Application of Machine Learning Ensemble Methods to ASTRI Mini-Array Cherenkov Event Reconstruction
## 5 Tests on New Methods for Gamma/Hadron Separation
### Tests on Gamma/Hadron Separation
We train the model using 80% of the training sample as the training set and evaluating its performance on the remaining 20% of the data, which serves as the test set. This score will be our baseline. Then, we shuffle one feature at a time on the test set and feed the data to the new model to obtain a new score. If the shuffled feature is important, the model should suffer a drastic drop in its score. On the other hand, if the feature is not important, the model should not be impacted. By means of these two feature importance methods, we evaluate more parameters set. We add a random feature to test our feature importances evaluation (see Figure 3). The random feature is expected to have importance equal to zero. Different sets of features have been considered for testing, and all sets share the following common set of ten parameters. The benchmark parameters M3 LONG and NUMCORE have been removed from the common set because they were found to have lower performance in terms of feature importance estimation (see Figure 3). 1. \(log_{10}(SIZE)\)
2. \(WIDTH\)
3. \(LENGTH\)
4. \(DENS\)
5. \(CONC\)
6. \(NUSEDTL\)
7. \(TELIP\)
8. \(STMAXH\)
9. \(LEAKAGE\)
10. \(NLIMBOUNDARY\)  
Figure 3: Feature importances for gamma hadron discrimination computed with two methods: (**Left**) Mean decrease in impurity method. (**Right**) Permutation method. \"GH SET 1\" adds two parameters for a total of twelve:  
1. \(DELTA\)
2. \(ASYM\)
3. \(``\)GH SET 2\" adds five parameters for a total of fifteen:  
1. \(NIMCORE\)
2. \(DELTA\)
3. \(ASYM\)
4. \(ECCE\)
5. \(ELONG\)  
\"GH SET 3\" adds four parameters for a total of fourteen:  
1. \(M3 LONG\)
2. \(NIMCORE\)
3. \(DELTA\)
4. \(ASYM\)  
All the parameters are level DL2a input parameters or a combination of them (e.g., \(ECCE\) and \(ELONG\), defined previously). We have used the same training samples for our tests and for the benchmark. Pruning is performed on the samples used for training with the aim of balancing the number of hadron and gamma images in each bin of \(log_{10}(SIZE)\). Specifically, the simulated images were divided into 100 logarithmic bins based on their sizes, and within each bin, the number of hadron images and the number of gamma images were made equal by pruning images in excess of the lower count. For our experiments, we had a total of 136,498 gamma images and 126,645 hadron images. After pruning, we removed 14,204 gamma images and 4351 hadron images. The remaining hadron and gamma images were balanced, with 122,294 of each remaining. By performing this pruning step, we ensured that the training data were less likely to be skewed towards one type of particle or the other, thereby reducing the risk of poor performance on the test data. Hyperparameter tuning was performed by means of a randomized search that implements a \"fit\" and a \"score\" method on the following hyperparameters:  
* \(n\)_estimators_ is the number of decision trees in the Random Forest;
* _max features_ is the maximum number of features that are considered at each split in the decision tree;
* _max depth_ is the maximum depth of the decision trees in the Random Forest;
* _min samples split_ is the minimum number of samples required to split an internal node in the decision tree;
* _minimum samples leaf_ is the minimum number of samples required to be at a leaf node in the decision tree;
* _bootstrap_: in Machine Learning, the process of bootstrapping consists of replacing random samples of the training data with replacement from the original dataset to create multiple different subsets of the data. Each subset is used to train a separate model, and the results are combined to produce a final model. In the context of Random Forests, bootstrapping is used to create multiple decision trees, each trained on a different subset of the training data. The idea is that by training on different subsets of the data, the decision trees will differ from each other in ways that help to reduce overfitting and improve generalization performance.