当前位置:网站首页>Cross validation (CV) learning notes
Cross validation (CV) learning notes
2022-07-25 17:34:00 【Wsyoneself】
- Cross validation can be used to evaluate the performance of machine learning training model , Parameter optimization can also be carried out .
- Common methods of dividing data sets : Directly divide the sample data into training and verification data sets . shortcoming : There is no cross method , The validation data set has no contribution to the training of the model .
- Common cross validation methods :
- k-flod cv:
- The sample data is divided into k Group , One set at a time as a validation data set , The rest k-1 Group as training data set . Then we get k A training model , take k The mean value of the validation accuracy of the models is used as the performance index of the model
- advantage : All samples will be used for model training , The evaluation result is credible .
- leave-one-out cv: Let the original data set contain n Samples , Select one sample at a time as the validation data set , rest n-1 Samples as training data set , Will have a n A training model , take n The average validation accuracy of the training models is the performance index of the model .
- advantage : ditto
- shortcoming : There are many models that need training , And the training data set is large , High calculation cost
- k-flod cv:
- In order to further improve the performance of the model in predicting unknown data , Different parameter settings need to be optimized and compared , This process is called model selection . For a particular problem , The process of adjusting parameters to find the optimal super parameters .
- Judge the training condition of the model according to the deviation and variance :
- Deviation describes the difference between the predicted value and the real value
- Variance describes the variation range of the predicted value , The degree of dispersion , The greater the variance , The more scattered the distribution of the prediction result data .
- High deviation is under fitting , High variance is over fitting . Because deviation refers to how much data we ignore , Variance refers to the dependence of the model on data
- High variance : The model changes significantly according to the training data set
- Validation sets can prevent over fitting .
- Set up the pre-test evaluation model , And make improvements before the real test , This prediction trial is called a verification set .
- Evaluate the degree of data fitting , Use the cost function J=aJtrain( Training set error )+bJcv( Cross validation set error )
- Regularization term :
- Generally, it is a monotone increasing function of model complexity , The more complex the model , The larger the value of the regularization term , For example, the regularization term can be the norm of the model parameter vector .
- From the perspective of Bayesian estimation , The regularization term corresponds to the prior probability of the model
- L1、L2 Regularization can be understood as the introduction of a priori distribution into the model ,L1 Regularization introduces Laplace distribution ,L2 Regularization introduces Gaussian distribution .
- Laplace is distributed in 0 Highlight near value , And Gaussian distribution in 0 The distribution around the value is flat , The distribution on both sides is sparse . Correspondingly ( In fact, it is against , Because the training process is to minimize the loss ),L1 Regularization tends to sparse models ,L2 Regularization imposes heavy penalties on parameters with high weights .
- The regularization term corresponds to the prior information in the posterior probability estimation , The loss function corresponds to the likelihood function , The product of the two yields the Bayesian maximum a posteriori probability .
- Logarithm of Bayesian posterior probability can be transformed into loss function + Regularization term .
- maximum likelihood : The multiplication of all sample probabilities maximizes
- Select the training method according to the data set :
- When the given data is sufficient , Cut the data into training sets ( Training models ), Verification set ( Model selection ), Test set ( Model to evaluate ). Select the model with the minimum prediction error in the verification set
- When the data set is insufficient , Use cross validation ( Reuse data )
边栏推荐
猜你喜欢

Starting from business needs, open the road of efficient IDC operation and maintenance

How to prevent the unburned gas when the city gas safety is alarmed again?

Chapter III data types and variables
Go语言系列:Go从哪里来,Go将去哪里?

生成扩散模型漫谈:DDPM = 贝叶斯 + 去噪

计算日期或日期格式化
![[knowledge atlas] practice -- Practice of question answering system based on medical knowledge atlas (Part4): problem analysis and retrieval sentence generation combined with problem classification](/img/22/01297d28e5bfb105fc65ee29248a7c.png)
[knowledge atlas] practice -- Practice of question answering system based on medical knowledge atlas (Part4): problem analysis and retrieval sentence generation combined with problem classification
![[Nanjing University of Aeronautics and Astronautics] information sharing for the first and second examinations of postgraduate entrance examination](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[Nanjing University of Aeronautics and Astronautics] information sharing for the first and second examinations of postgraduate entrance examination

window10系统下nvm的安装步骤以及使用方法

OSPF综合实验
随机推荐
Summary of knowledge points for final review of server-side architecture design
双向链表的基本操作
stm32F407------SPI
第五章:流程控制
Box selection screenshot shortcut key of win10
04. Find the median of two positive arrays
Add batch delete
new与malloc
走马卒
01. Sum of two numbers
ACL 2022 | comparative learning based on optimal transmission to achieve interpretable semantic text similarity
【VSCODE】支持argparser/接受命令行参数
[cadence Allegro PCB design] permanently modify the shortcut key (customized) ~ it is valid for personal test~
Product life cycle to be considered in making intelligent hardware
Update 3dcat real time cloud rendering V2.1.2 release
Bo Yun container cloud and Devops platform won the trusted cloud "technology best practice Award"
函数名指针和函数指针
爬虫框架-crawler
[cadence Allegro PCB design] error: possible pin type conflict gnd/vcc power connected to output
Idea 必备插件