## 2 Materials and Methods
### Experimental Tests: Age Prediction Using Features of Brain Complexity
Thus, the IGI is derived as the ratio between \(ROI_{P}\) and \(ROI_{O}\) areas, quantifying the amount of cortex buried within the sulcal folds in the surrounding spherical region. Then, we averaged the IGI within the entire cortex to obtain a gyrification index (GI) representative of the cortical complexity of each subject. Moreover, we recorded the following FreeSurfer outputs: the cerebral cortical gray matter volume (CortexVol), the estimated intracranial volume (eTIV), and the average cortical thickness (CT) throughout the cerebral cortex. Lastly, we estimated the FD of the cerebral cortex of each subject using four different strategies for the selection of spatial scales. These include the use of (1) a priori selection of the interval 4 mm-256 mm (inspired by [PERSON] et al. [55]) (FD\({}_{A\,priori\,\pi\,\pi}\)); (2) a priori selection of 5-40% of the smallest Euclidean dimension of the cerebral cortex [56] (rounded to the nearest power of 2) (FD\({}_{A\,priori\,\pi}\)); (3) an automated selection of spatial scales, within which the cerebral cortex manifests the highest statistical self-similarity [57; 58] (FD\({}_{Auto\,Marzial\,\pi}\)); (4) an improved automated selection of the interval of spatial scales, based on the search of the interval of spatial scales that presents the highest rounded \(R^{2}_{adij}\) coefficient, and in the case of an equal rounded \(R^{2}_{adij}\) coefficient, preferring the widest interval in the log-log plot (FD\({}_{Auto\,fractal\,brain}\)) [40; 59; 60]. We predicted individual age using an extreme gradient boosting (XGBoost) model--an XGBoost regressor or classifier for regression and classification tasks, respectively. XGBoost is a tree-based machine learning model widely used to achieve cutting-edge performance on a variety of recent machine learning challenges [61]. As inputs, we thus used nine features: the four implementations of the FD of the cerebral cortex, the volume of the cerebral cortex (i.e., CortexVol), the average cortical thickness (i.e., CT), the average gyrification index (i.e., GI), the estimated total intracranial volume (i.e., eTIV), and sex. The models' hyperparameters were chosen from a hyperparameter space through a random search based on the average performance of the model. The hyperparameters space was defined as follows: the minimum loss reduction required to make a further partition on a leaf of the tree \(gamma\in(0.6,0.7,0.8)\), the subsample ratio of columns when constructing each tree \(colsample\_bytree\in(0.25,0.5,0.75,1)\), the maximum depth of a tree \(max\_depth\in(2,3,4)\), the minimum number of instances needed to be in each node \(min\_child\_weight\in(2,3,5)\), the number of decision trees \(n\_estimators\in(5,10,20,100)\), and the ratio of training data randomly sampled prior to growing trees \(subsample\in(0.1,0.2,0.4)\). Moreover, since SHAP has an optimized implementation for tree-based models (called _TreeExplainer_), using XGBoost, we can compute SHAP values in polynomial time, in contrast to model-agnostic explainers for this class of models [62]. We adopted a repeated (100 times) nCV strategy, and we chose a five-fold CV in both the inner and outer loops because it offers a favorable bias-variance trade-off [63]. The performance in the regression and classification tasks has been measured through the mean absolute error (MAE) and area under the receiver operating characteristic (ROC) curve (AUC), respectively. The average MAE or AUC from all repetitions was computed to get a final model assessment score. The repository with all the source code, using Google Colab notebooks, is available on GitHub at [[https://github.com/Imaging-AI-for-Health-virtual-lab/SHAP-in-repeated-nested-CV](https://github.com/Imaging-AI-for-Health-virtual-lab/SHAP-in-repeated-nested-CV)]([https://github.com/Imaging-AI-for-Health-virtual-lab/SHAP-in-repeated-nested-CV](https://github.com/Imaging-AI-for-Health-virtual-lab/SHAP-in-repeated-nested-CV)) (accessed on 29 May 2022).