Back to Search Start Over

Comparison of The K-Nearest Neighbor Regression Method and The Multiple Linear Regression Method on The Boston Housing Data

Authors :
Ihzaniah, Lutfi Sivana
Setiawan, Adi
Wijaya, Rachel Wulan Nirmalasari
Publication Year :
2023

Abstract

Penelitian ini dibuat guna untuk melihat perbandingan metode mana yang lebih baik antara metode regresi KNN (K-Nearest Neighbor) dan metode regresi linear berganda pada data Boston Housing. Metode KNN merupakan metode memprediksi sesuatu berdasarkan contoh pelatihan terdekat dari suatu objek. Sedangkan regresi linear berganda merupakan teknik peramalan dengan melibatkan lebih dari satu variabel bebas. Pengolahan data dilakukan menggunakan software RStudio. Perbandingan kedua metode tersebut didasarkan dari hasil ukuran kebaikan Mean Absolute Percent Error (MAPE) yang mana semakin besar nilai MAPE maka akurasinya akan semakin buruk sedangkan semakin kecil nilai MAPE maka akurasinya akan semakin baik. Ada beberapa definisi jarak yang bisa digunakan untuk menghitung nilai regresi KNN dan pada penelitian ini definisi jarak yang digunakan adalah jarak Euclidean, jarak Manhattan, dan jarak Minkowski. Nilai K pada metode KNN mendefinisikan banyak tetangga terdekat yang akan diperiksa untuk menentukan nilai suatu variabel terikat, pada penelitian ini menggunakan nilai K dari 1 sampai 10 untuk setiap data uji dan definisi jarak. Dalam penelitian ini digunakan persentase data uji sebesar 20%, 30%, dan 40% untuk kedua metode tersebut. Perolehan nilai MAPE terbaik metode regresi KNN adalah 12,89% pada saat K = 3 untuk jarak Euclidean, 12,77% pada saat K = 3 untuk jarak Manhattan, dan 13,22% pada saat K = 3 untuk jarak Minkowski sedangkan hasil nilai MAPE terbaik untuk metode regresi linear berganda yaitu sebesar 17,17%. Metode yang terbaik antara kedua metode tersebut adalah metode regresi KNN dilihat dari perolehan nilai MAPE metode regresi KNN yang lebih kecil dibandingkan dengan nilai MAPE metode regresi linear berganda. This research was made in order to see which method is better between the KNN (K-Nearest Neighbor) regression method and the multiple linear regression method on Boston Housing data. The KNN method is a method to predict something based on the closest training examples of an object. Meanwhile, multiple linear regression is a forecasting technique involving more than one independent variable. Data processing was done using RStudio software. The comparison of the two methods is based on the results of the Mean Absolute Percent Error (MAPE), where the greater the MAPE value, the worse the accuracy, while the smaller the MAPE value, the better the accuracy. There are several definitions of distance that can be used to calculate the KNN regression value and in this research the definitions of distance used are Euclidean distance, Manhattan distance, and Minkowski distance. The K value in the KNN method defines the number of nearest neighbors to be examined to determine the value of a dependent variable, in this study using K values from 1 to 10 for each test data and definition of distance. In this research, the percentage of test data used was 20%, 30%, and 40% for both methods. The best MAPE value obtained by the KNN regression method was 12,89% at K = 3 for Euclidean distance, 12,77% at K = 3 for Manhattan distance, and 13,22% at K = 3 for Minkowski distance. Meanwhile the best MAPE value for the multiple linear regression method is 17,17%. The best method between the two methods is the KNN regression method as seen from the MAPE value of the KNN regression method which is smaller than the MAPE value of the multiple linear regression method.

Details

Language :
Indonesian
Database :
OpenAIRE
Accession number :
edsair.od......3314..8fe1bdc16651349e515aa62a0858191e