# Overtraining check with CrossValidation

**URL:** <https://root-forum.cern.ch/t/overtraining-check-with-crossvalidation/35360>\
**Category:** TMVA\
**Created:** [July 26, 2019, 9:49am UTC](https://root-forum.cern.ch/t/overtraining-check-with-crossvalidation/35360 "2019-07-26T09:49:06Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [August 14, 2019, 3:56pm UTC](https://root-forum.cern.ch/t/overtraining-check-with-crossvalidation/35360/4 "2019-08-14T15:56:00Z")

</div>

Hi,

> [@mwilkins](#):
>
> there are no separate “training” and “testing” samples on which to evaluate

Precisely so.

> [@mwilkins](#):
>
> are there built-in/recommended ways to check for overtraining in CrossValidation within ROOT?

If a separate, external, test set is not appropriate, one can evaluate each fold in separation to investigate the property you are interested in.

When using cross validation in TMVA, a separate model is trained for each fold and saved in e.g. `dataset/weights/YourModelName_Fold1.xml`. These can then be used with the `TMVA::Reader` get the individual output (it is beneficial here to split on some external quantity e.g. an event ID so that the input to each fold is easily recreated).

Cheers,  
Kim

---

_[View the full topic](https://root-forum.cern.ch/t/overtraining-check-with-crossvalidation/35360)._
