Intuition of over/under fitting

Before we understand about how the preceding techniques are useful, let's build a scenario, so that we understand the phenomenon of overfitting.

Scenario 1: A case of not generalizing on an unseen dataset

In this scenario, we will create a dataset, for which there is a clear linearly separable mapping between input and output. For example, whenever the independent variables are positive, the output is [1,0], and when the input variables are negative, the output is [0,1]:

To that dataset, we will add a small amount of noise (10% of the preceding dataset created) by adding some data points that follow the opposite ...

Get Hands-On Machine Learning on Google Cloud Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.