Evaluating a Learning Algorithm
Some trouble shooting for errors:
- Getting more training examples
- Trying smaller sets of features
- Trying additional features
- Trying polynomial features
- Increasing or decreasing λ
test setting
To tackle the problem of overfitting
Divide the data into 2 part: training set and test set (70% and 30%).
training procedure
- Learn
and minimize using the train set - Compute the test set error
test set error
- For linear regression:
- For classification ~ Misclassification error (aka 0/1 misclassification error)
Model Selection
Given many models with different polynomial degrees
We have a systematic approach to identify the “best” function
In order to choose the model of your hypothesis
Break Down the dataset
- Training set: 60%
- Cross validation set: 20%
- Test set: 20%
Procedure
- Optimize the parameters in
using the training set for each polynomial degree. - Find the polynomial degree d with the least error using the cross validation set.
- Estimate the generalization error using the test set with
,(d = theta from polynomial with lower error);
Bias and Variance
This section is talking about the relationship between the degree of polynomial and the underfitting or overfitting hypothesis.
- distinguish whether bias or variance is the problem
- High bias is underfitting and high variance is overfitting.
High bias(underfitting): both
High variance(overfitting):
Regularization and Bias/Variance
as
- Create a list of lambdas (
{0,0.01,0.02,…,5.12,10.24}) - Create a set of models with different degrees or any other variants
- Iterate through the
s and for each go through all the models to learn some - Compute the cross validation error using the learned
(computed with ) on the without regulariztion or - Select the best combo
- Using the best combo
and , apply it on to see if it has a good generalization of the problem.
Note: the detail of the Step 4 is quite significant
Learning Curves
The X axis is m which means the size of training set.
The Y axis is
High Bias
Low training size:
causes
Large training size:
causes both
High Variance
Low training size:
High training size:
Also,
Review
Problem Shooting
As follows:
- Getting more training examples: Fixes high variance
- Trying smaller sets of features: Fixes high variance
- Adding features: Fixes high bias
- Adding polynomial features: Fixes high bias
- Decreasing
: Fixes high bias - Increasing
: Fixes high variance.
Neural Networks
Fewer Parameters
- prone to underfitting
- computationally cheap
- High bias and low variance
More Parameters
- prone to overfitting
- computationally expensive
- Low bias and high variance
- Post title: 10_Advice for Applying Machine Learning
- Create time: 2022-01-14 19:40:35
- Post link: Machine-Learning/10-advice-for-applying-machine-learning/
- Copyright notice: All articles in this blog are licensed under BY-NC-SA unless stating additionally.