Bias/Variance analysis is one of the most important concepts in machine learning as it allows you to measure and improve the performance of your model.
🧵In this thread, I will discuss the basic idea behind it, so let's dive right in.
#MachineLearning #ArtificialIntelligence
1⃣Bias (Underfitting)
What is bias?
In simple terms, bias is the difference between the model predictions and the actual values.
So if a model has a high bias, it means it has underfitted the training data. In other words, the model has a high training set error.
What causes a high bias?
Bias, or underfitting, mainly occurs when the model is too simple to understand the underlying structure of the training data, and so it misses the relevant relations between the input features and target outputs.
How do we measure bias?
Measuring bias is usually tricky because it mainly depends on the problem you are trying to solve. Bias is measured by comparing the training set error relative to Bayes error rate. Bayes error is the lowest possible error rate for any function.
Since Bayes error is a theoretical irreducible error rate, it can not be measured. That is why we use human error rate as an estimate or approximation of Bayes error.
So we define "avoidable bias" as the difference between human error and training set error.
For example, for some tasks such as image recognition, human error rate is usually around 0%. So if the model has a training set error of 10%, this means you have an avoidable bias of 10% and your model is underfitting the training data.
For other tasks such as speech recognition in a noisy environment, where it is relatively difficult to hear clearly, human error rate can be around 15% for example. If your model has 18% training set error, then you only have 3% bias, and the model performance is acceptable.
How to reduce bias (underfitting)?
1. Select a more complex and powerful model architecture.
2. Feature engineering to create more and better input features.
3. Longer training.
4. Decrease regularization (model constraints).
2⃣Variance (Variance)
What is variance?
In a nutshell, variance is the difference between the training set error and the development set error.
So variance describes the amount that the model predictions will change when different data is used.
If a model has a high variance, this means that it has overfitted the training data.

What causes a high variance?
High variance, or overfitting, happens when the model is too complex relative to the amount and nosiness of the training data.
A model with a high variance pays too much attention to the training data and does not generalize well to data it has not seen before. As a result, the model can perform really well on the training data, but has high error rate on the development set and test set.
How to reduce variance (overfitting)?
1. Simplify the model architecture.
2. Select a model with fewer parameters and input features.
3. Get more training data (Data augmentation).
4. Clean the data to reduce the noise.
5. regularization (will be discussed in another thread).
Practical Examples
cases no. 1:
human error = 1%
training error = 5%
development error = 6%
This model has a high bias (4%) and low variance (1%)

cases no. 2:
human error = 1%
training error = 2%
development error = 7%
This model has a low bias (1%) and high variance (5%)
cases no. 3:
human error = 1%
training error = 5%
development error = 10%
This model has a high bias (4%) and high variance (5%)

cases no. 4:
human error = 1%
training error = 2%
development error = 3.5%
This model has a low bias (1%) and low variance (1.5%)
Final Notes
a. A model's performance usually slows down once it approaches human-level performance.
b. Before building a machine learning model to solve a particular problem, you should ask about the current solution to give you a good reference for your model performance.
If you found this thread to be helpful, please consider retweeting it.
For content about machine learning and computer science, kindly follow me @ammar_yasser92.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Ammar Yasser

Ammar Yasser Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @ammaryh92

21 Jun
Data Science learning roadmap
If you are looking to get into machine learning, I would like to make your life easier by listing some of my favorite resources in this thread 🧵👇
#MachineLearning
1⃣Python is the most common language for data science (even though there are other great languages like R, C++)
This playlist by @JustinMitchel is a great way to start.
youtube.com/playlist?list=…
2⃣SQL
This @udacity free course is amazing.
udacity.com/course/sql-for…
Read 13 tweets
19 Jun
Feature Scaling is one of the most important transformations you need to apply to your data before feeding it to your machine learning model.
🧵thread 👇
- Feature scaling refers to the concept of normalizing the range of input features so that they have similar scales.
- Most machine learning algorithms do not work well when the input numerical attributes have very different scales. Image
1⃣Min-Max Scaling (Normalization)
- In this method, values are rescaled so they end up ranging between 0 and 1 (the range can be changed in some cases).
- Normalization is very sensitive to the existence of outliers. Image
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(