# Task 1: Introduction


```python
%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt
```

# Task 2: Dataset

Real estate agent table:

|Area|Distance|Price|
|---|---|---|
|70|3|21200|
|50|1|22010|
|120|9|24305|
|100|2|31500|

You can write the relationship with a 2-variable linear equation:

$
\begin{equation}
y = b + w_1.x_1 + w_2.x_2
\end{equation}
$

In a vector form:

$
\begin{equation}
y = b + (w_1 w_2).\binom{x_1}{x_2}
\end{equation}
$

Where
$
\begin{equation}
W = (w_1 w_2)
\end{equation}
$
and
$
\begin{equation}
X = \binom{x_1}{x_2}
\end{equation}
$


```python

```


```python

```


```python

```


```python

```

# Task 3: Initialize Parameters

The loss over **m** examples:

$
\begin{equation}
J = \frac{1}{2m} \sum_{i=1}^{m} (y - \hat{y})^2
\end{equation}
$

The objective of the gradient descent algorithm is to minimize this loss value.

Gradient Descent Objective is to 
$
\begin{equation}
min(J)
\end{equation}
$


```python

```


```python

```

# Task 4: Forward Pass

The gradient descent algorithm can be simplified in 4 steps:

1. Get predictions y_hat for X with current values of W and b.
2. Compute the loss between y and y_hat
3. Find gradients of the loss with respect to parameters W and b
4. Update the values of W and b by subtracting the gradient values obtained in the previous step

Let's simplify our linear equation a bit more for an example:
$
\begin{equation}
y = wx
\end{equation}
$

Let's plot J as a function of w



The gradients of loss with respect to w:

\begin{equation}
\frac{dJ}{dw} = \frac{\delta{J}}{\delta{w}} = \lim_{\epsilon \to 0} \frac{J(w + \epsilon) - J(w)}{\epsilon}
\end{equation}


```python

```


```python

```

# Task 5: Compute Loss

The loss over **m** examples:

$
\begin{equation}
J = \frac{1}{2m} \sum_{i=1}^{m} (y - \hat{y})^2
\end{equation}
$


```python

```


```python

```


```python

```

# Task 6: Backward Pass

The gradient of loss with respect to bias can be calculated with:

$
\begin{equation}
\frac{dJ}{db} = \frac{1}{m} \sum_{i=1}^{m} (\hat{y^{(i)}} - y^{(i)})
\end{equation}
$

$
\begin{equation}
\frac{dJ}{dW_j} = \frac{1}{m} \sum_{i=1}^{m} (\hat{y^{(i)}} - y^{(i)}).x_j^{(i)}
\end{equation}
$


```python

```


```python

```


```python

```

# Task 7: Update Parameters


```python

```

# Task 8: Training Loop


```python

```


```python

```


```python

```


```python

```


```python

```

# Task 9: Predictions


```python

```


```python

```


```python

```

49f6bd29a4878417a30486e01e41d547778dc22e
ipynb
Jupyter Notebook
Linear-Regression-with-Python/Learner Notebook.ipynb
AnuragAnalog/Guided-Projects-Coursera
938749ca3ef4529021b9323161be5d48b4dd26a9
Apache-2.0
2021-04-11T17:04:58.000Z
2021-04-11T17:04:58.000Z
Linear-Regression-with-Python/Learner Notebook.ipynb
AnuragAnalog/Guided-Projects-Coursera
938749ca3ef4529021b9323161be5d48b4dd26a9
Apache-2.0
Linear-Regression-with-Python/Learner Notebook.ipynb
AnuragAnalog/Guided-Projects-Coursera
938749ca3ef4529021b9323161be5d48b4dd26a9
Apache-2.0
Qwen/Qwen-72B
1. YES
2. YES