# Logistic Regression Math

## **Derivative the Gradient Descent of Linear and Logistic Regression** <a href="#e57b" id="e57b"></a>



**Ref:** [**Medium @** Abu Nayem ](https://medium.com/@jacknayeem/derivative-the-gradient-descent-of-linear-and-logistic-regression-6162685cb333)



Gradient Descent method to find optimal parameter θ to minimize the cost function J(θ)

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2FFvQh0rcgaDEKTDVHFi0G%2Fimage.png?alt=media\&token=a30dfc6a-ab0f-42c7-8b90-d1f4bafe2865)



![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2F1TN70FZC3zg2ApVYzkiZ%2Fimage.png?alt=media\&token=8b8ffba8-a873-4a10-b60e-148650f90d94)

## **Gradient Descent of Linear Regression**  <a href="#e57b" id="e57b"></a>

We know,\
**Linear equation:**

![](https://miro.medium.com/max/630/1*I-4HMQbx5y00jTf8ASaYKQ.png)

![](https://miro.medium.com/max/1312/1*roiSlD8ELojJ8WiEaIOTNQ.png)

![](https://miro.medium.com/max/1324/1*xYgUCycr7FW_MoUaOKbfMQ.png)

## **Gradient Descent of Logistic Regression**  <a href="#e57b" id="e57b"></a>



![](https://miro.medium.com/max/1296/1*Bu5_641-eGk57R_b12GunA.png)

![](https://miro.medium.com/max/1316/1*jF7QXvbMgaNzgME3iK_LzA.png)

![](https://miro.medium.com/max/1276/1*GCltjuqdBqbYX-sk02uS2A.png)

![](https://miro.medium.com/max/1242/1*QThRebN7qfsFTdEFSd1eqA.png)

![](https://miro.medium.com/max/1332/1*-iv_6MC80rjSly4lcuYO1w.png)

![](https://miro.medium.com/max/1324/1*CB3mSDNwYB8vo3FvUyL7gw.png)

