Daily Dose of Data Science

Share this post

Visualize The Performance Of Linear Regression With This Simple Plot

www.blog.dailydoseofds.com

Discover more from Daily Dose of Data Science

High-quality insights on Data Science and Python, along with best practices — shared daily. Get a 550+ Page Data Science PDF Guide and 450+ Practice Questions Notebook, FREE.
Over 36,000 subscribers
Continue reading
Sign in

Visualize The Performance Of Linear Regression With This Simple Plot

Assumption turned into performance validation.

Avi Chawla
Jun 2, 2023
11
Share this post

Visualize The Performance Of Linear Regression With This Simple Plot

www.blog.dailydoseofds.com
2
Share

Linear regression assumes that the model residuals (=actual-predicted) are normally distributed.

If the model is underperforming, it may be due to a violation of this assumption.

A QQ plot (short for Quantile-Quantile) is a great way to verify this and also determine the model's performance.

As the name suggests, it depicts the quantiles of the observed distribution (residuals in this case) against the quantiles of a reference distribution, typically the standard normal distribution.

A good QQ plot will:

  • Show minimal deviations from the reference line, indicating that the residuals are approximately normally distributed.

A bad QQ plot will:

  • Exhibit significant deviations, indicating a departure from the normality of residuals.

  • Display patterns of skewness with its diverging ends, etc.

Thus, the more aligned the QQ plot looks, the more confident you can be about your model.

This is especially useful when the regression line is difficult to visualize, i.e., in a high-dimensional dataset.

So remember...

After running a linear model, always check the distribution of the residuals.

This will help you:

  • Validate the model's assumptions

  • Determine how good your model is

  • Find ways to improve it (if needed)

👉 Over to you: What are some other ways/plots to determine the linear model's performance?

I covered another way in one of my previous posts: Visualize The Performance Of Any Linear Regression Model With This Simple Plot.

Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new and insightful about Python and Data Science every day. Also, get a Free Data Science PDF (250+ pages) with 200+ tips.


👉 Read what others are saying about this post on LinkedIn and Twitter.

👉 Tell the world what makes this newsletter special for you by leaving a review here :)

Review Daily Dose of Data Science

👉 If you liked this post, don’t forget to leave a like ❤️. It helps more people discover this newsletter on Substack and tells me that you appreciate reading these daily insights. The button is located towards the bottom of this email.

👉 If you love reading this newsletter, feel free to share it with friends!

Share Daily Dose of Data Science


Find the code for my tips here: GitHub.

I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn and Twitter.

11
Share this post

Visualize The Performance Of Linear Regression With This Simple Plot

www.blog.dailydoseofds.com
2
Share
Previous
Next
2 Comments
Share this discussion

Visualize The Performance Of Linear Regression With This Simple Plot

www.blog.dailydoseofds.com
Claudio
Jun 2

Great post as usual, Avi. I enjoy reading all your "daily dose" posts.

I just want to comment that it seems that the link to the Jupyter notebook is broken...Thanks for sharing your knowledge! Please, keep going.

Expand full comment
Reply
Share
Nikhil Shaganti
Writes Nikhil’s Newsletter
Jun 2

Unbiasedness and minimal variance of a linear regression model has nothing to do with normality of residuals. It only gives you another way to derive parameters using MLE and makes your hypotheses tests valid.

Expand full comment
Reply
Share
Top
New
Community

No posts

Ready for more?

© 2023 Avi Chawla
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing