Comparative Analysis of K-Nearest Neighbors Algorithm and Random Forest Regressor for House Price Prediction in Bandung City

Authors

  • Dimas Yudhistira Ananda Universitas Amikom Yogyakarta
  • Ferian Fauzi Abdulloh Universitas Amikom Yogyakarta

DOI:

https://doi.org/10.30871/jaic.v10i1.10718

Keywords:

KNN Regressor, Random Forest Regressor, House Price Prediction, Machine Learning, Real Estate Valution, Bandung

Abstract

The rapid population growth and continuous urban expansion in Bandung have contributed to volatile and escalating housing prices, creating significant challenges for market transparency and affordability. This study aims to develop and evaluate machine-learning models to predict house prices in the Bandung region using a publicly available dataset consisting of 7,609 property records. Following the CRISP-DM methodology, the research includes data exploration, preprocessing (outlier handling using IQR, one-hot encoding, and feature standardization), model training, and performance evaluation. Two regression models K-Nearest Neighbors (KNN) Regressor and Random Forest (RF) Regressor—were compared through systematic hyperparameter tuning using Grid Search and Random Search techniques. The experimental results show that the Random Forest Regressor achieves the best performance with an R² score of 0.7838 and a mean absolute error (MAE) of approximately Rp 399.7 million, outperforming the optimized KNN model. Feature importance analysis also indicates that land area, building area, and location are the most influential predictors of property prices. The findings highlight the effectiveness of ensemble methods in handling complex real-estate data and demonstrate the potential of machine-learning-based predictive tools to support buyers, sellers, and policymakers in making informed and data-driven decisions in the Bandung housing market.

Downloads

Download data is not yet available.

References

[1] E. S. Lestari and I. Astuti, “Penerapan Random Forest Regression Untuk Memprediksi Harga Jual Rumah Dan Cosine Similarity Untuk Rekomendasi Rumah Pada Provinsi Jawa Barat,” J. Ilm. FIFO, vol. 14, no. 2, p. 131, 2022, doi: 10.22441/fifo.2022.v14i2.003.

[2] Savitri, N. F., and Nasrudin, N. (2023, November). Peramalan indeks harga properti residensial di kota Bandung tahun 2023. Jurnal Kebijakan Pembangunan Daerah, 7(2), 140–157.

[3] L. Somantri, "Land Price Mapping in the Northern Suburbs of Bandung City West Java Province Indonesia," Forum Geografi, vol. 34, no. 1, pp. 26-40, Jul. 2020, doi: 10.23917/forgeo.v34i1.10412

[4] R. Khoirudin and M. L. A. Kurniawan, "A time-varying of property residential price in Indonesia: a VAR approach," Jurnal Ekonomi & Studi Pembangunan, vol. 24, no. 1, Apr. 2023

[5] E. Fitri, “Analisis Perbandingan Metode Regresi Linier, Random Forest Regression dan Gradient Boosted Trees Regression Method untuk Prediksi Harga Rumah,” J. Appl. Comput. Sci. Technol., vol. 4, no. 1, pp. 58–64, 2023, doi: 10.52158/jacost.v4i1.491.

[6] F. Hidayah, S. J. Angesti, and Y. P. Widyastuti, “Prediksi Harga Rumah di Boston Menggunakan Metode Linear Regression, SVR, Decision Tree dan Random Forest Regression,” pp. 1–9, 2024.

[7] N. Nuris, “Analisis Prediksi Harga Rumah Pada Machine Learning Metode Regresi Linear,” Explore, vol. 14, no. 2, pp. 108–112, 2024, doi: 10.35200/ex.v14i2.123.

[8] V. Ariyani, P. Putri, A. B. Prasetijo, and D. Eridani, “Perbandingan Kinerja Algoritme Naïve Bayes Dan K-Nearest Neighbor (Knn) Untuk Prediksi Harga Rumah,” J. Ilm. Tek. Elektro, vol. 24, no. 2, pp. 162–171, 2022, [Online]. Available: https://ejournal.undip.ac.id/index.php/transmisi

[9] D. Nyoman, M. Cahyani, N. Putu, and K. Indah, “Comparison Of Decision Tree, Linear Regression, and Random Forest Regressor Models for Predicting House Prices Desak Nyoman Mulya Cahyani a1,” J. Ilm. Merpati, vol. 12, no. 1, pp. 62–71, 2024.

[10] Nadia Putri Ariyanti, Agung Triayudi, and Ratih Titi Komala Sari, “Analysis of K-NN Algorithm and Linear Regression to Predict House Prices in Jabodetabek,” SaNa J. Blockchain, NFTs Metaverse Technol., vol. 2, no. 1, pp. 65–71, 2024, doi: 10.58905/sana.v2i1.265.

[11] D. E. Aniobi, C. O. Ochuba, and S. B. Nguideen, “House Price Prediction: Comparative Analysis of Regression-Based Machine Learning Algorithms,” Int. J. Res. Appl. Sci. Eng. Technol., vol. 11, no. 10, pp. 1550–1557, 2023, doi: 10.22214/ijraset.2023.56232.

[12] P. R. Sihombing, D. A. Sunarjo, Y. Paulus, and A. C. Yuda, “Jurnal Ekonomi dan Statistik Indonesia,” vol. 2, no. 3, pp. 307–315, 2022, doi: 10.11594/jesi.02.03.07.

[13] S. M. Faradisa, T. D. Nugrahadi, Muliadi, I. Budiman, and D. Kartini, “Implementasi IQR-SMOTE Untuk Mengatasi Ketidakseimbangan Kelas Pada Klasifikasi Diabetes menggunakan K-Nearest Neighbors,” vol. 15, pp. 48–60, 2021.

[14] S. T. Rizaldi and M. Mustakim, “Perbandingan Teknik Pembagian Data untuk Klasifikasi Sarana Akses Air pada Algoritma K- Nearest Neighbor dan Naïve Bayes Classifier,” Semin. Nas. Teknol. Informasi, Komun. dan Ind. 12, pp. 130–137, 2020.

[15] D. S. Seruni, M. T. Furqon, and R. C. Wihandika, “Sistem Prediksi Pertumbuhan Jumlah Penduduk Kota Malang menggunakan Metode K-Nearest Neighbor Regression,” Sist. Prediksi Pertumbuhan Jumlah Pendud. Kota Malang menggunakan Metod. K-Nearest Neighbor Regres., vol. 4, no. 4, pp. 1075–1082, 2020.

[16] Warjiyono, A. Nur Rais, I. Alfarobi, S. Wira Hadi, and W. Kurniawan, “Analisa Prediksi Harga Jual Rumah Menggunakan Algoritma Random Forest Machine Learning,” JURSISTEKNI (Jurnal Sist. Inf. dan Teknol. Informasi), vol. 6, no. 2, pp. 416–423, 2024.

[17] N. N. Sari, T. T. Anisah, and R. Fitriani, “Implementasi Machine Learning untuk Prediksi Harga Laptop Menggunakan Algoritma Regresi Linear Berganda Machine Learning Implementation for Laptop Price Prediction Using Multiple Linear Regression Algorithm,” vol. 14, pp. 162–177, 2024.

Downloads

Published

2026-02-10

How to Cite

[1]
D. Y. Ananda and F. F. Abdulloh, “Comparative Analysis of K-Nearest Neighbors Algorithm and Random Forest Regressor for House Price Prediction in Bandung City”, JAIC, vol. 10, no. 1, pp. 994–1005, Feb. 2026.

Similar Articles

<< < 42 43 44 

You may also start an advanced similarity search for this article.