Research Article

Implementation of Logistic Regression using Gradient Descent in Python

by  Ahmad Farhan Alshammari
journal cover
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Volume 186 - Issue 13
Published: March 2024
Authors: Ahmad Farhan Alshammari
10.5120/ijca2024923509
PDF

Ahmad Farhan Alshammari . Implementation of Logistic Regression using Gradient Descent in Python. International Journal of Computer Applications. 186, 13 (March 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 },
                        year    = { 2024 },
                        volume  = { 186 },
                        number  = { 13 },
                        pages   = { 41-46 },
                        doi     = { 10.5120/ijca2024923509 },
                        publisher = { Foundation of Computer Science (FCS), NY, USA }
                        }
                        %0 Journal Article
                        %D 2024
                        %A Ahmad Farhan Alshammari
                        %T Implementation of Logistic Regression using Gradient Descent in Python%T 
                        %J International Journal of Computer Applications
                        %V 186
                        %N 13
                        %P 41-46
                        %R 10.5120/ijca2024923509
                        %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
  • Sammut, C., & Webb, G. I. (2017). "Encyclopedia of Machine Learning and Data Mining". New York: Springer.
  • Shalev-Shwartz, S., & Ben-David, S. (2014). "Understanding Machine Learning: From Theory to Algorithms". Cambridge University Press.
  • Bonaccorso, G. (2018). "Machine Learning Algorithms: Popular Algorithms for Data Science and Machine Learning". Packt Publishing.
  • 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.
  • Sarker, I. H. (2021). "Machine Learning: Algorithms, Real-world Applications and Research Directions". SN Computer Science, 2(3), 160.
  • Muller, A. C., & Guido S. (2017). "Introduction to Machine Learning with Python". O'Reilly Media.
  • Chopra, D., & Khurana, R. (2023). "Introduction to Machine Learning with Python". Bentham Science Publishers.
  • Giussani, A. (2019). "Applied Machine Learning with Python". EGEA spa.
  • Sarkar, D., Bali, R., & Sharma, T. (2018). "Practical Machine Learning with Python". Apress.
  • Forsyth, D. (2019). "Applied Machine Learning". Cham: Springer International Publishing.
  • Mathur, P. (2019). "Machine Learning Applications using Python: Cases Studies from Healthcare, Retail, and Finance". Apress.
  • Hetland, M. L. (2014). "Python Algorithms: Mastering Basic Algorithms in the Python Language". Apress.
  • Dangeti, P. (2017). "Statistics for Machine Learning". Packt Publishing.
  • VanderPlas, J. (2017). "Python Data Science Handbook". O'Reilly Media.
  • McKinney, W. (2018). "Python for Data Analysis". O'Reilly Media.
  • Kleinbaum, D. G., & Klein, M. (2010). "Logistic Regression: A Self-Learning Text". New York: Springer.
  • Hilbe, J. M. (2009). "Logistic Regression Models". CRC Press.
  • Menard, S. (2002). "Applied Logistic Regression Analysis". Sage Publications.
  • Hosmer Jr, D. W., Lemeshow, S., & Sturdivant, R. X. (2013). "Applied Logistic Regression". John Wiley & Sons.
  • Menard, S. W. (2010). "Logistic Regression: From Introductory to Advanced Concepts and Applications. Sage.
  • Nick, T. G., & Campbell, K. M. (2007). "Logistic Regression". Topics in Biostatistics, 273-301.
  • Osborne, J. W. (2014). "Best Practices in Logistic Regression". Sage Publications.
  • Garson, G. D. (2014). "Logistic Regression: Binary and Multinomial". Asheboro, NC.
  • Kleinbaum, D. G., & Klein, M. (2010). "Logistic Regression, Statistics for Biology and Health".
  • Harris, J.K. (2021). "Primer on Binary Logistic Regression". Family Medicine and Community Health, 9(1).
  • 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.
  • 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 .
  • Phillips, J.M. (2021). "Gradient Descent". In: Mathematical Foundations for Data Analysis. Springer Series in the Data Sciences. Cham: Springer.
  • Verhulst, P. F. (1838). "Notice sur la loi que la population poursuit dans son accroissement". Correspondance Mathématique et Physique. 10: 113–121.
  • 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.
  • Python: https://www.python.org
  • Numpy: https://www.numpy.org
  • Pandas: https:// pandas.pydata.org
  • Matplotlib: https://www. matplotlib.org
  • NLTK: https://www.nltk.org
  • SciPy: https://scipy.org
  • SK Learn: https://scikit-learn.org
  • Kaggle: https://www.kaggle.com
Index Terms
Computer Science
Information Sciences
No index terms available.
Keywords

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

Powered by PhDFocusTM