Machine Learning:Basic Conception

How did the error come?

It comes from bias and variance.

What is estimator

We do not know f ^ \hat{f} f^.From training data,we get f ∗ f^* f.And f ∗ f^* f is an estimator of f ^ \hat{f} f^.It depends on bias+variance.

How to get mean in data?

We can select a set of sub-data.Like { x 1 , x 2 , . . . , x N } \{x^1,x^2,...,x^N\} {x1,x2,...,xN}.We assume the mean of the data is μ \mu μ.We can get below:
m = 1 N ∑ n x n ≠ μ m=\frac{1}{N}\sum_nx^n\neq\mu m=N1nxn=μ
E [ m ] = E [ 1 N ∑ n x n ] = 1 N ∑ n E [ x n ] = μ E[m]=E[\frac{1}{N}\sum_nx^n]=\frac{1}{N}\sum_nE[x^n]=\mu E[m]=E[N1nxn]=N1nE[xn]=μ

How to get variance in data?

Actually the same as mean.We can get below:
m = 1 N ∑ n x n m=\frac{1}{N}\sum_nx^n m=N1nxn
s 2 = 1 N ∑ n ( x n − m ) 2 s^2=\frac{1}{N}\sum_n(x^n-m)^2 s2=N1n(xnm)2
E [ s 2 ] = N − 1 N σ 2 E[s^2]=\frac{N-1}{N}\sigma^2 E[s2]=NN1σ2
And we know that if the larger the N N N, E [ s 2 ] E[s^2] E[s2] is more equal to σ 2 \sigma^2 σ2.We need low variance and low bias.

Bias is import

There is something can explain this:
E [ f ∗ ] = f ‾ ≠ f ^ E[f^*]=\overline{f}\neq\hat{f} E[f]=f=f^
There is a distance between f ‾ \overline{f} f and f ^ \hat{f} f^ called bias.Bias will keep your model away from the real model.But variance will not.

Error is build by bias and variance

Bias like the distance between f ‾ \overline{f} fand f ^ \hat{f} f^.And variance like different models we design,which are influenced by training data.

The complexity and variance

Actually, more complexity the model is,larger variance is .And complex model will be seriously influenced by training data.

The complexity and bias

Actually, more complexity the model is,smaller bias is.So we can get a conclusion:small complexity,large bias and small variance,large conplexity,small bias and large variance!

The explanation to overfitting

The origin of over-fitting is because the complexity is too high, although the bias becomes smaller but the variance becomes larger, resulting in too large error.Of course, if you handle the complexity well, you can control the bias and variance to minimize the error.

Underfitting

The reason for underfitting is that the complexity is too small, which leads to too big bias and too big error, but the error value caused by underfitting will be much smaller than overfitting.

How to know that our model is overfitting or underfitting?

If the error between the training data and your model is high, intuitively speaking, the model cannot cover the training data well, which is underfitting.If your model can cover the training data well, but the error value of the test data is a bit large, it is overfitting.

How can we handle overfitting or underfitting?

If our model underfitting,we need to redesign.Like add more features as input.A more complex model.If our model overfitting,we can add more trainning data.It very effective,but not practical.Or Regularization.It means make our model more smooth.But it will influence bias.

What you should concern

Testing set is not real ‘Testing Set’.Two different set will generate the different error.Therefore,testing data has public testing data and private testing data.We have public testing data,but not private testing data.Maybe you get the low error in public testing data.But in private testing data,our error will be larger.

How can we do it better?

We need to consider Cross Validation.

What is Cross Validation?

We need to separate part of the training data into verification data, which can reduce the impact of private testing data.

Do not tune your model by public testing data!!!

If you find that the error value of public testing data is too large, go back and modify the model. This is very not recommended, because you regard public testing data more heavily than private testing data.

How can we do it better?

Another validation called ‘N-fold Cross Validation’.

N-fold Cross Validation

Divide the training data into N pieces for traversal. The process is to modify one of them into verification data, get the error value for each model, and generate the error array of the model, and then calculate the average value of the error array for comparison, the error is the smallest Is the model we choose, and then verify the public testing data.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值