Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
docs: note about MethodCuts requiring signal to be added first
Browse files Browse the repository at this point in the history
  • Loading branch information
ndawe committed May 20, 2015
1 parent 0d35b7c commit 42b9da7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions root_numpy/tmva/_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,19 @@ def add_classification_events(factory, events, labels, signal_label=None,
Notes
-----
A TMVA::Factory requires you to add both training and test events even if
you don't intend to call ``TestAllMethods()``.
* A TMVA::Factory requires you to add both training and test events even if
you don't intend to call ``TestAllMethods()``.
* When using MethodCuts, the first event added must be a signal event,
otherwise TMVA will fail with ``<FATAL> Interval : maximum lower than
minimum``. To place a signal event first::
# Get index of first signal event
first_signal = np.nonzero(labels == signal_label)[0][0]
# Swap this with first event
events[0], events[first_signal] = events[first_signal].copy(), events[0].copy()
labels[0], labels[first_signal] = labels[first_signal], labels[0]
weights[0], weights[first_signal] = weights[first_signal], weights[0]
"""
if not isinstance(factory, TMVA.Factory):
Expand Down

0 comments on commit 42b9da7

Please sign in to comment.