Skip to main content
Log in

Predicting the pharmaceutical needs of hospitals using machine learning algorithms

  • Review
  • Published:
International Journal of Data Science and Analytics Aims and scope Submit manuscript

Abstract

People’s lives are always threatened by various diseases. The role of health and medical services, in particular medicine, is undeniable in protecting their lives. Timely preparation and providing medicine for patients is vital since medicine shortage can endanger their lives while excessive accumulation of medicine can put them at expiration risk and waste health budgets. To this end, in this paper, we aim at introducing a model for the prediction of commonly used medicine (type and amount) in hospitals. For that, in our applied research, we initially used patients’ data from the Afzalipur Hospital in Kerman collected for 3 years consisting of 283 features, which included over 9351 different medicine and 121,690 patients. Then, nine features were selected using experts’ feedback and were fed into the random forest and neural network algorithms. For the prediction task, medicine types and their amounts were predicted for each individual using different training sets. In addition, the right prediction time was also found which is when predictions have a promising accuracy while the executive team of a hospital has enough time to provide the right amounts of the most used medicine. The performance of algorithms was evaluated using a confusion matrix (precision, recall, F1, and accuracy metrics). Our results showed that the random forest had a promising performance in predicting the amounts of the most used medicine for a month using 2 years of data (accuracy 83.3%) while its accuracy in predicting medicine was 35.9%. Therefore, we conclude that the random forest algorithm has the potential to effectively and accurately predict medicine amounts by analyzing large amounts of data and detecting patterns that may not be easily discernible to humans.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6

Similar content being viewed by others

Data availability

Not applicable.

References

  1. Linnér, L., Eriksson, I., Persson, M., Wettermark, B.: Forecasting drug utilization and expenditure: ten years of experience in Stockholm. BMC Health Serv. Res. 20(1), 1–11 (2020)

    Article  Google Scholar 

  2. Godman, B., Bucsics, A., Vella Bonanno, P., Oortwijn, W., Rothe, C.C., Ferrario, A., Bosselli, S., Hill, A., Martin, A.P., Simoens, S., et al.: Barriers for access to new medicines: searching for the balance between rising costs and limited budgets. Front. Public Health 6, 328 (2018)

    Article  Google Scholar 

  3. Godman, B., Malmström, R.E., Diogene, E., Gray, A., Jayathissa, S., Timoney, A., Acurcio, F., Alkan, A., Brzezinska, A., Bucsics, A., et al.: Are new models needed to optimize the utilization of new medicines to sustain healthcare systems? Expert. Rev. Clin. Pharmacol. 8(1), 77–94 (2015)

    Article  Google Scholar 

  4. Gustafsson, L.L., Wettermark, B., Kalin, M., Korkmaz, S., Persson, M.E., Almkvist, H., Hjemdahl, P., Julander, M., Kristianson, K., Ringertz, B., et al.: A model for structured introduction of new drugs the aim is to offer all patients appropriate treatment. Lakartidningen 105(42), 2917–2922 (2008)

    Google Scholar 

  5. D’Sa, M.M., Nakagawa, R.S., Hill, D.S., Tan, J.K.: Exponential smoothing method for forecasting drug expenditures. Am. J. Health Syst. Pharm. 51(20), 2581–2588 (1994)

    Article  Google Scholar 

  6. Martei, Y.M., Chiyapo, S., Grover, S., Hanna, C., Dryden-Peterson, S., Pusoentsi, M., Shulman, L.N., Tapela, N.: Methodology to forecast volume and cost of cancer drugs in low-and middle-income countries. J. Glob. Oncol. 4, 1–8 (2018)

    Google Scholar 

  7. Remuzat, C., Urbinati, D., Kornfeld, A., Vataire, A.-L., Cetinsoy, L., Aballea, S., Mzoughi, O., Toumi, M.: Pharmaceutical expenditure forecast model to support health policy decision making. J. Mark. Access Health Policy 2(1), 23740 (2014)

    Article  Google Scholar 

  8. Vataire, A.-L., Cetinsoy, L., Aballea, S., Remuzat, C., Urbinati, D., Kornfeld, A., Mzoughi, O., Toumi, M.: Novel methodology for pharmaceutical expenditure forecast. J. Mark. Access Health Policy 2(1), 24082 (2014)

    Article  Google Scholar 

  9. Salmanpour, M.R., Hosseinzadeh, M., Bakhtiari, M., Gholami, A.R., Ghaemi, M.M., Nabizadeh, A.H., Rezaeijo, S.M., Rahmim, A.: Drug amount prediction in Parkinson’s disease using hybrid machine learning systems and radiomics features. Soc. Nuclear Med. 63, 1–4 (2022)

  10. Cha, M., Rifai, B., Sarraf, P.: Pharmaceutical forecasting: throwing darts? Nat. Rev. Drug Discov. 12(10), 737 (2013)

    Article  Google Scholar 

  11. Hartke, P.L., Vermeulen, L.C., Hoffman, J.M., Shah, N.D., Doloresco, F., Suda, K.J., Li, E.C., Matusiak, L.M., Hunkler, R.J., Schumock, G.T.: Accuracy of annual prescription drug expenditure forecasts in AJHP. Am. J. Health Syst. Pharm. 72(19), 1642–1648 (2015)

    Article  Google Scholar 

  12. Espin, J., Schlander, M., Godman, B., Anderson, P., Mestre-Ferrandiz, J., Borget, I., Hutchings, A., Flostrand, S., Parnaby, A., Jommi, C.: Projecting pharmaceutical expenditure in eu5 to 2021: adjusting for the impact of discounts and rebates. Appl. Health Econ. Health Policy 16(6), 803–817 (2018)

    Article  Google Scholar 

  13. Keehan, S.P., Stone, D.A., Poisal, J.A., Cuckler, G.A., Sisko, A.M., Smith, S.D., Madison, A.J., Wolfe, C.J., Lizonitz, J.M.: The prediction of essential medicines demand: a machine learning approach using consumption data in Rwanda. Health Aff. 36(3), 553–563 (2017)

    Article  Google Scholar 

  14. Schey, C., Milanova, T., Hutchings, A.: Estimating the budget impact of orphan medicines in Europe: 2010–2020. Orphanet J. Rare Dis. 6(1), 1–10 (2011)

    Article  Google Scholar 

  15. Slade, E.P., Simoni-Wastila, L.: Forecasting medicaid expenditures for antipsychotic medications. Psychiatr. Serv. 66(7), 713–718 (2015)

    Article  Google Scholar 

  16. Rafsanjani, H.N., Nabizadeh, A.H.: Towards human-centered artificial intelligence (AI) in architecture, engineering, and construction (AEC) industry. Comput. Hum. Behav. Rep. 15, 100319 (2023)

    Article  Google Scholar 

  17. Urbinati, D., Rémuzat, C., Kornfeld, Å., Vataire, A.-L., Cetinsoy, L., Aballéa, S., Mzoughi, O., Toumi, M.: Eu pharmaceutical expenditure forecast. J. Mark. Access Health Policy 2(1), 23738 (2014)

    Article  Google Scholar 

  18. Mahajan, K.N., Kumar, A.: Business intelligent smart sales prediction analysis for pharmaceutical distribution and proposed generic model: analyze benefit of institutional level public outreach campaign to business. Int. J. Innov. Res. Technol. 5(12), 1039–1044 (2019)

    Google Scholar 

  19. Chen, J.: Autoregressive integrated moving average (ARIMA). Advanced Technical Analysis concept (2019)

  20. Abiodun, O.I., Jantan, A., Omolara, A.E., Dada, K.V., Nachaat AbdElatif, M., Arshad, H.: State-of-the-art in artificial neural network applications: a survey. Heliyon 4(11), 00938 (2018)

    Article  Google Scholar 

  21. Rigatos, G.: Advanced Models of Neural Networks: Nonlinear Dynamics and Stochasticity in Biological Neurons. Springer (2013). https://doi.org/10.1007/978-3-662-43764-3

  22. Campos Souza, P.V.: Fuzzy neural networks and neuro-fuzzy networks: a review the main techniques and applications used in the literature. Appl. Soft Comput. 92, 106275 (2020)

    Article  Google Scholar 

  23. Chang, O., Naranjo, I., Guerron, C., Criollo, D., Guerron, J., Mosquera, G.: A deep learning algorithm to forecast sales of pharmaceutical products. no. August (2017)

  24. Miikkulainen, R., Liang, J., Meyerson, E., Rawal, A., Fink, D., Francon, O., Raju, B., Shahrzad, H., Navruzyan, A., Duffy, N., Hodjat, B.: Evolving deep neural networks. In: Artificial Intelligence in the Age of Neural Networks and Brain Computing, pp. 293–312. Elsevier (2019). https://doi.org/10.1016/B978-0-12-815480-9.00015-3

  25. Kwak, Y., Yun, W.J., Jung, S., Kim, J.: Quantum neural networks: concepts, applications, and challenges. In: 2021 Twelfth International Conference on Ubiquitous and Future Networks (ICUFN), pp. 413–416 (2021). IEEE

  26. Kumar, S.A., Kumar, A., Dutt, V., Agrawal, R.: Multi model implementation on general medicine prediction with quantum neural networks. In: 2021 Third International Conference on Intelligent Communication Technologies and Virtual Mobile Networks (ICICV), pp. 1391–1395. IEEE (2021)

  27. Meyer, D., Wien, F.: Support vector machines. The Interface to libsvm in package e1071 28(20), 597 (2015)

  28. Yang, F.-J.: An implementation of Naive Bayes classifier. In: 2018 International Conference on Computational Science and Computational Intelligence (CSCI), pp. 301–306. IEEE (2018)

  29. Biau, G., Scornet, E.: A random forest guided tour. TEST 25, 197–227 (2016)

    Article  MathSciNet  Google Scholar 

  30. Alves, C.M.F.: Demand forecasting in a multi-specialty hospital setting: a comparative study of machine learning and classical statistical methods. Mestrado Integrado em Engenharia Informatica e Computação Faculdade De Engenharia Da Universidade Do Porto (2018)

  31. Sherstinsky, A.: Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network. Physica D 404, 132306 (2020)

    Article  MathSciNet  Google Scholar 

  32. Kalekar, P.S., et al.: Time series forecasting using holt-winters exponential smoothing. Kanwal Rekhi Sch. Inf. Technol. 4329008(13), 1–13 (2004)

    Google Scholar 

  33. Bakırarar, B., Yüksel, C., Yavuz, Y.: Prediction of new prescription requirements for diabetes patients using big data technologies. J. Health Res. 36(2), 334–344 (2021)

    Article  Google Scholar 

  34. Taud, H., Mas, J.: Multilayer perceptron (MLP). Geomatic approaches for modeling land change scenarios, pp. 451–455 (2018)

  35. Gasso, G.: Logistic regression. INSA Rouen-ASI Departement Laboratory: Saint-Etienne-du-Rouvray, France, pp. 1–30 (2019)

  36. Bhargava, N., Sharma, G., Bhargava, R., Mathuria, M.: Decision tree analysis on j48 algorithm for data mining. Proc. Int. J. Adv. Res. Comput. Sci. Softw. Eng. 3(6), 15 (2013)

    Google Scholar 

  37. Mbonyinshuti, F., Nkurunziza, J., Niyobuhungiro, J., Kayitare, E.: The prediction of essential medicines demand: a machine learning approach using consumption data in Rwanda. Processes 10(1), 26 (2021)

    Article  Google Scholar 

  38. Mbonyinshuti, F., Nkurunziza, J., Niyobuhungiro, J., Kayitare, E.: Application of random forest model to predict the demand of essential medicines for non-communicable diseases management in public health facilities. Pan Afr Med. J. 42, 15 (2022)

    Article  Google Scholar 

  39. Rashid, M., Goyal, V., Parah, S.A., Singh, H.: Drug prediction in healthcare using big data and machine learning. In: Research Anthology on Machine Learning Techniques, Methods, and Applications, pp. 1062–1071. IGI Global (2022)

  40. Guseo, R., Dalla Valle, A., Furlan, C., Guidolin, M., Mortarino, C.: Pre-launch forecasting of a pharmaceutical drug. Int. J. Pharm. Halthc. Mark. 11(4), 412–438 (2017)

    Google Scholar 

  41. Nabizadeh, A.H., Gonçalves, D., Gama, S., Jorge, J.: Early prediction of students’s final grades in a gamified course. IEEE Trans. Learn. Technol. 15(3), 311–325 (2022)

    Article  Google Scholar 

  42. Demisse, G.B., Tadesse, T., Bayissa, Y.: Data mining attribute selection approach for drought modeling: a case study for greater horn of Africa. arXiv preprint arXiv:1708.05072 (2017)

  43. Ying, X.: An overview of overfitting and its solutions. In: Journal of Physics: Conference Series, vol. 1168, p. 022022. IOP Publishing (2019)

  44. Deng, K.: Omega: On-line Memory-based General Purpose System Classifier. Carnegie Mellon University (1999)

  45. Salmanpour, M.R., Hosseinzadeh, M., Bakhtiari, M., Ghaemi, M.M., Rezaeijo, S.M., Nabizadeh, A.H., Rahmim, A.: Cognitive outcome prediction in Parkinson’s disease using hybrid machine learning systems and radiomics features. Soc. Nuclear Med. (2022)

  46. Javanmardi, A., Hosseinzadeh, M., Hajianfar, G., Nabizadeh, A.H., Rezaeijo, S.M., Rahmim, A., Salmanpour, M.: Multi-modality fusion coupled with deep learning for improved outcome prediction in head and neck cancer. In: Medical Imaging 2022: Image Processing, vol. 12032, pp. 664–668. SPIE (2022)

  47. Miao, J., Niu, L.: A survey on feature selection. Procedia Comput. Sci. 91, 919–926 (2016)

    Article  Google Scholar 

  48. Kursa, M.B., Rudnicki, W.R.: Feature selection with the Boruta package. J. Stat. Softw. 36, 1–13 (2010)

    Article  Google Scholar 

  49. Genuer, R., Poggi, J.-M., Genuer, R., Poggi, J.-M.: Random Forests. Springer, New York (2020)

    Book  Google Scholar 

  50. Nabizadeh, A.: Artificial intelligence in healthcare. J. Health Biomed. Inform. 9(3), 193–195 (2022)

    Google Scholar 

  51. Qi, Y.: Random Forest for Bioinformatics. Ensemble machine learning: Methods and applications, pp. 307–323. Springer, Berlin (2012)

    Google Scholar 

  52. Subbotin, S.: A random forest model building using a priori information for diagnosis. In: CMIS, pp. 962–973 (2019)

  53. Salmanpour, M.R., Hosseinzadeh, M., Akbari, A., Borazjani, K., Mojallal, K., Askari, D., Hajianfar, G., Rezaeijo, S.M., Ghaemi, M.M., Nabizadeh, A.H., et al.: Prediction of TNM stage in head and neck cancer using hybrid machine learning systems and radiomics features. In: Medical Imaging 2022: Computer-Aided Diagnosis, vol. 12033, pp. 648–653. SPIE (2022)

  54. Mijwel, M.M.: Artificial neural networks advantages and disadvantages. Retrieved from LinkedIn, https://www.linkedin.com/pulse/artificial-neural-networks-advantages-disadvantages-maad-m-mijwel, pp. 21 (2018)

  55. Raleiras, M., Nabizadeh, A.H., Costa, F.A.: Automatic learning styles prediction: a survey of the state-of-the-art (2006–2021). J. Comput. Educ. 9(4), 587–679 (2022)

    Article  Google Scholar 

  56. Nabizadeh, A.H.: A long term goal recommender approach for learning environments. Doutoramento em Informática Faculdade De ciencias Da Universidade Do Porto (2018)

  57. Nabizadeh, A.H., Jorge, J., Gama, S., Goncalves, D.: How do students behave in a gamified course? A ten-year study. IEEE Access 9, 81008–81031 (2021)

  58. Sadoughi, F., Ghaderzadeh, M.: A hybrid particle swarm and neural network approach for detection of prostate cancer from benign hyperplasia of prostate. In: e-Health–For Continuity of Care, pp. 481–485. IOS Press (2014)

  59. Fernández, A., Garcia, S., Herrera, F., Chawla, N.V.: Smote for learning from imbalanced data: progress and challenges, marking the 15-year anniversary. J. Artif. Intell. Res. 61, 863–905 (2018)

    Article  MathSciNet  Google Scholar 

  60. Iqbal, M.J., Geer, M.I., Dar, P.A.: Evaluation of medicines forecasting and quantification practices in various public sector hospitals using indicator based assessment tool. J. Appl. Pharm. Sci. 7(12), 72–76 (2017)

    Google Scholar 

Download references

Acknowledgements

Not applicable.

Author information

Authors and Affiliations

Authors

Contributions

The first author designed the prediction method, wrote the manuscript, and conducted the evaluation. The second author collected the dataset and helped in improving the initial idea. The last author revised the manuscript and assisted the first author in the evaluation task.

Corresponding author

Correspondence to Mohammad Mehdi Ghaemi.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Ethical approval

All subjects gave their informed consent for inclusion before they participated in the study. The study was conducted in accordance with the Declaration of Helsinki, and the protocol was approved by the Ethics Committee of Kerman University of Medical Sciences, Kerman, Iran (IR.KMU.REC.1401.076).

Additional information

Communicated by Ana Carolina Lorena.

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix A

Appendix A

1.1 A.1 Accuracy of the generated models

In Table 11, higher accuracies are bolded. As shown in this table, RF has been superior to NN models in most cases. Sometimes the accuracy of the models is the same up to two decimal places, but considering more decimal places, their accuracy will be slightly different.

Table 13 Precision, recall and F1 of NN and RF before balancing
Table 14 Precision, recall and F1 of NN and RF after balancing

1.2 A.2 Required time to generate the models

In Table 12, we presented the required time to build each model. It provides a better understanding of generating the models, and also when the accuracy of models is similar, it can be used as a selection criteria. The required time to generate NN models is significantly less than the RF models.

1.3 A.3 Precision, recall and F1 of NN and RF models

The results presented in Tables 13 and 14 are compatible with the ones in Tables 4 and 5. In Tables 13 and 14, the recall of the NN model is sometimes equal to 100%. It shows that the probability of not predicting the prescribed medicine is very low.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Nabizadeh, A.H., Ghaemi, M.M. & Goncalves, D. Predicting the pharmaceutical needs of hospitals using machine learning algorithms. Int J Data Sci Anal (2024). https://doi.org/10.1007/s41060-024-00530-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s41060-024-00530-z

Keywords

Navigation