# The correlation matrix in TMVA is -nan

**URL:** <https://root-forum.cern.ch/t/the-correlation-matrix-in-tmva-is-nan/49302>\
**Category:** TMVA\
**Created:** [March 22, 2022, 12:02pm UTC](https://root-forum.cern.ch/t/the-correlation-matrix-in-tmva-is-nan/49302 "2022-03-22T12:02:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [March 22, 2022, 2:47pm UTC](https://root-forum.cern.ch/t/the-correlation-matrix-in-tmva-is-nan/49302/4 "2022-03-22T14:47:33Z")

</div>

Hi @chaerme,

Could you attach here the `test_00.txt` and `test_01.txt` files for reproducibility? The problem might be more related to how the data is imported more than TMVA.

> [@chaerme](#):
>
> ```auto
> while (getline(inputfile_s, temp_s)) //signal
> {
> vec_s.push_back(temp_s);
> }
> for (auto it = vec_s.begin(); it != vec_s.end(); it++)
> {
> istringstream is(*it);
> string s;
> int pam = 0;
> 
> ```

Also, for creating a TTree out of a CSV file, see this related topic [Read data from CSV file - #3 by renqipan](https://root-forum.cern.ch/t/read-data-from-csv-file/38752/3). If your data consists of comma-separated values, this will both save some code and be less error prone.

Cheers,  
J.

---

_[View the full topic](https://root-forum.cern.ch/t/the-correlation-matrix-in-tmva-is-nan/49302)._
