diff --git a/examples/tmva/plot_multiclass.py b/examples/tmva/plot_multiclass.py index 1191a82..ce42356 100644 --- a/examples/tmva/plot_multiclass.py +++ b/examples/tmva/plot_multiclass.py @@ -44,9 +44,10 @@ # Call root_numpy's utility functions to add events from the arrays add_classification_events(factory, X_train, y_train, weights=w_train) add_classification_events(factory, X_test, y_test, weights=w_test, test=True) +# The following line is necessary if events have been added individually: +factory.PrepareTrainingAndTestTree(TCut('1'), 'NormMode=EqualNumEvents') # Train a BDT -factory.PrepareTrainingAndTestTree(TCut('1'), 'NormMode=EqualNumEvents') factory.BookMethod('BDT', 'BDTG', 'nCuts=20:NTrees=20:MaxDepth=4:' 'BoostType=Grad:Shrinkage=0.10') diff --git a/examples/tmva/plot_regression.py b/examples/tmva/plot_regression.py index 59a820a..2007070 100644 --- a/examples/tmva/plot_regression.py +++ b/examples/tmva/plot_regression.py @@ -28,7 +28,9 @@ add_regression_events(factory, X, y) add_regression_events(factory, X, y, test=True) -factory.PrepareTrainingAndTestTree(TCut('1'), 'NormMode=EqualNumEvents') +# The following line is necessary if events have been added individually: +factory.PrepareTrainingAndTestTree(TCut('1'), '') + factory.BookMethod('BDT', 'BDT1', 'nCuts=20:NTrees=1:MaxDepth=4:BoostType=AdaBoostR2:' 'SeparationType=RegressionVariance') diff --git a/examples/tmva/plot_twoclass.py b/examples/tmva/plot_twoclass.py index c4735ba..d92059d 100644 --- a/examples/tmva/plot_twoclass.py +++ b/examples/tmva/plot_twoclass.py @@ -42,9 +42,10 @@ # Call root_numpy's utility functions to add events from the arrays add_classification_events(factory, X_train, y_train, weights=w_train) add_classification_events(factory, X_test, y_test, weights=w_test, test=True) +# The following line is necessary if events have been added individually: +factory.PrepareTrainingAndTestTree(TCut('1'), 'NormMode=EqualNumEvents') # Train a classifier -factory.PrepareTrainingAndTestTree(TCut('1'), 'NormMode=EqualNumEvents') factory.BookMethod('Fisher', 'Fisher', 'Fisher:VarTransform=None:CreateMVAPdfs:' 'PDFInterpolMVAPdf=Spline2:NbinsMVAPdf=50:'