# C1\_W1 Lab Query

**URL:** <https://community.deeplearning.ai/t/c1-w1-lab-query/176933>\
**Category:** Supervised ML: Regression and Classification\
**Tags:** week-module-1\
**Created:** [August 3, 2022, 9:26am UTC](https://community.deeplearning.ai/t/c1-w1-lab-query/176933 "2022-08-03T09:26:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anakin\_Lucas](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@Anakin\_Lucas](https://community.deeplearning.ai/u/Anakin_Lucas)\
**Post date:** [August 3, 2022, 9:26am UTC](https://community.deeplearning.ai/t/c1-w1-lab-query/176933/1 "2022-08-03T09:26:48Z")

</div>

The Optional lab has shown that the **Cost versus iterations** graph. What is the meaning of this graph and what does **the x-axis means**. This very confuse me. And also what is the **start** and **end** means in the _graph title_.

---

<div class="post-metadata">

**Author:** ![rmwkwok](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/rmwkwok/32/126977_2.png) [@rmwkwok](https://community.deeplearning.ai/u/rmwkwok)\
**Post date:** [August 3, 2022, 3:09pm UTC](https://community.deeplearning.ai/t/c1-w1-lab-query/176933/2 "2022-08-03T15:09:19Z")

</div>

Hi,

I think you are asking about these graphs in Optional Lab: Gradient Descent for Linear Regression (Please provide the name of the optional lab next time)

 ![Screenshot from 2022-08-03 23-04-14](https://global.discourse-cdn.com/dlai/original/3X/c/4/c4f1bfca208af7cdaee1acfebd280df7fcacdeca.png)

It can take many iterations to train our model. At each iteration, we go through our samples once, and after each iteration, the cost will reduce. This graph tells us the cost at the end of each iteration so that we know how the cost is changing over the training process. x-axis is the number of iterations.

For this training, the process did a large number of iterations, and the start plot shows the first 100 iterations whereas the end plot shows the iterations after the first 1000 iterations. We make a separate end plot so that we can look closer to the small change in cost at the later iterations.

---

<div class="post-metadata">

**Author:** ![SamReiswig](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@SamReiswig](https://community.deeplearning.ai/u/SamReiswig)\
**Post date:** [August 3, 2022, 3:11pm UTC](https://community.deeplearning.ai/t/c1-w1-lab-query/176933/3 "2022-08-03T15:11:37Z")

</div>

Hi!

The graphs are the value of the Cost vs the Number of Gradient Descent iterations (Number of times we run Gradient Descent)  
It shows that the cost goes lower until the gradient reaches 0 and we have reached a minimum.  
It is a good way to measure the progress of gradient descent.

 ![Gradient_Descent_C1_W1_Lab](https://global.discourse-cdn.com/dlai/original/3X/5/9/592c2b5deab43f829df7ef2e8612f8c5545e1f87.png)  
 ![Cost_vs_iteration](https://global.discourse-cdn.com/dlai/original/3X/4/9/492b71862972a5e523d60b13a1e610f401fa10fc.png)

Hope this helps!
