- Hands-On Artificial Intelligence for Beginners
- Patrick D. Smith
- 283字
- 2021-06-10 19:33:49
K-fold cross-validation
You've already seen a form of cross-validation before; holding out a portion of our data is the simplest form of cross- validation that we can have. While this is generally a good practice, it can sometimes leave important features out of the training set that can create poor performance when it comes time to test. To remedy this, we can take standard cross validation a step further with a technique called k-fold cross validation.
In k-fold cross validation, our dataset is evenly divided in k event parts, chosen by the user. As a rule of thumb, generally you should stick to k = 5 or k = 10 for best performance. The model is then trained and tested k times over. During each training episode, one k segment of the data held out as a testing set and the other segments used as training. You can think of this like shuffling a deck of cards - each time we are taking one card out for testing, and leaving the rest for training. The total accuracy of the model and it's error is then the combination of all of the train/test episode that were conducted.
There are some models, such as Logistic Regression and Support vector machines, which benefit from k-fold cross validation. Neural network models, such as the ones that we will be discussing in the coming chapter, also benefit from k-fold cross validation methods. Random Forest models like we described precedingly, on the other hand, do not require k-fold cross-validation. K-fold is used as a tuning and optimization method for balancing feature importances, and Random Forests already contain a measure of feature importance.
- 大數據導論:思維、技術與應用
- 軟件架構設計
- PowerShell 3.0 Advanced Administration Handbook
- Hands-On Cybersecurity with Blockchain
- 水晶石精粹:3ds max & ZBrush三維數字靜幀藝術
- 項目管理成功利器Project 2007全程解析
- 多媒體制作與應用
- R Data Analysis Projects
- Bayesian Analysis with Python
- 筆記本電腦維修之電路分析基礎
- 運動控制系統
- 工業機器人應用系統三維建模
- Mastering Machine Learning with R
- Mastercam X5應用技能基本功特訓
- 運動控制系統應用及實例解析