# Response Values using Trained TMVACrossValidation\_MLP

**URL:** <https://root-forum.cern.ch/t/response-values-using-trained-tmvacrossvalidation-mlp/35570>\
**Category:** TMVA\
**Created:** [August 8, 2019, 12:41pm UTC](https://root-forum.cern.ch/t/response-values-using-trained-tmvacrossvalidation-mlp/35570 "2019-08-08T12:41:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unlucky](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/unlucky/32/19553_2.png) [@Unlucky](https://root-forum.cern.ch/u/Unlucky)\
**Post date:** [August 8, 2019, 12:41pm UTC](https://root-forum.cern.ch/t/response-values-using-trained-tmvacrossvalidation-mlp/35570/1 "2019-08-08T12:41:50Z")

</div>

Hi,

I’ve been using different TMVA models with my data and found really good signal efficiencies and background efficiencies using a MLP neural network using TMVACrossValidation. However the code below errors when reader calls EvaluateMultiClass with the error.

> terminate called after throwing an instance of ‘std::out\_of\_range’ what(): map::at

This is also true using EvaluateMVA. I have previously used this same implementation with a TMVAClassification\_BDT model and it works. Can anyone tell me how I need to change my use of reader when using TMVACrossValidation?

```auto
reader->BookMVA("TMVACrossValidation_MLP", "dataset/weight/TMVACrossValidation_BDT.weights.xml");

for (Long64_t ievt=0; ievt<data->GetEntries(); ievt++){
     
    var[0] = userVar[0];
    var[1] = userVar[1];
    var[2] = userVar[2];
    var[3] = userVar[3];

    data->GetEntry(ievt);

    BDT_Response = reader->EvaluateMulticlass("TMVACrossValidation_MLP")[0];

    TreeOut->Fill();
}

```

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [August 13, 2019, 7:59am UTC](https://root-forum.cern.ch/t/response-values-using-trained-tmvacrossvalidation-mlp/35570/2 "2019-08-13T07:59:00Z")

</div>

Hello @Unlucky,

I invite @moneta or @kialbert to help here. In the mean time, could you try to find the line where the exception is thrown?  
For this, try if you get the following to work:

- Optional, but helpful: Try to get a root version with debug symbols. I don’t know where you get ROOT from, but if it’s from cvmfs, there are often versions with `dbg` in the name.
- Start `gdb root.exe` to attach a debugger to root. (If you are not running the evaluation from within ROOT, attach gdb to the executable you are running).
- Type catch throw to catch all exceptions.
- Type start, and start running your macro / script / executable.
- When it stops because the execption is thrown, type bt to get a backtrace. Post this here.
