root_numpy.tmva.evaluate_method

root_numpy.tmva.evaluate_method(method, events, aux=0.0)

Evaluate a TMVA::MethodBase over a NumPy array.

Warning

TMVA::Reader has known problems with thread safety in versions of ROOT earlier than 6.03. There will potentially be a crash if you call method = reader.FindMVA(name) in Python and then pass this method here. Consider using evaluate_reader instead if you are affected by this crash.

Parameters:

method : TMVA::MethodBase

A TMVA::MethodBase instance with variables booked in exactly the same order as the columns in events.

events : numpy array of shape [n_events, n_variables]

A two-dimensional NumPy array containing the rows of events and columns of variables. The order of the columns must match the order in which you called AddVariable() for each variable.

aux : float, optional (default=0.)

Auxiliary value used by MethodCuts to set the desired signal efficiency.

Returns:

output : numpy array of shape [n_events]

The method output value for each event

See also

evaluate_reader