# Low-Cost Handheld Spectrometry for Detecting Flavescence Doree in Vineyards
## 2 Materials and Methods
### Ensemble-Based Feature Selection  
Selection score importance (SSI) has been introduced by [PERSON] [31] within random forest taking advantage of the so-called \"split node function\". It selects a specific feature characteristic during the classification process to divide a tree at each training phase, thus, incorporating feature importance as one of its natural core functions [32; 33]. Figure 3: Machine learning pipeline for bands selection and classification. Feature importance measures the significance of the feature to predict the target value. This technique is computed by summing the weighted impurity reductions of all nodes averaging them across the set of trees within the forest. As a consequence, features could be filtered based on this feature significance assessment. Sequential feature selector (SFS), on the other hand, compares the combinations of the different resulting feature subsets using a forward approach. In our case, we extracted the best-performing features subset exploiting the forward selection approach as in [PERSON] et al. [29]. Recursive feature elimination (REF), similar to tree-based feature importance models, assigns recursively weights to the feature coefficients starting with the complete set of features by iteratively pruning the least important ones until reaching the targeted number of features [29]. For the sake of diversity, we have used two tree-based classifiers to assess the efficiency of the feature selected, the XGBoost classifier for SSI and the random forest classifier for REF and SFS. This way, we selected the 100 best features by using the ensemble method. Genetic Algorithms (GA)  
Inspired by the Darwinian, most fundamental evolution theorem ideas are the meta-heuristic GA [30]. It was first developed as a search method modeled after the natural selection process of evolution, in which most suitable solutions are positively evolved through generations by means of operators like mutation, crossover, and selection. In this context, it has been utilized to further reduce the precedent selected subset of bands to extract the fittest individuals. In other words, the resulting subset of bands obtained by the first step ensemble selection methods (Figure 4) may have a range of spectral bands incorporating redundant and highly correlated feature bands which can be eliminated. Thus, we are searching for the least relevant bands that could be dropped without impacting much our classification accuracy performance. The GA method starts by randomly creating an initial collection of population chromosomes (i.e., \(p=20\)) that serve as potential solutions to our optimization task. A chromosome stands for a resolution of a binary array of size \(N\) (i,e, \(N=100\)), representing the spectral input wavelength bands (a subset of selected features) where 1 denotes the feature band is picked and 0 it is dropped. As a result, the first population has initial potential solutions with population \(P\) of size \(M\) from a \(2^{N}\) possible chromosome feature subset. In the following stage, the quality of each chromosome (solution) in the generated initial population is assessed using a selection operation based on an objective function. Natural selection then starts its generational process generating the set of chromosomes allowed to reproduce and become parents and pass their genes. The crossover procedure is then used to recombine the data from the two parents chosen in the previous phase to create new progenies. It chooses a random cut point and accomplishes the combination between two chromosomes by mixing them for the new population. Another genetic operation used to increase population variety is the mutation operation, which modifies the genetic make-up of parents depending on a mutation rate. A random gene band is chosen from an arbitrary selected chromosome in the new population, and its value is changed from 0 to 1 or vice versa (Figure 5). The purpose of mutation is to avoid the algorithm settling on a local minimum.