# TMVA error with BookMethod

**URL:** <https://root-forum.cern.ch/t/tmva-error-with-bookmethod/31355>\
**Category:** Newbie\
**Created:** [October 29, 2018, 6:28pm UTC](https://root-forum.cern.ch/t/tmva-error-with-bookmethod/31355 "2018-10-29T18:28:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xerader](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/a5b964/32.png) [@xerader](https://root-forum.cern.ch/u/xerader)\
**Post date:** [October 29, 2018, 6:28pm UTC](https://root-forum.cern.ch/t/tmva-error-with-bookmethod/31355/1 "2018-10-29T18:28:17Z")

</div>

When I try to run a .C file, i receive an error:

```auto
**error:**  **no matching member function for call to 'BookMethod'**
factory-&gt;BookMethod( TMVA::Types::kCuts, "Cuts",

```

The part of the code is

```auto
if (Use["Cuts"])
      factory->BookMethod( TMVA::Types::kCuts, "Cuts",
                           "!H:!V:FitMethod=MC:EffSel:SampleSize=200000:VarProp=FSmart" );

```

I had to change factory-\>AddVariable to dataloader-\>AddVariable in order to add variables. What do I have to change here?

I am currently running root 6.14 on MacOS Mojave (10.14). The file I am trying to run was built for an older version of root.

---

<div class="post-metadata">

**Author:** ![xerader](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/a5b964/32.png) [@xerader](https://root-forum.cern.ch/u/xerader)\
**Post date:** [October 31, 2018, 10:56am UTC](https://root-forum.cern.ch/t/tmva-error-with-bookmethod/31355/2 "2018-10-31T10:56:03Z")

</div>

For anyone else, this problem is solved. I reinstalled an older version of root (6.08) and it worked without a hitch.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [October 31, 2018, 4:34pm UTC](https://root-forum.cern.ch/t/tmva-error-with-bookmethod/31355/3 "2018-10-31T16:34:24Z")

</div>

@moneta @kialbert - what’s the replacement for `BookMethod`?

---

<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:** [October 31, 2018, 4:56pm UTC](https://root-forum.cern.ch/t/tmva-error-with-bookmethod/31355/4 "2018-10-31T16:56:19Z")

</div>

Hi,

Starting with ROOT version 6.10 the syntax is

```auto
TMVA::DataLoader * dataloader = new TMVA::DataLoader("dataset");

// ...snip...

if (Use["Cuts"])
      factory->BookMethod( dataloader, TMVA::Types::kCuts, "Cuts",
                           "!H:!V:FitMethod=MC:EffSel:SampleSize=200000:VarProp=FSmart" );

```

You can check `$ROOTSYS/tutorials/tmva/TMVAClassification.C` for the syntax applicable to you installed version.

Cheers,  
Kim
