https://aboutmusicschools.com https://slotmgc.com https://300thcombatengineersinwwii.com https://mobilephonesource.co.uk https://discord-servers.io https://esmark.net https://slotmgc.com https://nikeshoesinc.us https://ellisislandimmigrants.org https://holidaysanthology.com https://southaventownecenter.net https://jimgodfreydesign.com https://mckinneypaintingpros.com https://enchantedmansion.org https://mckinneypaintingpros.com https://laurabrodieauthor.com https://holidaysanthology.com https://ardictionary.com https://113.30.151.116 https://103.252.118.20 https://206.189.83.174 https://157.230.39.109 https://128.199.85.208 https://172.104.51.149 https://174.138.21.250 https://157.245.50.183 https://152.42.239.189 https://188.166.210.125 https://152.42.178.155 https://192.53.172.202 https://172.104.188.91 https://103.252.118.157 https://63.250.61.107 https://165.22.104.74

Penerapan Metode K-Nearest Neighbor untuk Prediksi Harga Gas Alam Menggunakan Python

Authors

  • Selby Diva Qirani Matematika, Universitas Islam Bandung
  • Icih Sukarsih Matematika, Universitas Islam Bandung

DOI:

https://doi.org/10.29313/jrm.v4i1.3602

Keywords:

KNN, Prediksi, RMSE

Abstract

Abstrak. Parameter yang dibutuhkan untuk melakukan prediksi menggunakan KNN adalah nilai p (banyak kolom input), k (banyak data terdekat), serta fungsi jarak yang digunakan. Tujuan penelitian ini adalah untuk mencari parameter terbaik dalam memprediksi harga gas alam berdasarkan nilai Root Mean Squared Error (RMSE) yang paling kecil dengan bantuan bahasa pemrograman Python dan juga penerapan metode K-Fold Cross Validation. Penelitian ini menggunakan data per bulan harga gas alam dunia tertinggi pada bulan tersebut dengan evaluasi tingkat kesalahan yang digunakan adalah Mean Absolute Percentage Error (MAPE). Tujuan dari penelitian ini adalah melakukan prediksi harga gas alam menggunakan metode K-Nearest Neighbor (KNN) serta bagaimana pengaruh penghapusan data pencilan terhadap nilai Mean Absolute Percentage Error (MAPE) dari prediksi harga gas alam. Ditemukan data pencilan pada harga gas alam selama periode 15 bulan terletak di antara selang waktu bulan September 2021 hingga bulan Desember 2022. Parameter terbaik dengan nilai MAPE paling kecil yaitu p = 2, k = 2, dan fungsi jarak Chebysev. Parameter ini memiliki nilai MAPE sebesar 14,5306% dengan tanpa pencilan serta tanpa menerapkan K-Fold Cross Validation. Pada bulan Juni, prediksi harga gas alam adalah $2,8215, sedangkan harga aktualnya yaitu $2,839. Kesalahan relatif yang diukur oleh Mean Absolute Percentage Error (MAPE) pada prediksi ini sebesar 0,6164%.

Abstract. The required parameters for making predictions using KNN include the value of p (number of input columns), k (number of nearest data points), and the distance function used. The objective of this research is to identify the optimal parameters for predicting natural gas prices based on minimizing the Root Mean Squared Error (RMSE) value, utilizing the Python programming language. Additionally, the study involves the implementation of the K-Fold Cross Validation method for a comprehensive evaluation of predictive performance. The research utilizes monthly data on the world's highest natural gas prices, with the evaluation of error rates conducted through the Mean Absolute Percentage Error (MAPE). The objective of this study is to predict natural gas prices using the KNN method and to analyze the impact of outlier data removal on the MAPE of natural gas price predictions. The optimal parameters, yielding the smallest MAPE, are determined to be p = 2, k = 2, and the Chebyshev distance function. These parameters result in an MAPE value of 14,5306%, with no outliers and without applying K-Fold Cross Validation. In the month of June, the predicted natural gas price is $2,8215, while the actual price is $2,839. The relative error, measured by the MAPE for this prediction, is 0,6164%.

References

M. Nanja and Purwanto, “Metode K-Nearest Neighbor Berbasis Forward Selection Untuk Prediksi Harga Komoditi Lada,” Jurnal Pseudocode, vol. 2, no. 1, 2015, [Online]. Available: www.ejournal.unib.ac.id53

S. D. Purwanto, A. C. Fauzan, A. Wahyudi, and F. Y. Mardana, “Sistem Prediksi Harga Kebutuhan Bahan Pokok Nasional Menggunakan Metode K-Nearest Neighbour,” Seminar Nasional Ilmu Komputer, pp. 481–488, 2016.

Y. Mukhlisin, M. Imrona, and D. T. Murdiansyah, “Prediksi Harga Beras Premium dengan Metode Algoritma K-Nearest Neighbor,” e-Proceeding of Engineering, vol. 7, no. 1, pp. 2714–2724, 2020.

D. Sekar Seruni, M. Tanzil Furqon, and R. Cahya Wihandika, “Sistem Prediksi Pertumbuhan Jumlah Penduduk Kota Malang Menggunakan Metode K-Nearest Neighbor Regression,” Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 4, no. 4, pp. 1075–1082, Apr. 2020.

P. B. Utomo, E. Utami, and S. Raharjo, “Implementasi Metode K-Nearest Neighbor dan Regresi Linear Dalam Prediksi Harga Emas,” Jurnal Informasi Interaktif, vol. 4, no. 3, pp. 131–200, 2019, [Online]. Available: http://e-journal.janabadra.ac.id/

C. Aktemur, “An overview of natural gas as an energy source for various purposes,” International Journal of Engineering Technologies IJET, vol. 3, no. 3, pp. 91–104, Sep. 2017, doi: 10.19072/ijet.300750.

“Statistical Review of World Energy 2023 | 72 nd edition,” 2023.

R. R. Saragih, “Pemrograman dan Bahasa Pemrograman.”

F. Tempola, M. Muhammad, and A. Khairan, “Perbandingan Klasifikasi Antara Knn Dan Naive Bayes Pada Penentuan Status Gunung Berapi Dengan K-Fold Cross Validation,” Jurnal Teknologi Informasi dan Ilmu Komputer, vol. 5, no. 5, pp. 577–584, 2018, doi: 10.25126/jtiik20185983.

F. Aditya, D. Devianto, and Maiyastri, “Peramalan Harga Emas Indonesia Menggunakan Metode Fuzzy Time Series Klasik,” Jurnal Matematika UNAND, vol. 8, no. 2, pp. 45–52, 2019.

S. AISYAH, S. WAHYUNINGSIH, and F. AMIJAYA, “Peramalan Jumlah Titik Panas Provinsi Kalimantan Timur Menggunakan Metode Radial Basis Function Neural Network,” Jambura Journal of Probability and Statistics, vol. 2, no. 2, pp. 64–74, Nov. 2021, doi: 10.34312/jjps.v2i2.10292.

Downloads

Published

2024-06-13