Coursera ML笔记6

Coursera ML笔记6

标签(空格分隔): 机器学习


Evaluating a Hypothesis

Once we have done some trouble shooting for errors in our predictions by:

  • Getting more training examples
  • Trying smaller sets of features
  • Trying additional features
  • Trying polynomial features( x12x22x1x2 )
  • Increasing or decreasing λ

    1. Learn Θ and minimize Jtrain(Θ) using the training set
    2. Compute the test set error Jtest(Θ)

The test set error

To evaluate a hypothesis, given a dataset of training examples, we can split up the data into two sets: a training set and a test set. Typically, the training set consists of 70 % of your data and the test set is the remaining 30 %.
The new procedure using these two sets is then:
1. For linear regression: Jtest(Θ)=12mtestmtesti=1(hΘ(x(i)test)y(i)test)2
2. For classification ~ Misclassification error (aka 0/1 misclassification error): err(hΘ(x),y)=10if hΘ(x)0.5 and y=0 or hΘ(x)<0.5 and y=1otherwise
Test Error=1mtestmtesti=1err(hΘ(x(i)test),y(i)test)

Model Selection and Train/Validation/Test Sets

One way to break down our dataset into the three sets is:

  • Training set: 60%
  • Cross validation set: 20%
  • Test set: 20%

We can now calculate three separate error values for the three different sets using the following method:

  1. Optimize the parameters in Θ using the training set for each polynomial degree.
  2. Find the polynomial degree d with the least error using the cross validation set.
  3. Estimate the generalization error using the test set with Jtest(Θ(d)), (d = theta from polynomial with lower error);

Diagnosing Bias vs. Variance

High bias (underfitting): both Jtrain(Θ) and JCV(Θ) will be high. Also, Jtrain(Θ)JCV(Θ) .
High variance (overfitting): Jtrain(Θ) will be low and JCV(Θ) will be much greater than Jtrain(Θ) .

Regularization and Bias/Variance

Learning Curves


If a learning algorithm is suffering from high bias, getting more training data will not (by itself) help much.

If a learning algorithm is suffering from high variance, getting more training data is likely to help.

Deciding What to Do Next Revisited

  1. Getting more training examples: Fixes high variance
  2. Trying smaller sets of features: Fixes high variance
  3. Adding features: Fixes high bias
  4. Adding polynomial features: Fixes high bias
  5. Decreasing λ: Fixes high bias
  6. Increasing λ: Fixes high variance.

Prioritizing What to Work On

  • Collect lots of data (for example “honeypot” project but doesn’t always work)
  • Develop sophisticated features (for example: using email header data in spam emails)
  • Develop algorithms to process your input in different ways (recognizing misspellings in spam).
    It is difficult to tell which of the options will be most helpful.

Error Analysis

The recommended approach to solving machine learning problems is to:

  • Start with a simple algorithm, implement it quickly, and test it early on your cross validation data.
  • Plot learning curves to decide if more data, more features, etc. are likely to help.
  • Manually examine the errors on examples in the cross validation set and try to spot a trend where most of the errors were made.

Data For Machine Learning

It’s not who has the best algorithem that wins. It’s who has the most data.

Training on a lot of data is likely to give good performance when two of the following conditions hold true.

  • feature xRn+1 has sufficient information to predict y accurately.
  • use a learning algorithem with many parameters
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值