Research Article

Feature Attribution and Error Diagnosis of a Random Forest Housing Price Prediction Model Integrating SHAP and LIME

Ruoxian Wang*
Minzu University of China

* Corresponding author: [email protected]

Abstract

Housing is one of the most basic needs of humanity globally, and fluctuations in housing prices have garnered significant attention. Currently, the scale of China's second-hand housing transaction market is rapidly expanding. Understanding the factors influencing second-hand housing prices can enhance transaction efficiency and achieve a balance between supply and demand. This article obtains the Ames dataset from Kaggle and selects the Random Forest (RF) model, which is a relatively mature model in the field of housing price prediction, for training. It integrates Shapley Additive exPlanations (SHAP) and the Local Interpretable Model-agnostic Explanation (LIME) to analyze the importance of housing features. The results indicate that the RF model exhibits good performance in predicting housing prices. The SHAP analysis reveals that the most significant global features influencing second-hand housing prices are the quality of building materials and decoration, followed by living area, and there is an interaction between these two factors. Furthermore, it utilizes LIME to perform local attribution on high-quality small-area samples in the test set. The results revealed that the local contribution of living area in such samples was significantly reduced, and replaced by features such as housing functionality, indicating that the decision logic of the RF model may deviate in local areas that deviate from the mainstream distribution.

Keywords: second-hand housing prices; random forest; SHAP method; LIME; price forecast
Published: June 15, 2026
DOI: 10.54254/2753-8818/2026.DL34409
Volume: TNS Vol.180
pp. 31-38
Download PDF

References

  1. Hong, J., Choi, H., & Kim, W. (2020). A house price valuation based on the random forest approach: The mass appraisal of residential property in South Korea. International Journal of Strategic Property Management, 24(3), 140–152.
  2. Time Is Gentle and Quiet. (2017). Analysis of factors affecting the price of second-hand housing in Beijing based on Lasso and data mining (Master's thesis). Beijing University of Technology. (In Chinese) (Note: Pseudonyms or unique online handles used as author names are capitalized as proper nouns per APA rules).
  3. Shi, A. H., Lu, L., & Yu, K. Y. (2026). Comparative study on real estate value prediction model based on random forest and deep neural network. Computer Age, (1), 47–51, 57.
  4. Hao, C. Y. (2020). Research on second hand housing transaction price prediction based on ensemble learning (Master's thesis). Shanxi University.
  5. Du, W. Y. (2024). Prediction of second-hand housing prices based on stacking fusion model and SHAP feature analysis (Master's thesis). Lanzhou University.
  6. De Cock, D. (2011, November 1). Ames, Iowa: Alternative to the Boston housing data as an end of semester regression project. Kaggle. Retrieved March 16, 2026, from
  7. Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32.
  8. Tao, Y., Xu, Z. C., & Tan, J. B. (2026). Prediction and driving mechanism analysis of soil organic carbon storage in Qinghai Tibet Plateau based on XGBoost-SHAP coupling model. Environmental Science, 1–17. Advance online publication.
  9. Yin, H., Alizamir, M., Heddam, S., et al. (2026). Improving prediction accuracy of mechanical strengths in high-performance concrete using advanced metaheuristic-based extreme learning machines: Incorporation of SHAP and LIME model explainers. Ain Shams Engineering Journal, 17(6), Article 104136.
  10. Wang, S. C., & Xu, Y. F. (2026). Research on the bias governance framework of inclusive finance algorithm based on the integration of SHAP and LIME. China Collective Economy, (12), 141–144.
  11. Song, J. (2022). Analysis of the impact of the quality of educational resources and school district policies on school district housing prices (Master's thesis). Southwestern University of Finance and Economics.
  12. Yang, Y. L. (2025). Research on the second hand housing price evaluation model based on SSA-XGBoost — Taking Xi'an Qujiang New Area as an example. China Collective Economy, (36), 85–88.
  13. Liang, Q. Y., Zhong, R., & Liu, B. (2026). Research on the spatio temporal differentiation characteristics and influencing factors of residential housing prices — Based on the multi-source data analysis of second-hand housing in Guangzhou. Shanghai Real Estate, (3), 56–62.