## 2 Materials and Methods
### Chemometric Processing of IR Data
#### 2.3.1 Individual Kmeans Clustering for Associating IR Spectral Signatures with Tissue Structures  
The Kmeans clustering method is an unsupervised analysis method based on the use of an iterative algorithm. This analysis allows to group all the spectra of an image in \(K\) clusters (number of clusters usually determined by the user) according to a minimum Euclidean distance criterion between each spectrum and the closest cluster center (spectra centroid). This analysis allows reconstructing color-coded images where each cluster is associated with a color. By confronting Kmeans images with standard histology analysis, it is possible to associate clusters with specific tissue structures. So, the spectral images of the calibration set were confronted with HES staining performed on the adjacent slides. In this study, we used a more accomplished version of Kmeans developed in our laboratory [26]. This algorithm presents the advantage to determine automatically the optimal number \(K\) of clusters. It was applied individually to each image of the TMA.  
2.3.2 Partial Least Square-Discriminant Analysis (PLS-DA) for Automatic Selection of Image IR Pixels  
PLS-DA algorithm was employed to implement qualitative classification models. In this study, it can be considered as a quality test to avoid outliers pixels likely to parasite the subsequent PLS analysis (see next paragraph), PLS-DA was, therefore, used for automatic selection of pixels to be scored according to the NAC response scale. For every qualitative variable, a binary code (0 or 1) is associated. A multivariate regression PLS is then realized between the spectral data matrix and the binary matrix. Then, the PLS-DA model predicts multivariate values linked to spectra present in the dataset. The obtained multivariate values are then correlated to corresponding qualitative groups.  
3.3 Partial Least Square (PLS) Modeling for Scoring the Response to NAC Based on the IR Signatures of the Tissue Specimens  
The PLS approach was employed to associate to each pixel of an image a score associated with the responder (R)/non-responder (NR) status. Here, a scale from 0 to 10 was used to take into account the spectral heterogeneity of the samples, with the reference values for NR and R fixed to 1 and 9 respectively. The PLS algorithms are based on a multivariate regression principle and allow to maximize the covariance between 2 matrixes through multidimensional and orthonormal regression vectors spaces [27].  
In our study, the calibration and optimization of the PLS model were based on a leave-one-out cross-validation method carried out at the level of the spectral images (rather than at the pixel level to avoid overfitting). The principle of cross-validation is based on the prediction of one sample (one spectral image in our case) beforehand removed from the calibration set, the model is built with the remaining samples. This process is repeated for all the samples of the calibration set. An averaged root mean square error (RMSE) of prediction is then obtained. Based on this average value, it is possible to determine the optimal dimension of the vectorial space, i.e., the number of regression vectors to minimize the RMSE. RMSE was calculated as follows:  
\[\text{RMSE}=\sqrt{\frac{\sum_{i=1}^{n}(y_{i}-y_{Hi})^{2}}{n-1}}\]  
with \(y_{i}\) being the reference value for the \(i\)th spectrum, \(y_{Hi}\) being the predicted value of the \(i\)th spectrum, and \(n\) being the number of spectra.