正在学习Stanford吴恩达的机器学习课程,常做笔记,以便复习巩固。
鄙人才疏学浅,如有错漏与想法,还请多包涵,指点迷津。
a. Evaluation method
Given a dataset of training examples. we can split up it into two parts.Typically, we can divide the dataset :
Remark :
b. Performance measurement
For linear regression :
For classification :
c. Example 1 : model selection
Let us talk about the selection of polynomial degree.
We can test each degree of polynomial and look at the error. It is suggested that we should divide the dataset into three parts, usually is :
In general, we can evaluate our hypothesis using the following method :
a. Bias and variance
Given a model, we have two concepts:
Bias : underfit, both train error and the cross validation error is high, also JCV(Θ)≈Jtrain(Θ) J C V ( Θ ) ≈ J t r a i n ( Θ ) .
Variance : overfit, the cross validation error is high but the train error is very low, also Jtrain(Θ)≪JCV(Θ) J t r a i n ( Θ ) ≪ J C V ( Θ ) .
b. Relations of regularization
Consider λ λ in regularization :
when λ λ is very large, our fit becomes more rigid.
when λ λ is very samll, we tend to over overfit the data.
c. Example 2 : regularization selection
We can find the best lambda using the methods below :
a. Relations of dataset
We can easily know that :
when the dataset is very small, we can get 0 0 train errors while the cross validation error is large. As the dataset get larger, the train errors increase, and the cross validation decrease.
In the high bias problem :
In the high variance problem :
b. Example 3 : whether to add data
When experiencing high bias :
Getting more training data will not help much.
When experiencing high variance :
Getting more training data is likely to help.
Our decision process can be broken down as follows:
Addition :
A neural network with fewer parameters is prone to underfitting. It is also computationally cheaper.
A neural network with more parameters is prone to overfitting. It is also computationally expensive.
The knowledge above (such as 5.1.1) is also useful to neural network.
We have konwn how to evaluate a model. Next we will talk about the whole process when facing a machine learning problem.
Error analysis : after model training and evaluation, in order to choose which method is best or get some ideas, we will manually spot the errors in cross validation set, calculating the algorithm’s performance.
Skewed data : the error metric of the algorithm can be very low, in which case a simple algorithm (like y=0 y = 0 ) is better.
Solution : use better metric
Precision :
Recall :
Trade-off between T and R
In order to compare different algorithm with P-R metric, we can use
F-score
Training on a lot of data is likely to give good performance when two of the following conditions hold true :
The recommanded approach to solve machine learning problems is :
Tricks : Numerical Metric
Get error result as a single, numerical value can help assess algorithm’s performance.
More content abour numerical metric will be talk next time.