root_numpy.tmva.add_regression_events¶
-
root_numpy.tmva.
add_regression_events
(obj, events, targets, weights=None, test=False)¶ Add regression events to a TMVA::Factory or TMVA::DataLoader from NumPy arrays.
Parameters: obj : TMVA::Factory or TMVA::DataLoader
A TMVA::Factory or TMVA::DataLoader (TMVA’s interface as of ROOT 6.07/04) instance with variables already 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.targets : numpy array of shape [n_events] or [n_events, n_targets]
The target value(s) for each event in
events
. For multiple target values,targets
must be a two-dimensional array with a column for each target in the same order in which you calledAddTarget()
.weights : numpy array of shape [n_events], optional
Event weights.
test : bool, optional (default=False)
If True, then the events will be added as test events, otherwise they are added as training events by default.
Notes
A TMVA::Factory or TMVA::DataLoader requires you to add both training and test events even if you don’t intend to call
TestAllMethods()
.