# Cross validation sets

**URL:** <https://community.deeplearning.ai/t/cross-validation-sets/385411>\
**Category:** Advanced Learning Algorithms\
**Tags:** week-module-3\
**Created:** [July 14, 2023, 5:57pm UTC](https://community.deeplearning.ai/t/cross-validation-sets/385411 "2023-07-14T17:57:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamed\_Hussien1](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@Mohamed\_Hussien1](https://community.deeplearning.ai/u/Mohamed_Hussien1)\
**Post date:** [July 14, 2023, 5:57pm UTC](https://community.deeplearning.ai/t/cross-validation-sets/385411/1 "2023-07-14T17:57:14Z")

</div>

I did not understand why professor used cross validation data sets instead of using the test data set ? … I watched the video two time and I did not get it

---

<div class="post-metadata">

**Author:** ![Christian\_Simonis](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/christian_simonis/32/142583_2.png) [@Christian\_Simonis](https://community.deeplearning.ai/u/Christian_Simonis)\
**Post date:** [July 14, 2023, 6:16pm UTC](https://community.deeplearning.ai/t/cross-validation-sets/385411/2 "2023-07-14T18:16:14Z")

</div>

Hi @Mohamed_Hussien1

especially when you have limited data, cross validation is really useful since you basically can test several splits (not just one as w/ one test set) and therefore more variation of data which should usually help to prevent overfitting, see also this thread: [Why cross validation - #4 by Christian\_Simonis](https://community.deeplearning.ai/t/why-cross-validation/339001/4)

Is there any specific part which is unclear?

Best regards  
Christian

---

<div class="post-metadata">

**Author:** ![Mohamed\_Hussien1](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@Mohamed\_Hussien1](https://community.deeplearning.ai/u/Mohamed_Hussien1)\
**Post date:** [July 14, 2023, 6:36pm UTC](https://community.deeplearning.ai/t/cross-validation-sets/385411/3 "2023-07-14T18:36:42Z")

</div>

for more clarification : for diagnosing different models he decided to divide the data sets to training sets and test sets and then He claimed that choosing the model depending on the J of (test data sets) will not be good … so he divided the data into three sections training , cross validation and test data again … and He said it will be better to select the model based on the J of cross validation data … I did not get what the difference or what is the impact from using the cross validation data than the test data … eventually they are the same ( data ) ?

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [July 14, 2023, 8:52pm UTC](https://community.deeplearning.ai/t/cross-validation-sets/385411/4 "2023-07-14T20:52:52Z")

</div>

- The training set is used to train the model.
- The validation set is used to modify the model’s hyperparameters (such as the number of units, or the regularization value)
- There is an iterative process between training and validation.
- The test set is used as a final check of the model performance, using data that was not involved in creating the model.

---

<div class="post-metadata">

**Author:** ![pastorsoto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/pastorsoto/32/127023_2.png) [@pastorsoto](https://community.deeplearning.ai/u/pastorsoto)\
**Post date:** [July 16, 2023, 9:08pm UTC](https://community.deeplearning.ai/t/cross-validation-sets/385411/5 "2023-07-16T21:08:49Z")

</div>

Hi @Mohamed_Hussien1 great question!

I just want to add that validation is a fascinating topic in machine learning, mastering this can really make a big difference. My suggestion is to check this chapter in which they address this topic in the context of Machine Learning competitions [Designing Good Validation | The Kaggle Book (oreilly.com)](https://learning.oreilly.com/library/view/the-kaggle-book/9781801817479/Text/Chapter_6.xhtml#_idParaDest-97)

I hope this helps!
