Machine learning for house pricing: evaluating categorical encoders and price correction indexes on real transaction data
摘要
The real estate market is highly influenced by heterogeneous and subjective factors, making property pricing a challenging problem for predictive modeling. This study aims to evaluate the performance of machine learning (ML) models in predicting residential property sales values, focusing on the effect of categorical variable encoding and real estate price correction indexes. A dataset of 306 properties sold in Juiz de Fora, Brazil, was collected from real estate companies and brokers, including physical and locational attributes. Two algorithms were compared—Extreme Gradient Boosting (XGBoost) and Artificial Neural Networks (ANN), using tenfold cross-validation —combined with four encoders (Label, One Hot, Target, and James–Stein) and four Brazilian price correction indexes (IPCA, IGP-M, INCC, and FipeZAP). The R2 varied from 0.44 to 0.72, with the best results being achieved by the XGBoost model, the Target encoder, and the configuration without price correction (using month and year of sale as input, not any correction index). This result indicates that the ML algorithm can better overcome the temporality issue than generic/national inflation indexes. Feature importance analysis revealed that the number of bathrooms, property area, and number of rooms were the most influential variables. The study highlights that real transaction data combined with appropriate categorical encoding can significantly improve predictive accuracy, while public price indexes may not necessarily enhance performance due to regional and methodological differences. These findings contribute to data-driven property valuation, offering methodological insights for both researchers and practitioners.