Comparing Long Short-Term Memory and Random Forest Accuracy for Bitcoin Price Forecasting

  • Munirul Ula Universitas Malikussaleh, Aceh, Indonesia
  • Veri Ilhadi Universitas Malikussaleh, Aceh, Indonesia
  • Zailani Mohamed Sidek Universiti Teknologi Malaysia, Kuala Lumpur, Malaysia
Keywords: Accuracy, Bitcoin, Forecasting, Long Short-Term Memory, Random Forest

Abstract

Bitcoin’s daily value fluctuations are very dynamic. Understanding its rapid and intricate price movements demands advanced techniques for processing complex data. This research aims to compare the accuracy of two machine learning methods, Random Forest (RF) and Long Short-Term Memory (LSTM), in predicting Bitcoin price. This research employs RF and LSTM algorithms to forecast Bitcoin prices using a two-year Yahoo Finance dataset. The evaluation metrics used were accuracy based on Mean Absolute Percentage Error (MAPE) and computational power (CPU-Z). As a result of this research, the LSTM model demonstrates higher accuracy compared to the RF model. MAPE reveals LSTM’s precision of 99.8% and RF’s accuracy of 90.1%. Regarding computational time and resources, RF shows slightly better performance than LSTM. The visual comparison further emphasizes LSTM’s better performance in predicting Bitcoin prices, highlighting its potential for informed decision-making in cryptocurrency trading. This research contributes valuable insights into the effectiveness, strengths, and weaknesses of LSTM and RF models in predicting cryptocurrency trends.

Downloads

Download data is not yet available.

References

[1] R. Afrinanda, L. Efrizoni, W. Agustin, and R. Rahmiati, “Hybrid Model for Sentiment Analysis of Bitcoin Prices using Deep
Learning Algorithm,” MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer, vol. 22, no. 2, pp. 309–324,
mar 2023.
[2] S. Velankar, S. Valecha, and S. Maji, “Bitcoin price prediction using machine learning,” in 2018 20th International
Conference on Advanced Communication Technology (ICACT). IEEE, feb 2018, pp. 144–147. [Online]. Available:
https://ieeexplore.ieee.org/document/8323675/
[3] P. Ciaian, M. Rajcaniova, and d’Artis Kancs, “The economics of BitCoin price formation,” Applied Economics, vol. 48, no. 19,
pp. 1799–1815, apr 2016.
[4] R. Gupta and J. E. Nalavade, “Metaheuristic Assisted Hybrid Classifier for Bitcoin Price Prediction,” Cybernetics and Systems,
vol. 54, no. 7, pp. 1037–1061, oct 2023.
[5] Y. Li and W. Dai, “Bitcoin price forecasting method based on CNNLSTM hybrid neural network model,” The Journal of
Engineering, vol. 2020, no. 13, pp. 344–347, jul 2020.
[6] S. Tandon, S. Tripathi, P. Saraswat, and C. Dabas, “Bitcoin Price Forecasting using LSTM and 10-Fold Cross validation,” in
2019 International Conference on Signal Processing and Communication (ICSC). IEEE, mar 2019, pp. 323–328.
[7] S. Ji, J. Kim, and H. Im, “A Comparative Study of Bitcoin Price Prediction Using Deep Learning,” Mathematics, vol. 7, no. 10,
p. 898, sep 2019.
[8] H. Kundra, S. Sharma, P. Nancy, and D. Kalyani, “A two level ensemble classification approach to forecast bitcoin prices,”
Kybernetes, vol. 52, no. 11, pp. 5041–5067, nov 2023.
[9] R. Sriwiji and A. H. Primandari, “An Empirical Study in Forecasting Bitcoin Price Using Bayesian Regularization Neural
Network,” in Proceedings of the Proceedings of the 1st International Conference on Statistics and Analytics, ICSA 2019, 2-3
August 2019, Bogor, Indonesia. EAI, 2020, pp. 1–12. [Online]. Available: http://eudl.eu/doi/10.4108/eai.2-8-2019.2290515
[10] Y. Zhu, J. Ma, F. Gu, J. Wang, Z. Li, Y. Zhang, J. Xu, Y. Li, Y. Wang, and X. Yang, “Price Prediction of Bitcoin Based on
Adaptive Feature Selection and Model Optimization,” Mathematics, vol. 11, no. 6, pp. 1–22, mar 2023. [Online]. Available:
https://www.mdpi.com/2227-7390/11/6/1335
[11] N. Jagannath, T. Barbulescu, K. M. Sallam, I. Elgendi, A. A. Okon, B. Mcgrath, A. Jamalipour, and K. Munasinghe, “A
Self-Adaptive Deep Learning-Based Algorithm for Predictive Analysis of Bitcoin Price,” IEEE Access, vol. 9, no. February,
pp. 34 054–34 066, 2021. [Online]. Available: https://ieeexplore.ieee.org/document/9359745/
[12] S. M. Raju and A. M. Tarif, “Real-Time Prediction of BITCOIN Price using Machine Learning Techniques and Public
Sentiment Analysis,” arxiv, pp. 1–14, jun 2020. [Online]. Available: http://arxiv.org/abs/2006.14473
[13] C. Dinshaw, R. Jain, and S. A. I. Hussain, “Statistical Scrutiny of the Prediction Capability of Different Time Series Machine
Learning Models in Forecasting Bitcoin Prices,” in 2022 IEEE 4th International Conference on Cybernetics, Cognition and
Machine Learning Applications (ICCCMLA). IEEE, oct 2022, pp. 329–336.
[14] H. Jang and J. Lee, “An Empirical Study on Modeling and Prediction of Bitcoin Prices With Bayesian Neural Networks Based
on Blockchain Information,” IEEE Access, vol. 6, pp. 5427–5437, 2018.
[15] S. A. Gyamerah, “Are Bitcoins price predictable? Evidence from machine learning techniques using technical indicators,” sep
2019. [Online]. Available: http://arxiv.org/abs/1909.01268
[16] W. Riyadi and J. Jasmir, “Performance Prediction of Airport Traffic Using LSTM and CNN-LSTM Models,” MATRIK : Jurnal
Manajemen, Teknik Informatika dan Rekayasa Komputer, vol. 22, no. 3, pp. 627–638, jul 2023.
[17] Y. Fang, T. Li, and H. Zhao, “Random Forest Model for the House Price Forecasting,” in 2022 14th International Conference
on Computer Research and Development (ICCRD). IEEE, jan 2022, pp. 140–143.
[18] M. J. Hamayel and A. Y. Owda, “A Novel Cryptocurrency Price Prediction Model Using GRU, LSTM and bi-LSTM Machine
Learning Algorithms,” AI, vol. 2, no. 4, pp. 477–496, oct 2021.
[19] M. Shin, D. Mohaisen, and J. Kim, “Bitcoin Price Forecasting via Ensemble-based LSTM Deep Learning Networks,” in 2021
International Conference on Information Networking (ICOIN). IEEE, jan 2021, pp. 603–608.
[20] C. Kaope and Y. Pristyanto, “The Effect of Class Imbalance Handling on Datasets Toward Classification Algorithm Performance,”
MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer, vol. 22, no. 2, pp. 227–238, mar 2023.
[21] M. I. C. Rachmatullah, “The Application of Repeated SMOTE for Multi Class Classification on Imbalanced
Data,” Teknik Informatika dan Rekayasa Komputer, vol. 22, no. 1, pp. 13–24, 2022. [Online]. Available: https:
//creativecommons.org/licenses/by-nc-sa/4.0/
[22] S. Hartini, Z. Rustam, G. S. Saragih, and M. J. Segovia Vargas, “Estimating probability of banking crises using random
forest,” IAES International Journal of Artificial Intelligence (IJ-AI), vol. 10, no. 2, pp. 407–413, jun 2021. [Online]. Available:
http://ijai.iaescore.com/index.php/IJAI/article/view/20880
[23] K. Gawthorpe, “Random Forest as a Model for Czech Forecasting,” Prague Economic Papers, vol. 30, no. 3, pp. 336–357, jun
2021.
[24] P. Wang, K. Xu, Z. Ding, Y. Du, W. Liu, B. Sun, Z. Zhu, and H. Tang, “An Online Electricity Market Price Forecasting Method
Via Random Forest,” IEEE Transactions on Industry Applications, vol. 58, no. 6, pp. 7013–7021, nov 2022.
[25] Z. Ye, Y. Wu, H. Chen, Y. Pan, and Q. Jiang, “A Stacking Ensemble Deep Learning Model for Bitcoin Price
Prediction Using Twitter Comments on Bitcoin,” Mathematics, vol. 10, no. 8, pp. 1–21, apr 2022. [Online]. Available:
https://www.mdpi.com/2227-7390/10/8/1307
[26] G. Budiprasetyo, M. Hani’ah, and D. Z. Aflah, “Prediksi Harga Saham Syariah Menggunakan Algoritma Long Short-Term
Memory (LSTM),” Jurnal Nasional Teknologi dan Sistem Informasi, vol. 8, no. 3, pp. 164–172, jan 2023.
[27] C. Chen, Q. Zhang, M. H. Kashani, C. Jun, S. M. Bateni, S. S. Band, S. S. Dash, and K.-W. Chau, “Forecast of rainfall distribution
based on fixed sliding window long short-term memory,” Engineering Applications of Computational Fluid Mechanics,
vol. 16, no. 1, pp. 248–261, dec 2022.
[28] V.W. Siburian and I. E. Mulyana, “Prediksi Harga Ponsel Menggunakan Metode Random Forest,” in Annual Research Seminar
(ARS), 2019, pp. 144–147. [Online]. Available: https://api.semanticscholar.org/CorpusID:209969741
[29] R. Panggabean, Y. Dewi, and L.Widyasari, “A comparison between Super Vector Regression, Random Forest Regressor, LSTM,
and GRU in Forecasting Bitcoin Price,” in Proceeding International Applied Business and Engineering Conference 2022, 2022,
pp. 17–19.
[30] I. Nabillah and I. Ranggadara, “Mean Absolute Percentage Error untuk Evaluasi Hasil Prediksi Komoditas Laut,” JOINS (Journal
of Information System), vol. 5, no. 2, pp. 250–255, nov 2020.
[31] B. Putro, M. Tanzil Furqon, and S. H. Wijoyo, “Prediksi Jumlah Kebutuhan Pemakaian Air Menggunakan Metode Exponential
Smoothing (Studi Kasus : PDAM Kota Malang),” Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 2,
no. 11, pp. 4679–4686, 2019. [Online]. Available: http://j-ptiik.ub.ac.id
[32] S. R. Polamuri*, D. K. Srinivasi, and D. A. K. Mohan, “Stock Market Prices Prediction using Random Forest and Extra Tree
Regression,” International Journal of Recent Technology and Engineering (IJRTE), vol. 8, no. 3, pp. 1224–1228, sep 2019.
[33] M. Rafi, Q. A. K. Mirza, M. I. Sohail, M. Aliasghar, A. Aziz, and S. Hameed, “Enhancing Cryptocurrency Price Forecasting
Accuracy: A Feature Selection and Weighting Approach With Bi-Directional LSTM and Trend-Preserving Model Bias
Correction,” IEEE Access, vol. 11, pp. 65 700–65 710, 2023.
Published
2024-01-30
How to Cite
Ula, M., Ilhadi, V., & Sidek, Z. (2024). Comparing Long Short-Term Memory and Random Forest Accuracy for Bitcoin Price Forecasting. MATRIK : Jurnal Manajemen, Teknik Informatika Dan Rekayasa Komputer, 23(2), 259-272. https://doi.org/https://doi.org/10.30812/matrik.v23i2.3267
Section
Articles