# EvaluateAllMethods fails when either the Train or the Test sample is less than 100

**URL:** <https://root-forum.cern.ch/t/evaluateallmethods-fails-when-either-the-train-or-the-test-sample-is-less-than-100/55834>\
**Category:** TMVA\
**Created:** [July 27, 2023, 5:03am UTC](https://root-forum.cern.ch/t/evaluateallmethods-fails-when-either-the-train-or-the-test-sample-is-less-than-100/55834 "2023-07-27T05:03:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lilina](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/lilina/32/28468_2.png) [@lilina](https://root-forum.cern.ch/u/lilina)\
**Post date:** [July 27, 2023, 5:03am UTC](https://root-forum.cern.ch/t/evaluateallmethods-fails-when-either-the-train-or-the-test-sample-is-less-than-100/55834/1 "2023-07-27T05:03:01Z")

</div>

Hi

I am doing a regression following the tutorial RegressionKeras.py. The data that I have contains less than 100 entries. When I run the code I get the following error after the training and test are done at the `factory.EvaluateAllMethods()` step:

```auto
1/1 [==============================] - 0s 9ms/step
1/1 [==============================] - 0s 9ms/step time left: 0 sec) 
1/1 [==============================] - 0s 9ms/step
1/1 [==============================] - 0s 9ms/step
1/1 [==============================] - 0s 9ms/step
1/1 [==============================] - 0s 9ms/step
                         : Dataset[dataset] : Elapsed time for evaluation of 50 events: 2.33 sec       
                         : Create variable histograms
                         : Create regression target histograms
                         : Create regression average deviation
                         : Results created
Factory : Evaluate all methods
                         : Evaluate regression method: PyKeras
                         : TestRegression (testing)
                         : Calculate regression for all events
1/1 [==============================] - 0s 9ms/step
 ***Break*** floating point exception

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================

```

It runs without problems if I do not do `EvaluateAllMethods()`, but every time that either `nTrain_Regression` or `nTest_Regression` samples are less than 100, the `factory.EvaluateAllMethods()` fails. Is there any way to solve this?  
I have attached the RegressionKeras.py and the root file that I used to test that if I set train or the test sample is less than 100, the evaluation fails.

Thanks!

[sampled\_ReH\_XMapCF\_KM15\_5pct.root](https://root-forum.cern.ch/uploads/short-url/6cIBSAUhUqpBy4iXPGliUumNSbV.root) (7.7 KB)  
[RegressionKeras.py](https://root-forum.cern.ch/uploads/short-url/f5HFq1wMd6mMnZ4o5izkKrbg9qH.py) (2.1 KB)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [July 27, 2023, 8:06am UTC](https://root-forum.cern.ch/t/evaluateallmethods-fails-when-either-the-train-or-the-test-sample-is-less-than-100/55834/2 "2023-07-27T08:06:11Z")

</div>

I guess @moneta can help.

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [August 7, 2023, 12:15pm UTC](https://root-forum.cern.ch/t/evaluateallmethods-fails-when-either-the-train-or-the-test-sample-is-less-than-100/55834/3 "2023-08-07T12:15:40Z")

</div>

Hi,  
Apologies for the late reply. I have no problem running your script with less than 100 events. It is possible you are using an older version of ROOT and this problem has been fixed by newer versions

Lorenzo
