Submitted:
24 February 2025
Posted:
24 February 2025
You are already at the latest version
Abstract
With more healthcare spending comes the added demand for predictive models, which would deliver forecasts of medical insurance spending as well as propose significant determining factors. Machine learning is used here to analyze the bills in healthcare insurance based on demographic and lifestyle factors such as age, BMI, smoking status, and geography. Based on the Medical Insurance Cost Prediction dataset, three regression models—Linear Regression, Random Forest Regression, and Gradient Boosting Regression—were employed to forecast insurance charges. Based on the outcome, the most significant variable influencing medical spending is revealed to be smoking status, followed by BMI and age. Among the models employed, Gradient Boosting Regression had the maximum predictive capability, outperforming Linear Regression, which struggled with complex relationships, and Random Forest Regression, which experienced some overfitting. The study highlights the ability of machine learning to enhance insurance pricing for optimization, enabling enhanced risk assessment by providers and decision-making by individuals. The research promotes the optimization of cost estimation methods in the healthcare sector based on data insights.
Keywords:
1. Introduction
1.0. Background and Project Goal
1.2. Background Information
1.3. Problem Statement
1.4. Scope and Limitations
2.0. Data Set Description
2.1. Description of the Dataset
2.2. Data Collection Method
2.4. Data Quality and Reliability
2.5. Data Examples
| age | sex | bmi | children | smoker | region | charges |
| 19 | female | 27.9 | 0 | yes | southwest | 16884.924 |
| 18 | male | 33.77 | 1 | no | southeast | 1725.5523 |
2.6. Statistical Summaries
![]() |


2.6. b Categorical Distribution



2.6. Correlation Visualisations


3. Proposed Methodology
3.1. Research Design
3.2. Data Collection
- Age
- Gender
- Body Mass Index (BMI)
- Number of Children
- Smoking Status
- Geographic Region
- Insurance Charges
3.0. Data Preprocessing and Issues
3.1. a Binary Encoding and One-Hot Encoding


3.1. b Before Encoding

3.1. After Encoding

3.2. Spotting and Managing Outliers



3.3. Standardisation

4.0. Data Science Techniques
4.1. Linear Regression
4.2. Random Forest Regressor
4.3. Gradient Boosting Regressor
4.4. Implementation of Models

4.5. Linear Regression
4.6. Random Forest Regression

4.7. Gradient Boosting Regression
5.0. Model Validation


6. Actual vs Predicted Changes (Linear Regression)
6.2. Predicted vs Actual Changes (Random Forest Regression)
6.3. Actual vs Predicted Changes (Gradient Boosting Regression)
6.4. Learning Curve Evaluation

6.5. Learning Curve (Linear Regression)
6.6. Learning Curve (Random Forest Regression)
6.7. Learning Curve (Gradient Boosting Regression)
6.8. Learning Curve (Random Forest with Top 3 Features)
6.9. Conclusions from Regression Models
7.0. Conclusions
References
- Bolikulov, F., Nasimov, R., Rashidov, A., Akhmedov, F., & Young-Im, C. (2024). Effective methods of categorical data encoding for artificial intelligence algorithms. Mathematics, 12(16). https://www.proquest.com/docview/3098035416.
- Care Health Insurance. (2023, August 22). Importance of pre-policy health insurance check-up. Care Health Insurance. https://www.careinsurance.com/blog/health-insurance-articles/importance-of-pre-policy-health-insurance-check-up.
- Fitri, E. (2023). Analisis perbandingan metode regresi linier, random forest regression dan gradient boosted trees regression method untuk prediksi harga rumah. Journal of Applied Computer Science and Technology, 4(1). https://journal.isas.or.id/index.php/JACOST/article/view/491/202.
- McGough, M., Telesford, I., Rakshit, S., Wager, E., Amin, K., & Cox, C. (2024, January 23). How does health spending in the U.S. compare to other countries? Peterson-KFF Health System Tracker. https://www.healthsystemtracker.org/chart-collection/health-spending-u-s-compare-countries/.
- Sharma, V. (2022). A study on data scaling methods for machine learning. International Journal for Global Academic & Scientific Research, 1(1). http://journals.icapsr.com/index.php/ijgasr/article/view/4/11.
- Vyas, M. R. (n.d.). Medical insurance cost prediction. Kaggle. Retrieved November 6, 2024, from https://www.kaggle.com/datasets/rahulvyasm/medical-insurance-cost-prediction/data.
- Alkinani, M. H., Almazroi, A. A., Jhanjhi, N. Z., & Khan, N. A. (2021). 5G and IoT based reporting and accident detection (RAD) system to deliver first aid box using unmanned aerial vehicle. Sensors 2021, 21, 6905.
- Babbar, H. , Rani, S., Masud, M., Verma, S., Anand, D., & Jhanjhi, N. (2021). Load balancing algorithm for migrating switches in software-defined vehicular networks. Computational Materials and Continua, 67(1), 1301-1316.
- Jhanjhi, N. Z. Humayun, M., & Almuayqil, S. N. (2021). Cybersecurity and privacy issues in industrial Internet of Things. Computer Systems Science & Engineering, 37(3).
- Lee, S. Abdullah, A., & Jhanjhi, N. Z. (2020). A review on honeypot-based botnet detection models for smart factory. International Journal of Advanced Computer Science and Applications, 11(6).
- Resler, T. J. (2019). Nerd a to Z: Your Reference to Literally Figuratively Everything You’ve Always Wanted to Know. National Geographic Children’s Books.
- Lim, M. , Abdullah, A., Jhanjhi, N. Z., Khan, M. K., & Supramaniam, M. (2019). Link prediction in time-evolving criminal network with deep reinforcement learning technique. IEEE Access, 7, 184797-184807.
- Dogra, V. , Singh, A., Verma, S., Kavita, Jhanjhi, N.Z., Talib, M.N. (2021). Analyzing DistilBERT for Sentiment Classification of Banking Financial News. In: Peng, SL., Hsieh, SY., Gopalakrishnan, S., Duraisamy, B. (eds) Intelligent Computing and Innovation on Data Science. Lecture Notes in Networks and Systems, vol 248. Springer, Singapore. [CrossRef]
- Zaman, N. , Low, T. J., & Alghamdi, T. (2014, February). Energy efficient routing protocol for wireless sensor network. In 16th international conference on advanced communication technology (pp. 808-814). IEEE.
- Kok, S. H., Abdullah, A., Jhanjhi, N. Z., & Supramaniam, M. (2019). A review of intrusion detection system using machine learning approach. International Journal of Engineering Research and Technology, 12(1), 8-15.
- Gopi, R. , Sathiyamoorthi, V., Selvakumar, S., Manikandan, R., Chatterjee, P., Jhanjhi, N. Z., & Luhach, A. K. (2022). Enhanced method of ANN based model for detection of DDoS attacks on multimedia internet of things. Multimedia Tools and Applications, 1-19.
- Chesti, I. A. , Humayun, M., Sama, N. U., & Jhanjhi, N. Z. (2020, October). Evolution, mitigation, and prevention of ransomware. In 2020 2nd International Conference on Computer and Information Sciences (ICCIS) (pp. 1-6). IEEE.
- Alex, S. A., Jhanjhi, N. Z., Humayun, M., Ibrahim, A. O., & Abulfaraj, A. W. (2022). Deep LSTM model for diabetes prediction with class balancing by SMOTE. Electronics, 11(17), 2737.
- Alkinani, M. H., Almazroi, A. A., Jhanjhi, N. Z., & Khan, N. A. (2021). 5G and IoT based reporting and accident detection (RAD) system to deliver first aid box using unmanned aerial vehicle. Sensors, 21(20), 6905.
- Alferidah, D. K. , & Jhanjhi, N. Z. (2020, October). Cybersecurity impact over bigdata and iot growth. In 2020 International Conference on Computational Intelligence (ICCI) (pp. 103-108). IEEE.
- Babbar, H. , Rani, S., Masud, M., Verma, S., Anand, D., & Jhanjhi, N. (2021). Load balancing algorithm for migrating switches in software-defined vehicular networks. Comput. Mater. Contin, 67(1), 1301-1316.
- Jhanjhi, N. Z. , Humayun, M., & Almuayqil, S. N. (2021). Cyber security and privacy issues in industrial internet of things. Computer Systems Science & Engineering, 37(3).
- Jena, K. K. , Bhoi, S. K., Malik, T. K., Sahoo, K. S., Jhanjhi, N. Z., Bhatia, S., & Amsaad, F. (2022). E-learning course recommender system using collaborative filtering models. Electronics, 12(1), 157.
- Aherwadi, N., Mittal, U., Singla, J., Jhanjhi, N. Z., Yassine, A., & Hossain, M. S. (2022). Prediction of fruit maturity, quality, and its life using deep learning algorithms. Electronics, 11(24), 4100.
- Gill, S. H. , Razzaq, M. A., Ahmad, M., Almansour, F. M., Haq, I. U., Jhanjhi, N. Z.,... & Masud, M. (2022). Security and privacy aspects of cloud computing: a smart campus case study. Intelligent Automation & Soft Computing, 31(1), 117-128.
- Muzafar, S. , & Jhanjhi, N. Z. (2020). Success stories of ICT implementation in Saudi Arabia. In Employing Recent Technologies for Improved Digital Governance (pp. 151-163). IGI Global.
- Shah, I. A. , Jhanjhi, N. Z., & Laraib, A. (2023). Cybersecurity and blockchain usage in contemporary business. In Handbook of Research on Cybersecurity Issues and Challenges for Business and FinTech Applications (pp. 49-64). IGI Global.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 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 (http://creativecommons.org/licenses/by/4.0/).
