###### Abstract  
Partial least square regression (PLSR) is a reference statistical model in chemometrics. In astronomy, it is used to predict components (response variables y) of chemical composition of vegetal materials from spectral near infrared (NIR) data \(\mathbf{X}\) collected from spectrometers. PLSR reduces the dimension of the spectral data \(\mathbf{X}\) by defining vectors that are then used as latent variables (LVs) in a multiple linear model. One difficulty is to determine the relevant dimensionality (number of LVs) for the given data. This step can be very time consuming when many datasets have to be processed and/or the datasets are frequently updated. The paper focuses on an alternative, bypassing the determination of the PLSR dimensionality and allowing for automatizing the predictions. The strategy uses ensemble learning methods, such as averaging or stacking the predictions of a set of PLSR models with different dimensionalities. The paper presents various methods of PLSR averaging and stacking and compares their performances to the usual PLSR on six real datasets on different types of forages. The main finding of the study was the overall superiority of the averaging methods compared to the usual PLSR. We therefore believe that such methods can be recommended to analyze NIR data on forages. P 2022  
dimension of \(\mathbf{X}\) to a limited number \(a<<p\) of orthogonal \(n\times 1\) vectors, referred to as scores, computed to maximize their squared covariance with \(\mathbf{y}\). The \(a\) scores are finally used as regressor latent variables (LVs) in an MLR. The determination of the dimensionality \(a\) (number of LVs) relevant for the available data is an important step in PLSR modeling. Many strategies have been addressed in the literature for guiding such a determination [7; 8; 9]. All of these strategies often require decisions based on expertise. In general, some prediction error rates measuring the model performance are estimated for the different dimensionalities \(a=0\), 1, 2, etc., LVs (for instance by cross-validation; CV) and the dimensionality showing the minimum error rate are selected. For data collected on heterogeneous biological material such as forages, however, it is frequent that the error curve does not have a \"U-shape\" with a clear minimum, in particular when the sample size of the training dataset becomes large (\(n>500\) observations). In such a context, the determination of \(a\) can become very time consuming in practice, in particular when many datasets (different types of forages and chemical compositions) have to be processed and/or when the datasets are periodically updated with new reference observations (spectra plus laboratory chemical composition). This last case implies many times re-running the overall process of determining relevant dimensionalities \(a\). An alternative strategy is to automatize the PLSR predictions, bypassing the determination of \(a\). An approach for such automatization, which is presented in this paper, uses ensemble learning methods that average or \"stack\" the predictions of a set of PLSR models with different dimensionalities \(a\). Some methods of model averaging have already been implemented for PLSR in the past [10; 11]. Nevertheless, their performances have not been explored on real datasets of forages. Forage datasets generally contain complex intrinsic material (mixing of stems, leaves, different stages of development, and geographical areas, etc.) and therefore information. The objective of this paper is to present different averaging and stacking methods, and to compare their performances for a large panel of forage datasets to the usual PLSR (i.e., where an optimal number \(a\) of LVs is determined from the examination of an estimate of the prediction error rate). Six spectral datasets \(\mathbf{X}\), each collected on a different type of forage, and nine response variables \(\mathbf{y}\) (each representing a component of the chemical composition) were considered.