当前位置:网站首页>1.2 - error sources
1.2 - error sources
2022-08-11 07:51:00 【A big boa constrictor 6666】
文章目录
一、The bias and variance of the estimator(Bias and Variance of Estimator)
- 误差(error)的来源:Bias and variance(Bias and Variance)
- 估计量(Estimator):We found based on the training set f ∗ f^* f∗ 就是真实 f ^ \hat{f} f^的估计量
- 估计变量x的均值
- 假设x的均值是u
- 假设x的方差是 σ 2 \sigma ^2 σ2
- 估计均值u
- 取N个点:{ x 1 , x 2 , . . . , x N x^1,x^2,...,x^N x1,x2,...,xN}
- m = 1 N ∑ n x n ≠ u m=\frac{1}{N}\underset{n}{\sum }x^n\neq u m=N1n∑xn=u
- E [ m ] = E [ 1 N ∑ n x n ] = 1 N ∑ n E [ x n ] = u E\left [ m\right]=E\left [ \frac{1}{N}\underset{n}{\sum }x^n \right ]=\frac{1}{N}\underset{n}{\sum }E\left [ x^n\right ]=u E[m]=E[N1n∑xn]=N1n∑E[xn]=u,虽然每一个mare spread evenly in the realu的四周,But after taking the average of them, it is equalu
- 散布程度: V a r [ m ] = σ 2 N Var[m]=\frac{\sigma ^2}{N} Var[m]=Nσ2,Var为取m的方差,Its value depends on the number of samples.N越大,The tighter the spread;N越小,Scatter more sparsely.
- 估计方差 σ 2 \sigma ^2 σ2
- s 2 = 1 N ∑ n ( x n − m ) 2 s^2=\frac{1}{N}\underset{n}{\sum }(x^n-m)^2 s2=N1n∑(xn−m)2
- E [ s 2 ] = N − 1 N σ 2 ≠ σ 2 E[s^2]=\frac{N-1}{N}\sigma ^2\neq \sigma ^2 E[s2]=NN−1σ2=σ2,N越大,估计量 s 2 s^2 s2with the true variance σ 2 \sigma ^2 σ2the smaller the difference.
1.1 方差(Variance)
- 越简单的模型,方差越小;越复杂的模型,方差越大
- Simple models are less affected by the data
1.3 偏置值(Bias)
- 越简单的模型,The larger the offset value is;越复杂的模型,The smaller the offset value
- 对于简单的模型,Because it contains a relatively small set of functions,May not contain the real function at all,So no matter how you look for it,No real model could be found either.That's why the simpler model,The reason for its larger bias value.
1.4 模型优化方向
- When the variance of the model(Variance)比较大时,The model will overfit(Overfitting).
- If the model fits well on the training set,And the performance on the test set is very poor,Then the variance is large,过拟合
- 增大数据集:For example, take more sample data,Or perform data enhancement on the original data,This does not change the bias value of the model(推荐)
- Handwritten digit recognition:Angular flip the data in the training set
- 影像辨识:Angular flip the data in the training set
- 语音辨识:If only boys data,There are no data for girls,You can use a voice changer to convert boys' data into girls' data.If the data is not disturbed by noise,In the real scene, there is noise interference.Then the noise of the scene can be recorded and synthesized with the training set,Then the data in the real scene is obtained.
- 语音翻译:When there is only data in one national language in hand,却想做10language translation tasks,Then, data in multiple languages can be obtained in the form of machine translation
- 正则化(Regularization):Add a term after the loss functionterm,to reduce the sensitivity of the model to the input,Doing so will reduce the model space,It will also increase the bias value of the model.(不推荐)
- When the bias value of the model(Bias)比较大时,The model does not fit(Underfitting).
- If the model fits poorly on the training set,Then the bias value is larger,does not fit
- At this point it is time to redesign our model,For example, increasing the complexity of the model:考虑更多的特征,Consider multiple powers for a single feature
二、交叉验证(Cross Validation)
- 交叉验证
- Divide the original training set into two,Divided into real training set and validation set.That is, don't optimize your model by exposing the results on the test set,Instead, just optimize your model by the results on the validation set,This way the model does not overfit,It also better reflects the real situation of your model.
- N次交叉验证(N-fold Cross Validation)
- Divide the original training set into three,One piece of data is taken each time as a validation set,The other two are used as training set.Calculations for different models are given below3The average loss value in each case,Publish the best performing model to the public test set.
边栏推荐
- 1002 Write the number (20 points)
- How to choose professional, safe and high-performance remote control software
- oracle19c不支持实时同步参数,请教一下大佬们有什么好的解决办法吗?
- 1096 大美数 (15 分)
- The most complete documentation on Excel's implementation of grouped summation
- 网络电话软件或迎整顿 “免费”通话须迈安全关
- NTT的Another Me技术助力创造歌舞伎演员中村狮童的数字孪生体,将在 “Cho Kabuki 2022 Powered by NTT”舞台剧中首次亮相
- 数仓开发知识总结
- 2022-08-09 Group 4 Self-cultivation class study notes (every day)
- TF generates (feature, label) set through feature and label, tf.data.Dataset.from_tensor_slices
猜你喜欢
随机推荐
语音信号处理:预处理【预加重、分帧、加窗】
go-grpc TSL认证 解决 transport: authentication handshake failed: x509 certificate relies on ... ...
matrix multiplication in tf
基于FPGA的FIR滤波器的实现(4)— 串行结构FIR滤波器的FPGA代码实现
1091 N-自守数 (15 分)
1036 Programming with Obama (15 points)
LeetCode brushing series -- 46. Full arrangement
golang fork 进程的三种方式
无服务器+域名也能搭建个人博客?真的,而且很快
【LeetCode】链表题解汇总
1036 跟奥巴马一起编程 (15 分)
年薪40W测试工程师成长之路,你在哪个阶段?
1002 写出这个数 (20 分)
1096 big beautiful numbers (15 points)
TF中的条件语句;where()
【LeetCode每日一题】——682.棒球比赛
1003 我要通过 (20 分)
1051 复数乘法 (15 分)
机器学习总结(二)
1106 2019数列 (15 分)