# A Predictive Analysis of Heart Rates Using Machine Learning Techniques

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Data

#### 2.2. Data Pre-Processing

#### 2.3. Autoregressive Integrated Moving Average (ARIMA) Model

#### 2.4. Machine Learning Techniques

#### 2.4.1. Linear Regression

#### 2.4.2. Support Vector Regression (SVR)

#### 2.4.3. K-Nearest Neighbor (KNN) Regressor

#### 2.4.4. Decision Tree Regressor

#### 2.4.5. Random Forest Regressor

#### 2.4.6. LSTM Deep Learning Model

#### 2.5. Data Splitting

#### 2.6. Model Evaluation

## 3. Results

## 4. Discussion

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- WHO. Fact Sheets; Cardiovascular Diseases (CVDs); WHO: Geneva, Switzerland, 2021; Available online: https://www.who.int/en/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds) (accessed on 15 December 2021).
- Chest Heart & Stroke Scotland. Understanding heart disease. Hear. Ser.
**2014**, H3, 3–14. [Google Scholar] - D’Souza, A.; Wang, Y.; Anderson, C.; Bucchi, A.; Baruscotti, M.; Olieslagers, S.; Mesirca, P.; Johnsen, A.B.; Mastitskaya, S.; Ni, H.; et al. A circadian clock in the sinus node mediates day-night rhythms in Hcn4 and heart rate. Hear. Rhythm
**2021**, 18, 801–810. [Google Scholar] [CrossRef] [PubMed] - Alharbi, A.; Alosaimi, W.; Sahal, R.; Saleh, H. Real-Time System Prediction for Heart Rate Using Deep Learning and Stream Processing Platforms. Complexity
**2021**, 2021, 5535734. [Google Scholar] [CrossRef] - Chen, T.; Lucock, M. The mental health of university students during the COVID-19 pandemic: An online survey in the UK. PLoS ONE
**2022**, 17, e0262562. Available online: https://pure.hud.ac.uk/en/publications/the-mental-health-of-university-students-during-the-covid-19-pand (accessed on 11 January 2022). [CrossRef] [PubMed] - Chen, T.; Keravnou-Papailiou, E.; Antoniou, G. Medical analytics for healthcare intelligence–Recent advances and future directions. Artif. Intell. Med.
**2021**, 112, 102009. [Google Scholar] [CrossRef] - Su, P.; Chen, T.; Xie, J.; Zheng, Y.; Qi, H.; Borroni, D.; Zhao, Y.; Liu, J. Corneal nerve tortuosity grading via ordered weighted averaging-based feature extraction. Med. Phys.
**2020**, 47, 4983–4996. [Google Scholar] [CrossRef] - Chen, T.; Shang, C.; Su, P.; Keravnou-Papailiou, E.; Zhao, Y.; Antoniou, G.; Shen, Q. A Decision Tree-Initialised Neuro-fuzzy Approach for Clinical Decision Support. Artif. Intell. Med.
**2021**, 111, 101986. [Google Scholar] [CrossRef] - Knox, S.A.; Chen, T.; Su, P.; Antoniou, G. A Parallel Machine Learning Framework for Detecting Alzheimer’s Disease. In International Conference on Brain Informatics; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2021; Volume 12960, pp. 423–432. [Google Scholar] [CrossRef]
- Chen, T.; Antoniou, G.; Adamou, M.; Tachmazidis, I.; Su, P. Automatic Diagnosis of Attention Deficit Hyperactivity Disorder Using Machine Learning. Appl. Artif. Intell.
**2021**, 35, 657–669. [Google Scholar] [CrossRef] - Gupta, P.; Agrawal, D.; Chhabra, J.; Dhir, P.K. IoT based Smart HealthCare Kit. In Proceedings of the International Conference on Computational Techniques in Information and Communication Technologies (ICCTICT), New Delhi, India, 11–13 March 2016; Available online: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7514585 (accessed on 14 July 2021).
- Kakria, P.; Tripathi, N.K.; Kitipawang, P. A Real-Time Health Monitoring System for Remote Cardiac Patients Using Smartphone and Wearable Sensors. Int. J. Telemed. Appl.
**2015**, 2015, 8. [Google Scholar] [CrossRef] [Green Version] - Trifunovic, M.; Vadiraj, A.M.; van Driel, W.D. MEMS accelerometers and their bio-applications. In Proceedings of the 2012 13th International Thermal, Mechanical and Multi-Physics Simulation and Experiments in Microelectronics and Microsystems, Cascais, Portugal, 16–18 April 2012. [Google Scholar] [CrossRef]
- Rossi, A.; Da Pozzo, E.; Menicagli, D.; Tremolanti, C.; Priami, C.; Sîrbu, A.; Clifton, D.A.; Martini, C.; Morelli, D. A public dataset of 24-H multi-levels psycho-physiological responses in young healthy adults. Data
**2020**, 5, 91. [Google Scholar] [CrossRef] - Khashei, M.; Bijari, M. A novel hybridization of artificial neural networks and ARIMA models for time series forecasting. Appl. Soft Comput.
**2011**, 11, 2664–2675. [Google Scholar] [CrossRef] - Roy, S.; Bhunia, G.S.; Shit, P.K. Spatial prediction of COVID-19 epidemic using ARIMA techniques in India. Model. Earth Syst. Environ.
**2021**, 7, 1385–1391. [Google Scholar] [CrossRef] [PubMed] - Satrio, C.B.A.; Darmawan, W.; Nadia, B.U.; Hanafiah, N. Time series analysis and forecasting of coronavirus disease in Indonesia using ARIMA model and PROPHET. Procedia Comput. Sci.
**2021**, 179, 524–532. [Google Scholar] [CrossRef] - Sadeghi, M.; Sasangohar, F.; McDonald, A.D.; Hegde, S. Understanding Heart Rate Reactions to Post-Traumatic Stress Disorder (PTSD) Among Veterans: A Naturalistic Study. Hum. Factors, 2021; Online ahead of print. [Google Scholar] [CrossRef]
- Mishra, P.; Yonar, A.; Yonar, H.; Kumari, B.; Abotaleb, M.; Das, S.S.; Patil, S. State of the art in total pulse production in major states of India using ARIMA techniques. Curr. Res. Food Sci.
**2021**, 4, 800–806. [Google Scholar] [CrossRef] - da Silva, L.M.; Alvarez, G.B.; Christo, E.D.S.; Sierra, G.A.P.; Garcia, V.D.S. Time series forecasting using ARIMA for modeling of glioma growth in response to radiotherapy. Semin. Ciências Exatas Tecnológicas
**2021**, 42, 3. [Google Scholar] [CrossRef] - Bandyopadhyay, G. Gold Price Forecasting Using ARIMA Model. J. Adv. Manag. Sci.
**2016**, 4, 117–121. [Google Scholar] [CrossRef] - Mehrmolaei, S.; Keyvanpour, M.R. Time series forecasting using improved ARIMA. In Proceedings of the 2016 Artificial Intelligence and Robotics (IRANOPEN), Qazvin, Iran, 9 April 2016; pp. 92–97. [Google Scholar] [CrossRef]
- Chen, T.; Shang, C.; Yang, J.; Li, F.; Shen, Q. A New Approach for Transformation-Based Fuzzy Rule Interpolation. IEEE Trans. Fuzzy Syst.
**2020**, 28, 3330–3344. [Google Scholar] [CrossRef] [Green Version] - Ediger, V.Ş.; Akar, S. ARIMA forecasting of primary energy demand by fuel in Turkey. Energy Policy
**2007**, 35, 1701–1708. [Google Scholar] [CrossRef] - Hill, T.; O’connor, M.; Remus, W. Neural Network Models for Time Series Forecasts Business Systems Innovation Labs View project 3rd Generation Threaded Discussions for m-Learning View project Neural Network Models for Time Series Forecasts. Source Manag. Sci.
**1996**, 42, 1082–1092. [Google Scholar] [CrossRef] - Wei, X.; Zhang, L.; Yang, H.Q.; Zhang, L.; Yao, Y.P. Machine learning for pore-water pressure time-series prediction: Application of recurrent neural networks. Geosci. Front.
**2021**, 12, 453–467. [Google Scholar] [CrossRef] - Masum, S.; Chiverton, J.P.; Liu, Y.; Vuksanovic, B. Investigation of Machine Learning Techniques in Forecasting of Blood Pressure Time Series Data. In International Conference on Innovative Techniques and Applications of Artificial Intelligence; Springer: Cham, Switzerland, 2019. [Google Scholar]
- Mohan, S.; Thirumalai, C.; Srivastava, G. Effective heart disease prediction using hybrid machine learning techniques. IEEE Access
**2019**, 7, 81542–81554. [Google Scholar] [CrossRef] - Casalino, G.; Castellano, G.; Zaza, G. On the use of FIS inside a Telehealth system for cardiovascular risk monitoring. In Proceedings of the 2021 29th Mediterranean Conference on Control and Automation (MED), Puglia, Italy, 22–25 June 2021; pp. 173–178. [Google Scholar] [CrossRef]
- Monkaresi, H.; Calvo, R.A.; Yan, H. A Machine Learning Approach to Improve Contactless Heart Rate Monitoring Using a Webcam. IEEE J. Biomed. Health Inform.
**2014**, 18, 1153–1160. [Google Scholar] [CrossRef] [PubMed] - Biswas, D.; Everson, L.; Liu, M.; Panwar, M.; Verhoef, B.E.; Patki, S.; Kim, C.H.; Acharyya, A.; Van Hoof, C.; Konijnenburg, M.; et al. CorNET: Deep Learning framework for PPG based Heart Rate Estimation and Biometric Identification in Ambulant Environment. IEEE Trans. Biomed. CIRCUITS Syst.
**2019**, 13, 282–291. [Google Scholar] [CrossRef] [PubMed] - Hsu, G.S.J.; Xie, R.C.; Ambikapathi, A.M.; Chou, K.J. A deep learning framework for heart rate estimation from facial videos. Neurocomputing
**2020**, 417, 155–166. [Google Scholar] [CrossRef] - Maragatham, G.; Devi, S. LSTM Model for Prediction of Heart Failure in Big Data. J. Med. Syst.
**2019**, 43, 111. [Google Scholar] [CrossRef] - Nichiforov, C.; Stamatescu, I.; Fagarasan, I.; Stamatescu, G. Energy consumption forecasting using ARIMA and neural network models. In Proceedings of the 2017 5th International Symposium on Electrical and Electronics Engineering (ISEEE), Galati, Romania, 20–22 October 2017; pp. 1–4. [Google Scholar] [CrossRef]
- Jason, B. How to Grid Search ARIMA Model Hyperparameters with Python. 2017. Available online: https://machinelearningmastery.com/grid-search-arima-hyperparameters-with-python/ (accessed on 19 December 2021).
- Beveridge, S.; Oickle, C. A Comparison of Box—Jenkins and objective methods for determining the order of a non-seasonal ARMA Model. J. Forecast.
**1994**, 13, 419–434. [Google Scholar] [CrossRef] - Soumya, S. Cross Validation in Time Series. 2020. Available online: https://medium.com/@soumyachess1496/cross-validation-in-time-series-566ae4981ce4 (accessed on 19 December 2021).
- Mirko, S. Linear Regression in Python–Real Python. 2019. Available online: https://realpython.com/linear-regression-in-python/#linear-regression (accessed on 10 February 2022).
- Sklearn, Sklearn.Linear_Model.LinearRegression—Scikit-Learn 1.0.2 Documentation. 2022. Available online: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html (accessed on 10 February 2022).
- Georgios, D. Decision Tree Regressor Explained in Depth. 2019. Available online: https://gdcoder.com/decision-tree-regressor-explained-in-depth/ (accessed on 10 February 2022).
- Brownlee, J. Deep Learning for Time Series Forecasting: Predict the Future with MLPs, CNNs and LSTMs in Python; Machine Learning Mastery: Huddersfield, UK, 2021; Available online: https://books.google.com.tr/books?hl=tr&lr=&id=o5qnDwAAQBAJ&oi=fnd&pg=PP1&dq=jason+brownleed+deep+learning&ots=yG8avKoh19&sig=0XIzVsPbMQec1K9OJ9niB0qHSnk&redir_esc=y#v=onepage&q=jason+brownleed+deep+learning&f=false (accessed on 8 February 2022).
- Sklearn, MinMaxScaler-Scikit-Learn 1.0.1 Documentation. 2021. Available online: https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MinMaxScaler.html (accessed on 19 December 2021).
- Kingma, D.P.; Ba, J.L. Adam: A Method for Stochastic Optimization. arXiv
**2015**, arXiv:1412.6980. [Google Scholar] - Nguyen, Q.H.; Ly, H.-B.; Ho, L.S.; Al-Ansari, N.; Van Le, H.; Tran, V.Q.; Prakash, I.; Pham, B.T. Influence of data splitting on performance of machine learning models in prediction of shear strength of soil. Math. Probl. Eng.
**2021**, 2021, 4832864. [Google Scholar] [CrossRef] - Dobbin, K.K.; Simon, R.M. Optimally splitting cases for training and testing high dimensional classifiers. BMC Med. Genomics
**2011**, 4, 31. [Google Scholar] [CrossRef] [Green Version] - Tatbul, N.; Lee, T.J.; Zdonik, S.; Alam, M.; Gottschlich, J. Precision and recall for time series. Adv. Neural Inf. Process. Syst.
**2018**, 2018, 1920–1930. [Google Scholar] - Jason, B. How to Calculate Precision, Recall, and F-Measure for Imbalanced Classification. 2020. Available online: https://machinelearningmastery.com/precision-recall-and-f-measure-for-imbalanced-classification/ (accessed on 8 February 2022).
- Varshney, P. Measure Performance for a Time Series Model [ETS or ARIMA]. 2020. Available online: https://towardsdatascience.com/measures-performance-for-a-time-series-model-ets-or-arima-18b0a3e91e83 (accessed on 8 February 2022).
- Boukarta, S. Re: What’s the Acceptable Value of Root Mean Square Error (RMSE), Sum of Squares due to Error (SSE) and Adjusted R-square? 2022. Available online: https://www.researchgate.net/post/Why-does-paracetamol-need-a-certain-moisture-level-and-binder-concentration-for-good-compression-into-a-tablet/534313b0d5a3f2e1578b45b1/citation/download%0Ahttps://www.researchgate.net/post/What_does_EDTA_do_in_agarose_ge (accessed on 4 October 2021).
- Manohar, C.; O’Keeffe, D.T.; Hinshaw, L.; Lingineni, R.; McCrady-Spitzer, S.K.; Levine, J.A.; Carter, R.E.; Basu, A.; Kudva, Y.C. Comparison of Physical Activity Sensors and Heart Rate Monitoring for Real-Time Activity Detection in Type 1 Diabetes and Control Subjects. Diabetes Technol. Ther.
**2013**, 15, 751. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Rossi, A.; Pedreschi, D.; Clifton, D.A.; Morelli, D. Error estimation of ultra-short heart rate variability parameters: Effect of missing data caused by motion artifacts. Sensors
**2020**, 20, 7122. [Google Scholar] [CrossRef] [PubMed]

Model | Mean Average Error | Mean Square Error | Root Mean Square Error | Scattered Index | |
---|---|---|---|---|---|

30 s | ARIMA | 0 | 0 | 0 | 0 |

Linear Regression | 3.12 | 9.75 | 3.12 | 1.76 | |

SVR | 0.51 | 0.26 | 0.51 | 0.29 | |

KNN | 73.2 | 5358.24 | 73.2 | 41.36 | |

Decision Tree | 16 | 256 | 16 | 9.04 | |

Random Forest | 38.5 | 1482.1 | 38.5 | 21.75 | |

LSTM | 60.45 | 3653.93 | 60.45 | 34.15 |

Model | Mean Average Error | Mean Square Error | Root Mean Square Error | Scattered Index | |
---|---|---|---|---|---|

1 min | ARIMA | 0 | 0 | 0 | 0 |

Linear Regression | 3.12 | 9.75 | 3.12 | 1.76 | |

SVR | 0.51 | 0.26 | 0.51 | 0.29 | |

KNN | 73.2 | 5358.24 | 73.2 | 41.36 | |

Decision Tree | 16 | 256 | 16 | 9.04 | |

Random Forest | 38.5 | 1482.1 | 38.5 | 21.75 | |

LSTM | 60.45 | 3653.93 | 60.45 | 34.15 |

Model | Mean Average Error | Mean Square Error | Root Mean Square Error | Scattered Index | |
---|---|---|---|---|---|

3 min | ARIMA | 0.9 | 1.63 | 1.28 | 1.38 |

Linear Regression | 1.41 | 2.7 | 1.64 | 1.76 | |

SVR | 2.58 | 8.93 | 2.99 | 3.2 | |

KNN | 3.07 | 11.38 | 3.37 | 3.62 | |

Decision Tree | 2.52 | 7.86 | 2.8 | 3 | |

Random Forest | 2.67 | 8.69 | 2.95 | 3.16 | |

LSTM | 2.35 | 9.52 | 3.08 | 3.31 |

Model | Mean Average Error | Mean Square Error | Root Mean Square Error | Scattered Index | |
---|---|---|---|---|---|

5 min | ARIMA | 0.87 | 2.08 | 1.44 | 1.57 |

Linear Regression | 1.18 | 2.74 | 1.65 | 1.8 | |

SVR | 2.66 | 8.74 | 2.96 | 3.21 | |

KNN | 2.17 | 7.7 | 2.78 | 3.01 | |

Decision Tree | 1.76 | 5.07 | 2.25 | 2.45 | |

Random Forest | 1.79 | 5.52 | 2.35 | 2.55 | |

LSTM | 2.54 | 9.05 | 3.01 | 3.27 |

Model | Mean Average Error | Mean Square Error | Root Mean Square Error | Scattered Index | |
---|---|---|---|---|---|

10 min | ARIMA | 0.82 | 1.48 | 1.22 | 1.36 |

Linear Regression | 0.93 | 1.5 | 1.23 | 1.38 | |

SVR | 2.08 | 5.7 | 2.39 | 2.68 | |

KNN | 1.42 | 3.11 | 1.76 | 1.98 | |

Decision Tree | 1.04 | 1.72 | 1.31 | 1.47 | |

Random Forest | 0.98 | 1.61 | 1.27 | 1.42 | |

LSTM | 1.75 | 4.42 | 2.1 | 2.36 |

Model | Mean Average Error | Mean Square Error | Root Mean Square Error | Scattered Index | |
---|---|---|---|---|---|

15 min | ARIMA | 0.72 | 1.19 | 1.09 | 1.33 |

Linear Regression | 0.93 | 1.4 | 1.18 | 1.44 | |

SVR | 1.44 | 2.99 | 1.73 | 2.1 | |

KNN | 3.86 | 23.32 | 4.83 | 5.87 | |

Decision Tree | 2.69 | 12.22 | 3.5 | 4.25 | |

Random Forest | 3.36 | 18.63 | 4.32 | 5.25 | |

LSTM | 2.74 | 9.56 | 3.09 | 3.76 |

Model | Mean Average Error | Mean Square Error | Root Mean Square Error | Scattered Index | |
---|---|---|---|---|---|

30 min | ARIMA | 0.88 | 1.97 | 1.4 | 1.64 |

Linear Regression | 0.99 | 2.05 | 1.43 | 1.67 | |

SVR | 1.44 | 3.48 | 1.87 | 2.17 | |

KNN | 1.3 | 3.11 | 1.76 | 2.05 | |

Decision Tree | 1.03 | 2.07 | 1.44 | 1.67 | |

Random Forest | 1.03 | 2 | 1.42 | 1.65 | |

LSTM | 1.63 | 4.01 | 2 | 2.33 |

Model | Mean Average Error | Mean Square Error | Root Mean Square Error | Scattered Index | |
---|---|---|---|---|---|

1 h | ARIMA | 0.93 | 2.34 | 1.53 | 1.71 |

Linear Regression | 0.97 | 2.13 | 1.46 | 1.63 | |

SVR | 1.37 | 3.53 | 1.88 | 2.1 | |

KNN | 1.42 | 3.99 | 2 | 2.23 | |

Decision Tree | 1.1 | 2.64 | 1.63 | 1.82 | |

Random Forest | 1.07 | 2.5 | 1.58 | 1.77 | |

LSTM | 2.15 | 7.38 | 2.72 | 3.04 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Oyeleye, M.; Chen, T.; Titarenko, S.; Antoniou, G.
A Predictive Analysis of Heart Rates Using Machine Learning Techniques. *Int. J. Environ. Res. Public Health* **2022**, *19*, 2417.
https://doi.org/10.3390/ijerph19042417

**AMA Style**

Oyeleye M, Chen T, Titarenko S, Antoniou G.
A Predictive Analysis of Heart Rates Using Machine Learning Techniques. *International Journal of Environmental Research and Public Health*. 2022; 19(4):2417.
https://doi.org/10.3390/ijerph19042417

**Chicago/Turabian Style**

Oyeleye, Matthew, Tianhua Chen, Sofya Titarenko, and Grigoris Antoniou.
2022. "A Predictive Analysis of Heart Rates Using Machine Learning Techniques" *International Journal of Environmental Research and Public Health* 19, no. 4: 2417.
https://doi.org/10.3390/ijerph19042417