Pinned Tweet
R² is a widely used measure of fit, but for many analysts, it is just a number.
They believe high R² ➡ Good predictions.
This is not always true!
Now I will clarify. 🔽
R-squared measures how well the regression model fits the observed data.
To be more precise: It is the proportion of the variation in the dependent variable that is predictable from the independent variable.
It usually ranges from 0 to 1: (In rare cases it can be negative, I will explain this in another tweet)
R² = 0
The model does not explain any of the variability in the dependent variable ➡ No predictive power ➡ Bad model.
R² = 1
The model perfectly explains all the variability in the dependent variable ➡ Perfect fit to the data ➡ Good model if not overfitted and has predictive power.
A high R-squared value does not mean that the predictions made by the model will be correct.
It doesn't measure predictability power, it measures how well the model fits!
In the example below, we compare the mean of the data to a fitted line.
Of course, the mean of values is not a good fit ➡ the errors are large.
On the other hand, the fitted line has smaller errors ➡ The R² will be close to 1.
To calculate R² we need:
- The total sum of squares for the mean
- Sum of squares for the residuals from the model
- Finally, subtract the ratio from 1
___
That's it for today.
I hope you've found this Tweet helpful.
Like/Retweet for support and follow @levikul09 for more Data Science content.
Thanks 😉
Levi retweeted
Conditional probability is the single most important concept in statistics.
Why? Because without accounting for prior information, predictive models are useless.
Here is what conditional probability is, and why it is essential.
Levi retweeted
How to build a good understanding of math for machine learning?
I get this question a lot, so I decided to make a complete roadmap for you. In essence, three fields make this up: calculus, linear algebra, and probability theory.
Let's take a quick look at them!
Levi retweeted
Four years ago, I started a project that turned out to be life-altering, and it has just passed a huge milestone.
I'm happy to announce that my Mathematics of Machine Learning book will soon be published by Packt Publishing! Yes, there will be a physical version.
Hi All,
It's been a while...
I turned off content creation a few months ago and had some much-needed time away from it.
Several reasons lead to the decision:
- I started to work on an interesting project beside my 9-5. That took priority. I may talk about this later as it is data-related.
- I had enough of it. I created content daily for 2.5 years and started chasing the algorithm of X. I burnt out.
I realized that I am not creating content for enjoyment and to learn, but to farm engagement. It was more like learning marketing or copywriting, not Data.
I tried to move to a newsletter, but I realized that it was not the platform. It was me.
BUT
I liked to do it and I knew I will be back.
I feel like it's time. I had some good rest and I feel the motivation again.
I won't be here on X every day. The main focus will be Data Ground Up (Link in bio) and maybe video(?!) We will see. But sometimes I will pop up here as well.
I look at it as starting from zero. I need to figure things out again.
I will try to do stuff that is cool to me and every once in a while you may also like it.
If you are in, then go to Data Ground Up!
Levi retweeted
How can you build a good understanding of math for machine learning?
Here is a complete roadmap for you.
In essence, three fields make this up:
• Calculus
• Linear algebra
• Probability theory
Let's take a quick look at them!
Levi retweeted
There's a stunning, simple explanation behind matrix multiplication.
This is the first time this clicked on my brain, and it will be the best thing you read all week.
Here is a breakdown of the most crucial idea behind modern machine learning:
1/15
Levi retweeted
Let's discuss the simplest retrieval method: "Similarity search".
It involves retrieving the top "k" documents that are most similar to a given query based on vector embeddings.
Let's learn more about it 🧵 👇
Levi retweeted
This is the best book for learning the mathematics of Machine Learning.
There are two things that make this book different from everything out there:
1. The book is 100% focused on the math required in Machine Learning. This is not about general concepts and theories. This is just what you need.
2. You won't find better explanations anywhere else.
My friend Tivadar Danka started writing the book three years ago. I joined his community and have been reading every new chapter since. I paid for it.
This book is my number one recommendation. Period.
tivadardanka.com/books/mathe…
If you want to know how good the book is, check @TivadarDanka's posts. The internet goes on fire every time he writes one of his Math explanations. He is the best at breaking down complex ideas into simple, bite-sized explanations.
The book is an extension of this.
Trust me on this one. This is the book you want to read.
Levi retweeted
I've amassed a small collection of Python programming tips which I've been posting here on X.
Mostly Matplotlib stuff, but not limited to it.
I've created a dedicated page on Github to store them all in one convenient place now.
I hope this helps a bit.
















