# Supervised learning

**URL:** <https://community.deeplearning.ai/t/supervised-learning/226307>\
**Category:** Supervised ML: Regression and Classification\
**Tags:** week-module-1\
**Created:** [November 3, 2022, 8:03pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307 "2022-11-03T20:03:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Asif2](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Muhammad\_Asif2](https://community.deeplearning.ai/u/Muhammad_Asif2)\
**Post date:** [November 3, 2022, 8:03pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/1 "2022-11-03T20:03:47Z")

</div>

why regression has infinitely many possible outcomes

---

<div class="post-metadata">

**Author:** ![Moaz\_Elesawey](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/moaz_elesawey/32/30848_2.png) [@Moaz\_Elesawey](https://community.deeplearning.ai/u/Moaz_Elesawey)\
**Post date:** [November 3, 2022, 8:19pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/2 "2022-11-03T20:19:23Z")

</div>

Hi, @Muhammad_Asif2  
Do you mean Linear Regression?

---

<div class="post-metadata">

**Author:** ![pastorsoto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/pastorsoto/32/127023_2.png) [@pastorsoto](https://community.deeplearning.ai/u/pastorsoto)\
**Post date:** [November 3, 2022, 8:23pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/3 "2022-11-03T20:23:33Z")

</div>

Hi @Muhammad_Asif2 when we evaluate a regression problem, we can take any possible numerical outcome, let’s say you want to predict the price of a house in this case the possible price of the house can be between 0 to infinite, however we can also assume that they are infinite given the nature of the possible outcome which is a continuous outcome, in other words `20.8531234` is a valid prediction and different of `20.8531235`, this is the opposite of a classification problem when the outcomes are finite, for instance if you predict that the price of the house will be higher next year that can be either true or false, but there are nothing between those two outcomes.

Regression: Infinite number of outcomes (continuous)

- Examples:

- Item price: 1.23 - 1.24 - 5.32 (Decimal are possible)
- Revenue: 1.1 Million - 1.2 Million - 12.23 Million

Classification: Finite number of outcomes (Discrete)

- Examples:

- Higher price next year: True - False
- Pet: Cat - Dog

Let me know if this answer your question

---

<div class="post-metadata">

**Author:** ![Muhammad\_Asif2](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Muhammad\_Asif2](https://community.deeplearning.ai/u/Muhammad_Asif2)\
**Post date:** [November 3, 2022, 8:23pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/4 "2022-11-03T20:23:59Z")

</div>

Yes I mean regression

---

<div class="post-metadata">

**Author:** ![Muhammad\_Asif2](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Muhammad\_Asif2](https://community.deeplearning.ai/u/Muhammad_Asif2)\
**Post date:** [November 3, 2022, 8:26pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/5 "2022-11-03T20:26:53Z")

</div>

Thanks , this answer is very helpful for me .

---

<div class="post-metadata">

**Author:** ![Muhammad\_Asif2](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Muhammad\_Asif2](https://community.deeplearning.ai/u/Muhammad_Asif2)\
**Post date:** [November 4, 2022, 8:03pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/6 "2022-11-04T20:03:29Z")

</div>

Can you explain cost function and gradient descent

---

<div class="post-metadata">

**Author:** ![Christian\_Simonis](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/christian_simonis/32/142583_2.png) [@Christian\_Simonis](https://community.deeplearning.ai/u/Christian_Simonis)\
**Post date:** [November 4, 2022, 8:44pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/7 "2022-11-04T20:44:19Z")

</div>

Hi there,

I suggest you take a look at the course content again since the underlying concepts are explained really well. And they are important to understand since several future concepts will build upon these basics.

A cost function provides a metric you can use to improve your optimization. When fitting a model you actually want to minimise the costs, (the model error). See also:

- [https://towardsdatascience.com/cost-functions-the-underpinnings-of-machine-learning-549ac5edb211](https://towardsdatascience.com/cost-functions-the-underpinnings-of-machine-learning-549ac5edb211)

Gradient descent is a powerful method for above mentioned optimization when fitting your model. It is really well explained by Andrew Ng in this video:

- [Gradient Descent (C1W2L04) - YouTube](https://youtu.be/uJryes5Vk1o)

Also this thread might be interesting for you:

- [How different initialization of centroids of K-means results in drastic different clusters ? They all share common cost function - #5 by Christian\_Simonis](https://community.deeplearning.ai/t/how-different-initialization-of-centroids-of-k-means-results-in-drastic-different-clusters-they-all-share-common-cost-function/223900/5)

Best  
Christian

---

<div class="post-metadata">

**Author:** ![Muhammad\_Asif2](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Muhammad\_Asif2](https://community.deeplearning.ai/u/Muhammad_Asif2)\
**Post date:** [November 8, 2022, 3:52pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/8 "2022-11-08T15:52:45Z")

</div>

can you explain classification problems?

---

<div class="post-metadata">

**Author:** ![Muhammad\_Asif2](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Muhammad\_Asif2](https://community.deeplearning.ai/u/Muhammad_Asif2)\
**Post date:** [November 8, 2022, 3:59pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/9 "2022-11-08T15:59:39Z")

</div>

can you explain classification problems in supervised learning?

---

<div class="post-metadata">

**Author:** ![Christian\_Simonis](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/christian_simonis/32/142583_2.png) [@Christian\_Simonis](https://community.deeplearning.ai/u/Christian_Simonis)\
**Post date:** [November 8, 2022, 4:28pm UTC](https://community.deeplearning.ai/t/supervised-learning/226307/10 "2022-11-08T16:28:18Z")

</div>

Hi there,

if you have categorical data which you can use as labels: then you can formulate a classification problem and use supervised learning:  
supervised learning means you provide examples / observations via labelled data to the algorithm so that the model can learn the classification „border“ (of course this can be high dimensional and non-linear) on its own: [https://static.javatpoint.com/tutorial/machine-learning/images/classification-algorithm-in-machine-learning.png](https://static.javatpoint.com/tutorial/machine-learning/images/classification-algorithm-in-machine-learning.png)

A possible application would be the detection whether the picture shows a cat or a dog (…) and the algorithm classifies the image accordingly.  
Labelled data would mean in this example that you have pictures with the labels (=where you know for sure that a dog or cat is on the pic) and you can use them for training.

Is there any specific part or a course-related question that you are interested in?

Best  
Christian
