CFP last date
20 May 2024
Reseach Article

Implementation of Logistic Regression using Gradient Descent in Python

by Ahmad Farhan AlShammari
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Volume 186 - Number 13
Year of Publication: 2024
Authors: Ahmad Farhan AlShammari
10.5120/ijca2024923509

Ahmad Farhan AlShammari . Implementation of Logistic Regression using Gradient Descent in Python. International Journal of Computer Applications. 186, 13 ( Mar 2024), 41-46. DOI=10.5120/ijca2024923509

@article{ 10.5120/ijca2024923509,
author = { Ahmad Farhan AlShammari },
title = { Implementation of Logistic Regression using Gradient Descent in Python },
journal = { International Journal of Computer Applications },
issue_date = { Mar 2024 },
volume = { 186 },
number = { 13 },
month = { Mar },
year = { 2024 },
issn = { 0975-8887 },
pages = { 41-46 },
numpages = {9},
url = { https://ijcaonline.org/archives/volume186/number13/implementation-of-logistic-regression-using-gradient-descent-in-python/ },
doi = { 10.5120/ijca2024923509 },
publisher = {Foundation of Computer Science (FCS), NY, USA},
address = {New York, USA}
}
%0 Journal Article
%1 2024-03-27T00:44:38+05:30
%A Ahmad Farhan AlShammari
%T Implementation of Logistic Regression using Gradient Descent in Python
%J International Journal of Computer Applications
%@ 0975-8887
%V 186
%N 13
%P 41-46
%D 2024
%I Foundation of Computer Science (FCS), NY, USA
Abstract

The goal of this research is to develop a logistic regression program using gradient descent in Python. Logistic regression helps to classify data into categories based on the features of samples. Sigmoid function is used to transform values into probabilities and predict the required categories. Gradient descent is used to find the optimal solution that provides the minimum value of error function. The basic steps of linear regression using gradient descent are explained: preparing actual data, initializing weights and bias, computing predicted data, applying sigmoid function, computing cost function, computing partial derivatives, updating weights and bias, computing final prediction, computing confusion matrix, and computing statistical measures. The developed program was tested on an experimental dataset from Kaggle. The program successfully performed the basic steps of logistic regression using gradient descent and provided the required results.

References
  1. Sammut, C., & Webb, G. I. (2017). "Encyclopedia of Machine Learning and Data Mining". New York: Springer.
  2. Shalev-Shwartz, S., & Ben-David, S. (2014). "Understanding Machine Learning: From Theory to Algorithms". Cambridge University Press.
  3. Bonaccorso, G. (2018). "Machine Learning Algorithms: Popular Algorithms for Data Science and Machine Learning". Packt Publishing.
  4. Dhall, D., Kaur, R., & Juneja, M. (2020). "Machine Learning: A Review of the Algorithms and its Applications". Proceedings of ICRIC 2019: Recent Innovations in Computing, 47-63.
  5. Sarker, I. H. (2021). "Machine Learning: Algorithms, Real-world Applications and Research Directions". SN Computer Science, 2(3), 160.
  6. Muller, A. C., & Guido S. (2017). "Introduction to Machine Learning with Python". O'Reilly Media.
  7. Chopra, D., & Khurana, R. (2023). "Introduction to Machine Learning with Python". Bentham Science Publishers.
  8. Giussani, A. (2019). "Applied Machine Learning with Python". EGEA spa.
  9. Sarkar, D., Bali, R., & Sharma, T. (2018). "Practical Machine Learning with Python". Apress.
  10. Forsyth, D. (2019). "Applied Machine Learning". Cham: Springer International Publishing.
  11. Mathur, P. (2019). "Machine Learning Applications using Python: Cases Studies from Healthcare, Retail, and Finance". Apress.
  12. Hetland, M. L. (2014). "Python Algorithms: Mastering Basic Algorithms in the Python Language". Apress.
  13. Dangeti, P. (2017). "Statistics for Machine Learning". Packt Publishing.
  14. VanderPlas, J. (2017). "Python Data Science Handbook". O'Reilly Media.
  15. McKinney, W. (2018). "Python for Data Analysis". O'Reilly Media.
  16. Kleinbaum, D. G., & Klein, M. (2010). "Logistic Regression: A Self-Learning Text". New York: Springer.
  17. Hilbe, J. M. (2009). "Logistic Regression Models". CRC Press.
  18. Menard, S. (2002). "Applied Logistic Regression Analysis". Sage Publications.
  19. Hosmer Jr, D. W., Lemeshow, S., & Sturdivant, R. X. (2013). "Applied Logistic Regression". John Wiley & Sons.
  20. Menard, S. W. (2010). "Logistic Regression: From Introductory to Advanced Concepts and Applications. Sage.
  21. Nick, T. G., & Campbell, K. M. (2007). "Logistic Regression". Topics in Biostatistics, 273-301.
  22. Osborne, J. W. (2014). "Best Practices in Logistic Regression". Sage Publications.
  23. Garson, G. D. (2014). "Logistic Regression: Binary and Multinomial". Asheboro, NC.
  24. Kleinbaum, D. G., & Klein, M. (2010). "Logistic Regression, Statistics for Biology and Health".
  25. Harris, J.K. (2021). "Primer on Binary Logistic Regression". Family Medicine and Community Health, 9(1).
  26. Boateng, E.Y., & Abaye, D.A. (2019). "A Review of the Logistic Regression Model with Emphasis on Medical Research". Journal of Data Analysis and Information Processing. 7, 190-207.
  27. Shipe, M.E., Deppen, S.A., Farjah, F., & Grogan, E.L. (2019). "Developing Prediction Models for Clinical Use using Logistic Regression: An Overview". Journal of thoracic disease, 11(4), S574-S584 .
  28. Phillips, J.M. (2021). "Gradient Descent". In: Mathematical Foundations for Data Analysis. Springer Series in the Data Sciences. Cham: Springer.
  29. Verhulst, P. F. (1838). "Notice sur la loi que la population poursuit dans son accroissement". Correspondance Mathématique et Physique. 10: 113–121.
  30. Pearl, R.; Reed, L. J. (1920). "On the Rate of Growth of the Population of the United States since 1790 and Its Mathematical Representation". Proceedings of the National Academy of Sciences. 6 (6): 275–288.
  31. Python: https://www.python.org
  32. Numpy: https://www.numpy.org
  33. Pandas: https:// pandas.pydata.org
  34. Matplotlib: https://www. matplotlib.org
  35. NLTK: https://www.nltk.org
  36. SciPy: https://scipy.org
  37. SK Learn: https://scikit-learn.org
  38. Kaggle: https://www.kaggle.com
Index Terms

Computer Science
Information Sciences

Keywords

Artificial Intelligence Machine Learning Classification Logistic Regression Sigmoid Function Gradient Descent Confusion Matrix Python Programming