{"id":17418,"date":"2020-09-24T13:33:40","date_gmt":"2020-09-24T08:03:40","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/"},"modified":"2024-09-02T15:29:04","modified_gmt":"2024-09-02T09:59:04","slug":"cross-validation","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/","title":{"rendered":"What is Cross Validation in Machine learning? Types of Cross Validation"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"what-is-cross-validation\"><strong>What is Cross Validation?<\/strong><\/h2>\n\n\n\n<p>Cross-validation is a technique used to evaluate the performance of a <a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-machine-learning\/\">machine learning<\/a> model by partitioning the data into multiple subsets.<\/p>\n\n\n\n<p>It involves training the model on some of these subsets and testing it on the remaining data, rotating the subsets to ensure every part of the data is used for both training and testing. <\/p>\n\n\n\n<p>This approach helps in assessing how well the model generalizes to unseen data and reduces the risk of overfitting, especially when working with limited datasets. <\/p>\n\n\n\n<p>By using most of the <a href=\"https:\/\/www.mygreatlearning.com\/blog\/dataset-in-machine-learning\/\">dataset<\/a> for both training and validation, cross-validation provides a more reliable estimate of the model's performance on real-world data.<\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Accelerate AI Career<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/executive-pgp-ai-machine-learning\" class=\"courses-cta-title-link\">PGP- Artificial Intelligence and Machine Learning (Executive)<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">Advance your career with cutting-edge AI skills \u2014 built for working professionals.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>7 months Duration<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>4.72\/5 Rating<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/executive-pgp-ai-machine-learning\" class=\"courses-cta-button\">\n                Explore the Course\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"types-of-cross-validation\"><strong>Types of Cross Validation<\/strong><\/h2>\n\n\n\n<p>There are different types of cross validation methods, and they could be classified into two broad categories \u2013 Non-exhaustive and Exhaustive Methods. We\u2019re going to look at a few examples from both the categories.<br><\/p>\n\n\n\n<h2 id=\"non-exhaustive-methods\">Non-exhaustive Methods<\/h2>\n\n\n\n<p>Non-exhaustive cross validation methods, as the name suggests do not compute all ways of splitting the original data. Let us go through the methods to get a clearer understanding.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"holdout-method\">Holdout method<\/h2>\n\n\n\n<p>The most basic cross validation technique divides the entire dataset into two parts: training data and testing data. <br><br>As the name suggests, we train the model on training data and then evaluate it on the testing set. Usually, the training data size is more than twice that of the testing data, so the data is split in the ratio of 70:30 or 80:20.<\/p>\n\n\n\n<p>In this approach, the data is first shuffled randomly before splitting. As the model is trained on a different combination of data points, the model can give different results every time we train it, which can cause instability. Also, we can only ensure that the train set we picked represents part of the dataset.<\/p>\n\n\n\n<p>Also, when our dataset is not too large, the testing data may contain some critical information that we will lose as we do not train the model on the testing set. The holdout method is proper when you have a considerable dataset, are on a time crunch, or are starting to build an initial model in your data science project.&nbsp;<\/p>\n\n\n\n<p>For example, you must build a machine-learning model that detects brain tumors using MRI images. You\u2019ll first get your hands on a dataset of MRI images with their labels of having brain tumors or not. <\/p>\n\n\n\n<p>Then, using the holdout method, you\u2019ll divide the dataset into two portions: 70% of images go under the training set, and the remaining 30% go under the testing set. This way, you\u2019ll train the model on 70% of images and then test its accuracy on 30% of labeled images.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"k-fold-cross-validation\">K fold cross validation<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/k-fold-cross-validation\">K-fold cross validation<\/a> is the cross validation technique that improves the holdout method. This method guarantees that the score of our model does not depend on how we picked the train and test set. <br><br>The data set is divided into k number of subsets, and each subgroup is made testing set at least once when it is repeated k number of times. Let us go through this in steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Randomly split your entire dataset into k number of folds (subsets)<\/li>\n\n\n\n<li>For each fold in your dataset, train your model on the remaining folds of the dataset, which turns out to be k-1. Then, the model will be tested to check the effectiveness of this particular fold.<\/li>\n\n\n\n<li>Repeat steps 1 and 2 until every k-fold has served as the test set at least once during the whole model-building process.<\/li>\n\n\n\n<li>The average of all the accuracies for each k-fold is called the cross-validation accuracy. It will serve as the model's performance metric.<\/li>\n<\/ol>\n\n\n\n<p>This method is mainly preferred when we have a small dataset because it is less biased, as every data point in the dataset has a chance of appearing in the training or testing set at least once.&nbsp;<\/p>\n\n\n\n<p>For example, suppose we have a small dataset of dermoscopic images representing different types of skin cancers. In that case, if we use the holdout method, we can detect some types easily. <\/p>\n\n\n\n<p>Still, some types might not get detected, as their essential features were not used during training as they were residing in the testing set. Thus, using K folds here can benefit a lot as each image is going to be tested against all remaining k-1 edges, which means each feature will be trained and tested upon.<\/p>\n\n\n\n<p>The only disadvantage of this method is that it is computationally expensive, as it runs the training algorithm k times and evaluates each k data point<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"stratified-k-fold-cross-validation\"><strong>Stratified K Fold Cross Validation<\/strong><\/h2>\n\n\n\n<p>If we implement K folds on a classification dataset, we'll randomly shuffle the data and divide it into k folds. <\/p>\n\n\n\n<p>However, there are chances that some folds contain data specific to one particular class, making the folds imbalanced and our training biased. <\/p>\n\n\n\n<p>For example, let us get a fold with the majority belonging to one class(say positive) and only a few as a negative class. This will undoubtedly ruin our training, and to avoid this, we make stratified folds using stratification.<\/p>\n\n\n\n<p>Stratification is the process of rearranging the data to ensure that each fold represents the&nbsp;whole. For example, in a binary classification problem, there can only be two possibilities: a data point belongs to class A or B. So, in that case, we must arrange the data such that in every fold, each class consists of about half the instances in that fold.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"exhaustive-methods\">Exhaustive Methods<\/h2>\n\n\n\n<p>Exhaustive cross validation techniques test all possible ways to divide the original sample into a training and a validation set by testing all the data points against one or more data points.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"leave-p-out-cross-validation\">Leave-P-Out cross validation<\/h2>\n\n\n\n<p>When using this exhaustive method, we take p number of points out from the total number of data points in the dataset(say n). While training the model we train it on these (n - p) data points and test the model on p data points. <br><br>We repeat this process for all the possible combinations of p from the original dataset. Then to get the final accuracy, we average the accuracies from all these iterations.<\/p>\n\n\n\n<p>This is an exhaustive method as we train the model on every possible combination of data points. Remember if we choose a higher value for p, then the number of combinations will be more and we can say the method gets a lot more exhaustive.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"leave-one-out-cross-validation\">Leave-one-out cross validation<\/h2>\n\n\n\n<p>This is a simple variation of Leave-P-Out cross validation, where the p-value is set as one. We leave one data point for testing and train the model on all other data points. Once we test the data on the left-out data point, we repeat the process until all data points serve as a testing set at least once. <\/p>\n\n\n\n<p>It is an exhaustive method and might produce variation if the left-out data point used for testing is an outlier, causing variations in accuracy. <\/p>\n\n\n\n<p>For example, suppose we have a dataset of dermoscopic images representing skin cancer types. In that case, we can leave one image when training the model on the remaining images and then validate the model using the left-out image; we\u2019ll touch upon all the data points, thus training and testing our model on each data point.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-rolling-cross-validation\"><strong>What is Rolling Cross Validation?<\/strong><\/h2>\n\n\n\n<p>For <a href=\"https:\/\/www.mygreatlearning.com\/blog\/time-series-analysis-and-forecasting\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"time-series (opens in a new tab)\">time-series<\/a> data the above-mentioned methods are not the best ways to evaluate the models. Here are two reasons as to why this is not an ideal way to go:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Shuffling the data messes up the time section of the data as it will disrupt the order of events<\/li>\n\n\n\n<li>Using cross-validation, there is a chance that we train the model on future data and test on past data which will break the golden rule in time series i.e. \u201cpeaking in the future is not allowed\u201d.<\/li>\n<\/ol>\n\n\n\n<p>Keeping these points in mind we perform cross validation in this manner<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>We create the fold (or subsets) in a forward-chaining fashion.<\/li>\n\n\n\n<li>Suppose we have a time series for stock prices for a period of n years and we divide the data yearly into n number of folds. The folds would be created like:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">iteration 1: training [1], test [2]\niteration 2: training [1 2], test [3]\niteration 3: training [1 2 3], test [4]\niteration 4: training [1 2 3 4], test [5]\niteration 5: training [1 2 3 4 5], test [6]\n.\n.\n.\niteration n: training [1 2 3 \u2026.. n-1], test [n]\n\n <\/pre>\n\n\n\n<p>Here as we can see in the first iteration, we train on the data of the first year and then test it on 2nd year. Similarly in the next iteration, we train the on the data of first and second year and then test on the third year of data.<\/p>\n\n\n\n<p>Note:&nbsp; It is not necessary to divide the data into years, I simply took this example to make it more understandable and easy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faqs\">FAQs<\/h2>\n\n\n\n<p><strong>1. What is the purpose of cross validation?<\/strong><\/p>\n\n\n\n<p>The&nbsp;<strong>purpose of cross<\/strong>-<strong>validation<\/strong>&nbsp;is to test the ability of a machine learning model to predict new data. It is also used to flag problems like overfitting or selection bias and gives insights on how the model will generalize to an independent dataset. <\/p>\n\n\n\n<p><strong>2. How do you explain cross validation?<\/strong><\/p>\n\n\n\n<p>Cross-validation is a statistical method used to estimate the performance (or accuracy) of machine learning models. It is used to protect against overfitting in a predictive model, particularly in a case where the amount of data may be limited. In&nbsp;cross-validation, you make a fixed number of folds (or partitions) of the data, run the analysis on each fold, and then average the overall error estimate.<\/p>\n\n\n\n<p><strong>3. What are the types of cross validation?<\/strong><\/p>\n\n\n\n<p>The 4 Types of Cross Validation in Machine Learning are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Holdout&nbsp;Method<\/li>\n\n\n\n<li>K-Fold Cross-Validation<\/li>\n\n\n\n<li>Stratified K-Fold Cross-Validation<\/li>\n\n\n\n<li>Leave-P-Out Cross-Validation<\/li>\n<\/ul>\n\n\n\n<p><strong>4. What is cross validation and why we need it?<\/strong><\/p>\n\n\n\n<p>Cross-Validation&nbsp;is a very useful technique to assess the effectiveness of a machine learning model, particularly in cases where you&nbsp;need&nbsp;to mitigate overfitting. It is also of use in determining the hyperparameters of your model, in the sense that which parameters will result in the lowest test error.<\/p>\n\n\n\n<p><strong>5. Does cross validation reduce Overfitting?<\/strong><\/p>\n\n\n\n<p>Cross-validation&nbsp;is a procedure that is used to&nbsp;avoid overfitting&nbsp;and estimate the skill of the model on new data. There are common tactics that you can use to select the value of k for your dataset.<\/p>\n\n\n\n<p>This brings us to the end of this article where we learned about cross validation and some of its variants. To get a in-depth experience and knowledge about machine learning, take the free course from the great learning academy. Click the banner to know more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"our-machine-learning-courses\">Our Machine Learning Courses<\/h2>\n\n\n\n<p>Explore our Machine Learning and AI courses, designed for comprehensive learning and skill development.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Program Name<\/strong><\/th><th><strong>Duration<\/strong><\/th><\/tr><tr><th><a href=\"https:\/\/professionalonline2.mit.edu\/no-code-artificial-intelligence-machine-learning-program\">MIT No code AI and Machine Learning Course<\/a><\/th><th>12 Weeks<\/th><\/tr><tr><th><a href=\"https:\/\/idss-gl.mit.edu\/mit-idss-data-science-machine-learning-online-program\">MIT Data Science and Machine Learning Course<\/a><\/th><th>12 Weeks<\/th><\/tr><tr><th><a href=\"https:\/\/www.mygreatlearning.com\/mit-data-science-and-machine-learning-program\">Data Science and Machine Learning Course<\/a><\/th><th>12 Weeks<\/th><\/tr><\/thead><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>What is Cross Validation? Cross-validation is a technique used to evaluate the performance of a machine learning model by partitioning the data into multiple subsets. It involves training the model on some of these subsets and testing it on the remaining data, rotating the subsets to ensure every part of the data is used for [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":17421,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[],"content_type":[],"class_list":["post-17418","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>What is Cross Validation and its types in Machine learning? Great Learning<\/title>\n<meta name=\"description\" content=\"Cross validation is a statistical method used to estimate the performance (or accuracy) of machine learning models.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Cross Validation in Machine learning? Types of Cross Validation\" \/>\n<meta property=\"og:description\" content=\"Cross validation is a statistical method used to estimate the performance (or accuracy) of machine learning models.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-24T08:03:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-02T09:59:04+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"499\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"What is Cross Validation in Machine learning? Types of Cross Validation\",\"datePublished\":\"2020-09-24T08:03:40+00:00\",\"dateModified\":\"2024-09-02T09:59:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/\"},\"wordCount\":1788,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/shutterstock_1120664918.jpg\",\"articleSection\":[\"AI and Machine Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/\",\"name\":\"What is Cross Validation and its types in Machine learning? Great Learning\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/shutterstock_1120664918.jpg\",\"datePublished\":\"2020-09-24T08:03:40+00:00\",\"dateModified\":\"2024-09-02T09:59:04+00:00\",\"description\":\"Cross validation is a statistical method used to estimate the performance (or accuracy) of machine learning models.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/shutterstock_1120664918.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/shutterstock_1120664918.jpg\",\"width\":1000,\"height\":499,\"caption\":\"cross validation\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/cross-validation\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI and Machine Learning\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/artificial-intelligence\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"What is Cross Validation in Machine learning? Types of Cross Validation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"What is Cross Validation and its types in Machine learning? Great Learning","description":"Cross validation is a statistical method used to estimate the performance (or accuracy) of machine learning models.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/","og_locale":"en_US","og_type":"article","og_title":"What is Cross Validation in Machine learning? Types of Cross Validation","og_description":"Cross validation is a statistical method used to estimate the performance (or accuracy) of machine learning models.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2020-09-24T08:03:40+00:00","article_modified_time":"2024-09-02T09:59:04+00:00","og_image":[{"width":1000,"height":499,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"What is Cross Validation in Machine learning? Types of Cross Validation","datePublished":"2020-09-24T08:03:40+00:00","dateModified":"2024-09-02T09:59:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/"},"wordCount":1788,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg","articleSection":["AI and Machine Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/","url":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/","name":"What is Cross Validation and its types in Machine learning? Great Learning","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg","datePublished":"2020-09-24T08:03:40+00:00","dateModified":"2024-09-02T09:59:04+00:00","description":"Cross validation is a statistical method used to estimate the performance (or accuracy) of machine learning models.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg","width":1000,"height":499,"caption":"cross validation"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/cross-validation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"AI and Machine Learning","item":"https:\/\/www.mygreatlearning.com\/blog\/artificial-intelligence\/"},{"@type":"ListItem","position":3,"name":"What is Cross Validation in Machine learning? Types of Cross Validation"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg",1000,499,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918-300x150.jpg",300,150,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918-768x383.jpg",768,383,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg",1000,499,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg",1000,499,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg",1000,499,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg",640,319,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg",96,48,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/07\/shutterstock_1120664918.jpg",150,75,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":1,"uagb_excerpt":"What is Cross Validation? Cross-validation is a technique used to evaluate the performance of a machine learning model by partitioning the data into multiple subsets. It involves training the model on some of these subsets and testing it on the remaining data, rotating the subsets to ensure every part of the data is used for&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/17418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=17418"}],"version-history":[{"count":28,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/17418\/revisions"}],"predecessor-version":[{"id":111048,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/17418\/revisions\/111048"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/17421"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=17418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=17418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=17418"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=17418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}