"Machine learning" K-fold Cross validation (K-fold crossover verification)

Source: Internet
Author: User



Another blog post http://blog.csdn.net/evillist/article/details/76009632

The purpose of cross-validation: in practical training, the model is usually good for training data, but it is not fit to the data of training data. It is used to evaluate the generalization ability of the model so as to select the model .

The basic idea of cross-validation is to group the original data (dataset) in a sense, part as the training set (train set), and the other as a validation set (validation set or test set). First, the training set is used to train the model, and then the validation set is used to test the generalization error of the model. In addition, the data in reality is always limited, in order to reuse the data, and then propose K-fold cross-validation.

For a classification or regression problem, assume that the optional model is. K- Fold cross-validation is the 1/k of the training set as a test set, each model training k times, testing k times, the error rate is the average of K, the final selection of the average rate of the smallest model mi.

1, the entire training set S is divided into k disjoint subsets, assuming that the number of training samples in S is M, then each subset has m/k training sample, the corresponding subset is called {}.

2, each time from the model set M to take out one, and then in the training sub-set to select a K-1

{} (i.e. leaving only one at a time), use this k-1 subset to train and get the assumed function. Finally, use the rest of the test to get experience errors.

3, because we leave one at a time (J from 1 to K), so we will get K experience error, then for one, its experience error is the average of this K experience error.

4, choose the average experience error rate of the smallest, and then use all the s to do another training, get the final.


Reference


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.