## 3 Basic Settings for Gamma/Hadron Separation  
We describe here how our tests were incorporated in the already existent analysis software A-SciSoft, developed for the analysis of the data collected by ASTRI Mini-Array and ASTRI-Horn.  
In the benchmark configuration, A-SciSoft employs a Random Forest algorithm applied to a set of morphological and stereoscopic parameters (see Section 3) to provide a \"gammaness\" indicator for the gamma/hadron separation and to reconstruct the shower energy and arrival direction. For our tests, we use the same tool, adding a set of several time parameters to the morphological parameter set.  
The feature importance scores generated by the Random Forest model guided our selection of the most relevant parameters, further optimizing the performance of our classification algorithm.  
To optimize the classifier's performance, we implemented a systematic data balancing strategy based on the shower size parameter \(log_{10}(SIZE)\) (SIZE represents the total photoelectron content in the cleaned image, as detailed in Section 3). We partitioned the full dataset into 100 logarithmic SIZE bins and applied selective pruning to achieve equal representation of gamma and hadron events within each bin.  
Our initial dataset comprised the following:  
* 136,498 gamma-ray events;
* 126,645 hadron events.  
The pruning algorithm selectively removed:
* 14,204 gamma-ray events;
* 4351 hadron events.  
This process yielded a perfectly balanced final dataset containing 122,294 events of each type. This careful equilibration across the SIZE parameter space serves two crucial purposes: it prevents classification bias that could arise from uneven event distributions, and it ensures robust performance across the full range of shower intensities. Such balancing is particularly important for machine learning applications in gamma-ray astronomy, where classification accuracy must be maintained across multiple orders of magnitude in shower size.  
Hyperparameter tuning was performed by means of a randomized search that implements a \"fit\" and a \"score\" method.  
Our implementation employs a carefully optimized set of hyperparameters, selected to balance computational efficiency with classification performance:  
* **Ensemble Size** (\(n\_estimators=100\)): We deployed a forest of 100 decision trees, representing an optimal compromise between model complexity and predictive power. While larger ensembles were tested, we observed diminishing returns beyond this size, with minimal performance gains from hundreds of trees and prohibitive computational costs from thousands.
* **Feature Sampling** (\(max\_features=\sqrt{n\_features}\)): At each decision node, the algorithm considers a subset of features equal to the square root of the total feature count, promoting diversity in the decision-making process.
* **Tree Architecture**:
* \(max\_depth=20\): limits each tree's maximum depth to prevent overfitting while maintaining sufficient model complexity;
* \(min\_samples\_split=2\): Requires at least two samples to justify further node splitting;
* \(min\_samples\_leaf=2\): Ensures each terminal node contains at least two samples.
* **Sampling Strategy** (\(bootstrap=True\)): Implements bootstrap aggregating (bagging) during tree construction, where each tree trains on a randomly sampled subset of the data. This approach enhances model robustness and reduces overfitting by introducing diversity in the training process.  
This configuration achieves an effective balance between model complexity, computational efficiency, and classification performance across our gamma-hadron discrimination tasks.