The document discusses overfitting and underfitting in machine learning, defining overfitting as a model that captures noise from the training data leading to high variance and low bias, and underfitting as a model that fails to capture the data's underlying trend, resulting in high bias and low variance. It outlines methods to avoid both issues, including cross-validation, regularization, and model complexity adjustments. Additionally, it emphasizes the importance of a balanced model that performs well in both training and testing phases.
Overfitting in machinelearning
Overfitting refers to a scenario when the model tries to cover all the data points present
in the given dataset.
The model starts caching noise and inaccurate values present in the dataset.
Reduces the efficiency and accuracy of the model.
The overfitted model has low bias and high variance
Overfitting in machinelearning Cont.
Overfitted model performance
The accuracy score is good and high during training but it decreases during testing.
How to avoid Overfitting
Using cross-validation
Using Regularization techniques
Implementing Ensembling techniques.
Picking a less parameterized/complex model
Training the model with sufficient data
Removing features
Early stopping the training
5.
Underfitting in machinelearning
Underfitting is just the opposite of overfitting.
Underfitting occurs when our machine learning model is not able to capture the
underlying trend of the data.
An underfitted model has high bias and low variance.
Underfitting in machinelearning Cont.
Underfitted model performance
The accuracy score is low during training as well as testing.
How to avoid Underfitting
Preprocessing the data to reduce noise in data
More training to the model
Increasing the number of features in the dataset
Increasing the model complexity
Increasing the training time of the model to get better results.
8.
Good fit modelin machine learning
A good fit model is a balanced model, which is not suffering from underfitting and
overfitting.
This is a perfect model which gives good accuracy score during training and equally
performs well during testing.
9.
Detecting Overfitting AndUnderfitting
And Good Fit
Detecting for Classification and Regression:
Error Overfitting Right Fit Underfitting
Training Low Low High
Test High Low High
Example To UnderstandOverfitting vs. Underfitting
(vs. Good Fitting) in Machine Learning
Consider a AI class consisting of students and a professor
12.
Example To Underfittingvs. Overfitting (vs. Best
Fitting) in Machine Learning Cont.
We can broadly divide the students into 3 features (Hobby, Interest, Attention).
13.
Example To Underfittingvs. Overfitting (vs. Best
Fitting) in Machine Learning Cont.
The professor first delivers lectures and teaches the students about the problems and
how to solve them.
At the end of the day, the professor simply takes a quiz based on what he taught in
the class.
14.
Example To Underfittingvs. Overfitting (vs. Best
Fitting) in Machine Learning Cont.
So, let’s discuss what happens when the professor takes a classroom test at the end of
the day:
We can clearly infer that the student who simply memorizes everything is scoring better without
much difficulty.
15.
Example To Underfittingvs. Overfitting (vs. Best
Fitting) in Machine Learning Cont.
Now here’s the twist.
Let’s also look at what happens during the semester final, when students have to face
new unknown questions which are not taught in the class by the Professor.
16.
How Does thisRelate to Underfitting and
Overfitting in Machine Learning
Summaries the students Class Test and Semester Exam scores with a feature of
Interest.
We Make a dataset with Class Test and Semester Exam scores as a training and testing
dataset.
17.
How Does thisRelate to Underfitting and
Overfitting in Machine Learning
This example relates to the problem dataset Which the train, test and validation
scores of the dataset.
This example relates to the problem Which we encountered during the train and test
scores of the decision tree classifier.
18.
How Does thisRelate to Underfitting and Overfitting
in Machine Learning Cont.
Let’s work on connecting this example with the results of the decision tree classifier.