The inheritance and migration characters of different elements in the soil profile can serve agriculture, environmental protection, mineral exploration and other related research fields. These characters are mainly determined by the various geochemical behaviours of different elements. However, the elemental behaviours for the same element might vary wildly due to various local physical, chemical and biological environments, because the transformation of rock to soil includes rock-weathering and pedogenic processes. Here, we propose a framework for evaluating the elemental inheritance and migration characters from the underlying rocks or C horizons during local rock-weathering and pedogenic processes. In this framework, random forest regression was used to evaluate the importance of controlling factors, i.e. parent material or rock, climate, vegetation and topography, for individual elements during both processes. Further hierarchical clustering analysis was used to group elements into three inheritance categories according to their controlling factors. The framework was then applied in the Daliangshan area. Finally, we give some suggestions on the assessment of mineral resources, environment and agriculture according to the elemental inheritance categories in the Daliangshan area. This methodological approach can be applied to other localalities. Thematic collection: This article is part of the Applications of Innovations in Geochemical Data Analysis collection available at: https://www.lyellcollection.org/topic/collections/applications-of-innovations-in-geochemical-data-analysis Supplementary material: The original data and average feature importance for 5000 simulations are available at https://doi.org/10.6084/m9.figshare.c.6274315