Comparison between Multiple Linear Regression Method and K-Nearest Neighbor Method for Regression on Iris Data


  • Adi Setiawan Universitas Kristen Satya Wacana



KNN method, iris data, root mean square of error, mean absolute error, mean absolute percentage error.


This study aims to determine the statistics used in regression models such as RMSE, MAPE, MAE and R2 using the KNN method for regression. The measure of the goodness of the method used is MAPE. The data used is iris data which has been used by many people as an example of data. Variations in the proportion of test data were carried out by 10%, 20%, 30% and 40%. In the proportion of test data of 20%, successively obtained the results that MAPE for case 1, case 2 and case 3 is 5.885 %, 7.778%, 6.979% while in case 4 is 19.341%. As a result, it is obtained that predictions using the KNN method successfully predict/forecast with highly accurate forecasting in case 1, case 2 and case 3 while in case 4 the KNN method predicts with good forecasting.



Download data is not yet available.


Arslan, H., & Arslan, H. (2021). A New COVID-19 Detection Method from Human Genome Sequences using CpG Island Features and KNN Classifier. Engineering Science and Technology, an International Journal, 24(4), 839–847.

Cosenza, D. N., Korhonen, L., Maltamo, M., Packalen, P., Strunk, J. L., Næsset, E., Gobakken, T., Soares, P., & Tomé, M. (2021). Comparison of Linear Regression, k-Nearest Neighbour and Random Forest Methods in Airborne Laser-Scanning-based Prediction of Growing Stock. Forestry: An International Journal of Forest Research, 94(2), 311–323.

Fu, Y., He, H. S., Hawbaker, T. J., Henne, P. D., Zhu, Z., & Larsen, D. R. (2019). Evaluating k-Nearest Neighbor (kNN) Imputation Models for Species-Level Aboveground Forest Biomass Mapping in Northeast China. Remote Sensing, 11(17).

Hatem, M. Q. (2022). Skin Lesion Classification System using a K-Nearest Neighbor Algorithm. Visual Computing for Industry, Biomedicine, and Art, 5(1).

Hatipoğlu, Ş., Belgrat, M. A., Degirmenci, A., & Karal, Ö. (2021). Prediction of Unemployment Rates in Turkey by k-Nearest Neighbor Regression Analysis. 2021 Innovations in Intelligent Systems and Applications Conference (ASYU), 1–5.

Jabbar, M. A., Prasad, K. M., Peng, S.-L., Reaz, M. B. I., & Madureira, A. M. (2021). Machine Learning Methods for Signal, Image and Speech Processing. River Publishers.

Jung, A. (2022). Machine Learning: Foundations, Methodologies, and Applications. Springer.

Moreno, J. J. M., Pol, A. P., Abad, A. S., & Blasco, B. C. (2013). Using the R-MAPE Index as a Resistant Measure of Forecast Accuracy. Psicothema, 25(4), 500–506.

Murni, Kosasih, R., Fahrurozi, A., Handhika, T., Sari, I., & Lestari, D. P. (2020). Travel Time Estimation for Destination in Bali Using kNN-Regression Method with Tensorflow. IOP Conference Series: Materials Science and Engineering, 854(1).

Nababan, A. A., Khairi, M., & Harahap, B. S. (2022). Implementation of K-Nearest Neighbors (KNN) Algorithm in Classification of Data Water Quality. Jurnal Mantik, 6(1), 30–35.

Priambodo, B., Rahayu, S., Hazidar, A. H., Naf’An, E., Masril, M., Handriani, I., Pratama Putra, Z., Kudr Nseaf, A., Setiawan, D., & Jumaryadi, Y. (2019). Predicting GDP of Indonesia using K-Nearest Neighbour Regression. Journal of Physics: Conference Series, 1339(1).

Roback, P., & Legler, J. (2021). Beyond Multiple Linear Regression. CRC Press.

Theerthagiri, P., Jacob, I. J., Ruby, A. U., & Vamsidhar, Y. (2021). Prediction of COVID-19 Possibilities using KNN Classification Algorithm. International Journal of Current Research and Review, 13(6), 156–164.




How to Cite

Setiawan, A. (2021). Comparison between Multiple Linear Regression Method and K-Nearest Neighbor Method for Regression on Iris Data. Journal of Science and Science Education, 5(2), 26–35.