Project: Logistic Regression with NumPy and Python


Implement the gradient descent algorithm from scratch

Perform logistic regression with NumPy and Python

Create data visualizations with Matplotlib and Seaborn

Clock1.5 hours
Comment Dots英語(English) + subtitles

Welcome to this project-based course on Logistic with NumPy and Python. In this project, you will do all the machine learning without using any of the popular machine learning libraries such as scikit-learn and statsmodels. The aim of this project and is to implement all the machinery, including gradient descent, cost function, and logistic regression, of the various learning algorithms yourself, so you have a deeper understanding of the fundamentals. By the time you complete this project, you will be able to build a logistic regression model using Python and NumPy, conduct basic exploratory data analysis, and implement gradient descent from scratch. The prerequisites for this project are prior programming experience in Python and a basic understanding of machine learning theory. This course runs on Coursera's hands-on project platform called Rhyme. On Rhyme, you do projects in a hands-on manner in your browser. You will get instant access to pre-configured cloud desktops containing all of the software and data you need for the project. Everything is already set up directly in your internet browser so you can just focus on learning. For this project, you’ll get instant access to a cloud desktop with Python, Jupyter, NumPy, and Seaborn pre-installed.


Data ScienceMachine LearningPython ProgrammingclassificationNumpy



  1. Introduction and Project Overview

  2. Load the Data and Import Libraries

  3. Visualize the Data

  4. Define the Logistic Sigmoid Function 𝜎(𝑧)

  5. Compute the Cost Function 𝐽(𝜃) and Gradient

  6. Cost and Gradient at Initialization

  7. Implement Gradient Descent

  8. Plotting the Convergence of 𝐽(𝜃)

  9. Plotting the Decision Boundary

  10. Predictions Using the Optimized 𝜃 Values






  • 購買項目後,您將獲得完成項目所需的一切內容,包括通過 Web 瀏覽器訪問云桌面工作空間,其中包含您需要了解的文件和軟件,以及特定領域的專家提供的分步視頻說明。

  • 因為您的工作空間包含適合筆記本電腦或台式計算機使用的雲桌面,所以項目不在移動設備上使用。

  • 項目講師是特定領域的專家,他們在項目的技能、工具或領域上都很有經驗,並且熱衷於分享自己的知識以影響全球數百萬的學生。

  • 您可以從項目中下載並保留您創建的任何文件。為此,您可以在訪問云桌面時使用‘文件瀏覽器’功能。

  • 項目沒有助學金。

  • 您不需要任何前期經驗即可開始項目。講師將逐步指導您完成項目。

  • 是,您可以在瀏覽器的雲桌面中獲得完成項目所需的一切。

  • 您可以通過直接在瀏覽器中的分屏環境中完成項目來進行學習。在屏幕的左側,您將在工作空間中完成任務。在屏幕的右側,您將看到有講師逐步指導您完成項目。