Back to Browse

Python Programming Lecture Series Part-20 (Underfitting & Overfitting)

37 views
Oct 23, 2023
16:03

Welcome to my YouTube video where we dive deep into the intriguing concepts of underfitting and overfitting in machine learning, using a hands-on example of polynomial regression. We'll explore three different cases: underfitting, overfitting, and achieving the elusive "good fit" by varying the degree of the polynomial. In this practical session, we'll be using Google Colab for coding, ensuring you can follow along seamlessly. We've generated a labeled dataset with 50 training samples, employing the versatile NumPy library to create it. This dataset is crafted using the sort function and the power of cosine functions. Here's what you can expect from this video: Underfitting (Degree 1): We start by applying a linear regression model to our dataset, representing a simple case of underfitting. You'll see how the model struggles to capture the underlying patterns, leading to poor predictive performance. Overfitting (Degree 30): Next, we crank up the polynomial degree to a whopping 30, showcasing a classic example of overfitting. You'll witness how the model becomes too complex, fitting noise in the data and performing poorly on unseen data. Good Fit (Degree 3): Finally, we strike a balance by setting the polynomial degree to 3. This demonstrates the sweet spot where our model captures the underlying trends without becoming overly complex. Channel link: https://www.youtube.com/channel/UChasPSYMLygfxSWHUzJxhUA Matplotlib: https://youtu.be/ki_Alf8nPrE?si=31jOMQ5Y2Ob7QU6n

Download

0 formats

No download links available.

Python Programming Lecture Series Part-20 (Underfitting & Overfitting) | NatokHD