ABSTRACT This research focuses on understanding the spatial variation of Soil Organic Matter (SOM) and pH levels in the North of Morocco. The study employs a comprehensive approach to enhance predictive modelling, incorporating the Boruta algorithm for effective environmental covariates selection and optimizing model parameters through hyperparameter optimization. Utilizing a Random Forest (RF) model with remote sensing indices and topographic features, the research predicts SOM and pH to identify key contributors to their spatial variability. SOM prediction saw significant success, with a notable correlation to remote sensing indices such as the RVI, NDVI, and TNDVI. These indices, indicative of vegetation health and productivity, emerged as primary influencers of SOM. In comparison, the influence of topographic features like elevation, slope, and aspect was found to be less significant. Conversely, predicting pH was challenging due to the minimal spatial variability within the dataset. Addressing this limitation could involve dataset expansion or alternative models for low-correlated data handling. Despite the RF model’s limited efficacy in pH prediction, an observable correlation between SOM and pH was identified, consistent with prior research. Areas with higher SOM exhibited lower pH values, indicating relative soil acidification from organic matter decomposition. The study’s RF model demonstrated potential in SOM prediction using remote sensing indices, but enhancing pH prediction is essential. Future research may explore dataset expansion, diverse sampling, or testing alternative predictive models for better performance with low-correlated datasets. The study offers valuable insights for advanced predictive model development and enriches understanding of soil management practices.