As input data is used a toy-MC sample consisting of four Gaussian-distributed and linearly correlated input variables.
The methods to be used can be switched on and off by means of booleans, or via the prompt command, for example:
(note that the backslashes are mandatory) If no method given, a default set is used.
The output file "TMVAReg.root" can be analysed with the use of dedicated macros (simply say: root -l <macro.C>), which can be conveniently invoked through a GUI that will appear at the end of the run of this macro.
==> Start TMVARegression
--- TMVARegression : Using input file: ./files/tmva_reg_example.root
DataSetInfo : [dataset] : Added class "Regression"
: Add Tree TreeR of type Regression with 10000 events
: Dataset[dataset] : Class index : 0 name : Regression
Factory : Booking method: ␛[1mPDEFoam␛[0m
:
DataSetFactory : [dataset] : Number of events in input trees
:
: Number of training and testing events
: ---------------------------------------------------------------------------
: Regression -- training events : 1000
: Regression -- testing events : 9000
: Regression -- training and testing events: 10000
:
DataSetInfo : Correlation matrix (Regression):
: ------------------------
: var1 var2
: var1: +1.000 +0.006
: var2: +0.006 +1.000
: ------------------------
DataSetFactory : [dataset] :
:
Factory : Booking method: ␛[1mKNN␛[0m
:
Factory : Booking method: ␛[1mLD␛[0m
:
Factory : Booking method: ␛[1mDNN_CPU␛[0m
:
: Parsing option string:
: ... "!H:V:ErrorStrategy=SUMOFSQUARES:VarTransform=G:WeightInitialization=XAVIERUNIFORM:Architecture=CPU:Layout=TANH|50,Layout=TANH|50,Layout=TANH|50,LINEAR:TrainingStrategy=LearningRate=1e-2,Momentum=0.5,Repetitions=1,ConvergenceSteps=20,BatchSize=50,TestRepetitions=10,WeightDecay=0.01,Regularization=NONE,DropConfig=0.2+0.2+0.2+0.,DropRepetitions=2|LearningRate=1e-3,Momentum=0.9,Repetitions=1,ConvergenceSteps=20,BatchSize=50,TestRepetitions=5,WeightDecay=0.01,Regularization=L2,DropConfig=0.1+0.1+0.1,DropRepetitions=1|LearningRate=1e-4,Momentum=0.3,Repetitions=1,ConvergenceSteps=10,BatchSize=50,TestRepetitions=5,WeightDecay=0.01,Regularization=NONE"
: The following options are set:
: - By User:
: <none>
: - Default:
: Boost_num: "0" [Number of times the classifier will be boosted]
: Parsing option string:
: ... "!H:V:ErrorStrategy=SUMOFSQUARES:VarTransform=G:WeightInitialization=XAVIERUNIFORM:Architecture=CPU:Layout=TANH|50,Layout=TANH|50,Layout=TANH|50,LINEAR:TrainingStrategy=LearningRate=1e-2,Momentum=0.5,Repetitions=1,ConvergenceSteps=20,BatchSize=50,TestRepetitions=10,WeightDecay=0.01,Regularization=NONE,DropConfig=0.2+0.2+0.2+0.,DropRepetitions=2|LearningRate=1e-3,Momentum=0.9,Repetitions=1,ConvergenceSteps=20,BatchSize=50,TestRepetitions=5,WeightDecay=0.01,Regularization=L2,DropConfig=0.1+0.1+0.1,DropRepetitions=1|LearningRate=1e-4,Momentum=0.3,Repetitions=1,ConvergenceSteps=10,BatchSize=50,TestRepetitions=5,WeightDecay=0.01,Regularization=NONE"
: The following options are set:
: - By User:
: V: "True" [Verbose output (short form of "VerbosityLevel" below - overrides the latter one)]
: VarTransform: "G" [List of variable transformations performed before training, e.g., "D_Background,P_Signal,G,N_AllClasses" for: "Decorrelation, PCA-transformation, Gaussianisation, Normalisation, each for the given class of events ('AllClasses' denotes all events of all classes, if no class indication is given, 'All' is assumed)"]
: H: "False" [Print method-specific help message]
: Layout: "TANH|50,Layout=TANH|50,Layout=TANH|50,LINEAR" [Layout of the network.]
: ErrorStrategy: "SUMOFSQUARES" [Loss function: Mean squared error (regression) or cross entropy (binary classification).]
: WeightInitialization: "XAVIERUNIFORM" [Weight initialization strategy]
: Architecture: "CPU" [Which architecture to perform the training on.]
: TrainingStrategy: "LearningRate=1e-2,Momentum=0.5,Repetitions=1,ConvergenceSteps=20,BatchSize=50,TestRepetitions=10,WeightDecay=0.01,Regularization=NONE,DropConfig=0.2+0.2+0.2+0.,DropRepetitions=2|LearningRate=1e-3,Momentum=0.9,Repetitions=1,ConvergenceSteps=20,BatchSize=50,TestRepetitions=5,WeightDecay=0.01,Regularization=L2,DropConfig=0.1+0.1+0.1,DropRepetitions=1|LearningRate=1e-4,Momentum=0.3,Repetitions=1,ConvergenceSteps=10,BatchSize=50,TestRepetitions=5,WeightDecay=0.01,Regularization=NONE" [Defines the training strategies.]
: - Default:
: VerbosityLevel: "Default" [Verbosity level]
: CreateMVAPdfs: "False" [Create PDFs for classifier outputs (signal and background)]
: IgnoreNegWeightsInTraining: "False" [Events with negative weights are ignored in the training (but are included for testing and performance evaluation)]
: ValidationSize: "20%" [Part of the training data to use for validation. Specify as 0.2 or 20% to use a fifth of the data set as validation set. Specify as 100 to use exactly 100 events. (Default: 20%)]
DNN_CPU : [dataset] : Create Transformation "G" with events from all classes.
:
: Transformation, Variable selection :
: Input : variable 'var1' <---> Output : variable 'var1'
: Input : variable 'var2' <---> Output : variable 'var2'
: Preparing the Gaussian transformation...
TFHandler_DNN_CPU : Variable Mean RMS [ Min Max ]
: -----------------------------------------------------------
: var1: 0.012586 1.0260 [ -3.3377 5.7307 ]
: var2: 0.0043504 1.0383 [ -4.5564 5.7307 ]
: fvalue: 165.93 84.643 [ 2.0973 391.01 ]
: -----------------------------------------------------------
Parsed Training DNN string LearningRate=1e-2,Momentum=0.5,Repetitions=1,ConvergenceSteps=20,BatchSize=50,TestRepetitions=10,WeightDecay=0.01,Regularization=NONE,DropConfig=0.2+0.2+0.2+0.,DropRepetitions=2|LearningRate=1e-3,Momentum=0.9,Repetitions=1,ConvergenceSteps=20,BatchSize=50,TestRepetitions=5,WeightDecay=0.01,Regularization=L2,DropConfig=0.1+0.1+0.1,DropRepetitions=1|LearningRate=1e-4,Momentum=0.3,Repetitions=1,ConvergenceSteps=10,BatchSize=50,TestRepetitions=5,WeightDecay=0.01,Regularization=NONE
STring has size 3
Factory : Booking method: ␛[1mBDTG␛[0m
:
<WARNING> : Value for option maxdepth was previously set to 3
: the option NegWeightTreatment=InverseBoostNegWeights does not exist for BoostType=Grad
: --> change to new default NegWeightTreatment=Pray
Factory : ␛[1mTrain all methods␛[0m
Factory : [dataset] : Create Transformation "I" with events from all classes.
:
: Transformation, Variable selection :
: Input : variable 'var1' <---> Output : variable 'var1'
: Input : variable 'var2' <---> Output : variable 'var2'
TFHandler_Factory : Variable Mean RMS [ Min Max ]
: -----------------------------------------------------------
: var1: 3.3759 1.1674 [ 0.0058046 4.9975 ]
: var2: 2.4823 1.4587 [ 0.0032142 4.9971 ]
: fvalue: 165.93 84.643 [ 2.0973 391.01 ]
: -----------------------------------------------------------
: Ranking input variables (method unspecific)...
IdTransformation : Ranking result (top variable is best ranked)
: --------------------------------------------
: Rank : Variable : |Correlation with target|
: --------------------------------------------
: 1 : var2 : 7.636e-01
: 2 : var1 : 5.936e-01
: --------------------------------------------
IdTransformation : Ranking result (top variable is best ranked)
: -------------------------------------
: Rank : Variable : Mutual information
: -------------------------------------
: 1 : var2 : 2.315e+00
: 2 : var1 : 1.882e+00
: -------------------------------------
IdTransformation : Ranking result (top variable is best ranked)
: ------------------------------------
: Rank : Variable : Correlation Ratio
: ------------------------------------
: 1 : var1 : 6.545e+00
: 2 : var2 : 2.414e+00
: ------------------------------------
IdTransformation : Ranking result (top variable is best ranked)
: ----------------------------------------
: Rank : Variable : Correlation Ratio (T)
: ----------------------------------------
: 1 : var2 : 8.189e-01
: 2 : var1 : 3.128e-01
: ----------------------------------------
Factory : Train method: PDEFoam for Regression
:
: Build mono target regression foam
: Elapsed time: 0.613 sec
: Elapsed time for training with 1000 events: 0.62 sec
: Dataset[dataset] : Create results for training
: Dataset[dataset] : Evaluation of PDEFoam on training sample
: Dataset[dataset] : Elapsed time for evaluation of 1000 events: 0.00498 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
: Creating xml weight file: ␛[0;36mdataset/weights/TMVARegression_PDEFoam.weights.xml␛[0m
: writing foam MonoTargetRegressionFoam to file
: Foams written to file: ␛[0;36mdataset/weights/TMVARegression_PDEFoam.weights_foams.root␛[0m
Factory : Training finished
:
Factory : Train method: KNN for Regression
:
KNN : <Train> start...
: Reading 1000 events
: Number of signal events 1000
: Number of background events 0
: Creating kd-tree with 1000 events
: Computing scale factor for 1d distributions: (ifrac, bottom, top) = (80%, 10%, 90%)
ModulekNN : Optimizing tree for 2 variables with 1000 values
: <Fill> Class 1 has 1000 events
: Elapsed time for training with 1000 events: 0.00145 sec
: Dataset[dataset] : Create results for training
: Dataset[dataset] : Evaluation of KNN on training sample
: Dataset[dataset] : Elapsed time for evaluation of 1000 events: 0.00774 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
: Creating xml weight file: ␛[0;36mdataset/weights/TMVARegression_KNN.weights.xml␛[0m
Factory : Training finished
:
Factory : Train method: LD for Regression
:
LD : Results for LD coefficients:
: -----------------------
: Variable: Coefficient:
: -----------------------
: var1: +42.509
: var2: +44.738
: (offset): -88.627
: -----------------------
: Elapsed time for training with 1000 events: 0.000428 sec
: Dataset[dataset] : Create results for training
: Dataset[dataset] : Evaluation of LD on training sample
: Dataset[dataset] : Elapsed time for evaluation of 1000 events: 0.000565 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
: Creating xml weight file: ␛[0;36mdataset/weights/TMVARegression_LD.weights.xml␛[0m
Factory : Training finished
:
Factory : Train method: DNN_CPU for Regression
:
TFHandler_DNN_CPU : Variable Mean RMS [ Min Max ]
: -----------------------------------------------------------
: var1: 0.012586 1.0260 [ -3.3377 5.7307 ]
: var2: 0.0043504 1.0383 [ -4.5564 5.7307 ]
: fvalue: 165.93 84.643 [ 2.0973 391.01 ]
: -----------------------------------------------------------
: Start of neural network training on CPU.
:
: Training phase 1 of 3:
: Epoch | Train Err. Test Err. GFLOP/s Conv. Steps
: --------------------------------------------------------------
: 10 | 2276.45 1525.42 1.35355 0
: 20 | 1747.2 1148.31 1.53585 0
: 30 | 2026.9 1659.61 1.6737 10
: 40 | 2215.92 2161.5 1.64231 20
:
: Training phase 2 of 3:
: Epoch | Train Err. Test Err. GFLOP/s Conv. Steps
: --------------------------------------------------------------
: 5 | 6073.34 1091.13 1.69793 0
: 10 | 5512.75 548.658 1.68663 0
: 15 | 5388.05 531.67 1.68563 0
: 20 | 5230.15 577.346 1.68696 5
: 25 | 5205.15 807.857 1.60896 10
: 30 | 5369.71 854.955 1.70121 15
: 35 | 4966.73 531.648 1.69082 20
:
: Training phase 3 of 3:
: Epoch | Train Err. Test Err. GFLOP/s Conv. Steps
: --------------------------------------------------------------
: 5 | 505.233 516.859 1.80618 0
: 10 | 487.647 499.956 1.79966 0
: 15 | 477.124 493.141 1.76186 0
: 20 | 470.667 488.668 1.77482 0
: 25 | 463.09 475.14 1.73851 0
: 30 | 455.173 473.113 1.79697 0
: 35 | 451.458 471.668 1.77962 0
: 40 | 448.748 472.3 1.78203 5
: 45 | 445.022 470.938 1.78447 0
: 50 | 443.811 471.705 1.78438 5
: 55 | 441.592 471.275 1.77322 10
:
: Elapsed time for training with 1000 events: 2.05 sec
: Dataset[dataset] : Create results for training
: Dataset[dataset] : Evaluation of DNN_CPU on training sample
: Dataset[dataset] : Elapsed time for evaluation of 1000 events: 0.0205 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
: Creating xml weight file: ␛[0;36mdataset/weights/TMVARegression_DNN_CPU.weights.xml␛[0m
Factory : Training finished
:
Factory : Train method: BDTG for Regression
:
: Regression Loss Function: Huber
: Training 2000 Decision Trees ... patience please
: Elapsed time for training with 1000 events: 2.74 sec
: Dataset[dataset] : Create results for training
: Dataset[dataset] : Evaluation of BDTG on training sample
: Dataset[dataset] : Elapsed time for evaluation of 1000 events: 0.378 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
: Creating xml weight file: ␛[0;36mdataset/weights/TMVARegression_BDTG.weights.xml␛[0m
: TMVAReg.root:/dataset/Method_BDTG/BDTG
Factory : Training finished
:
Factory : === Destroy and recreate all methods via weight files for testing ===
:
: Reading weight file: ␛[0;36mdataset/weights/TMVARegression_PDEFoam.weights.xml␛[0m
: Read foams from file: ␛[0;36mdataset/weights/TMVARegression_PDEFoam.weights_foams.root␛[0m
: Reading weight file: ␛[0;36mdataset/weights/TMVARegression_KNN.weights.xml␛[0m
: Creating kd-tree with 1000 events
: Computing scale factor for 1d distributions: (ifrac, bottom, top) = (80%, 10%, 90%)
ModulekNN : Optimizing tree for 2 variables with 1000 values
: <Fill> Class 1 has 1000 events
: Reading weight file: ␛[0;36mdataset/weights/TMVARegression_LD.weights.xml␛[0m
: Reading weight file: ␛[0;36mdataset/weights/TMVARegression_DNN_CPU.weights.xml␛[0m
: Reading weight file: ␛[0;36mdataset/weights/TMVARegression_BDTG.weights.xml␛[0m
Factory : ␛[1mTest all methods␛[0m
Factory : Test method: PDEFoam for Regression performance
:
: Dataset[dataset] : Create results for testing
: Dataset[dataset] : Evaluation of PDEFoam on testing sample
: Dataset[dataset] : Elapsed time for evaluation of 9000 events: 0.0691 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
Factory : Test method: KNN for Regression performance
:
: Dataset[dataset] : Create results for testing
: Dataset[dataset] : Evaluation of KNN on testing sample
: Dataset[dataset] : Elapsed time for evaluation of 9000 events: 0.0922 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
Factory : Test method: LD for Regression performance
:
: Dataset[dataset] : Create results for testing
: Dataset[dataset] : Evaluation of LD on testing sample
: Dataset[dataset] : Elapsed time for evaluation of 9000 events: 0.00325 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
Factory : Test method: DNN_CPU for Regression performance
:
: Dataset[dataset] : Create results for testing
: Dataset[dataset] : Evaluation of DNN_CPU on testing sample
: Dataset[dataset] : Elapsed time for evaluation of 9000 events: 0.185 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
Factory : Test method: BDTG for Regression performance
:
: Dataset[dataset] : Create results for testing
: Dataset[dataset] : Evaluation of BDTG on testing sample
: Dataset[dataset] : Elapsed time for evaluation of 9000 events: 2.16 sec
: Create variable histograms
: Create regression target histograms
: Create regression average deviation
: Results created
Factory : ␛[1mEvaluate all methods␛[0m
: Evaluate regression method: PDEFoam
: TestRegression (testing)
: Calculate regression for all events
: Elapsed time for evaluation of 9000 events: 0.0467 sec
: TestRegression (training)
: Calculate regression for all events
: Elapsed time for evaluation of 1000 events: 0.00625 sec
TFHandler_PDEFoam : Variable Mean RMS [ Min Max ]
: -----------------------------------------------------------
: var1: 3.3352 1.1893 [ 0.00020069 5.0000 ]
: var2: 2.4860 1.4342 [ 0.00071490 5.0000 ]
: fvalue: 163.91 83.651 [ 1.6186 394.84 ]
: -----------------------------------------------------------
: Evaluate regression method: KNN
: TestRegression (testing)
: Calculate regression for all events
: Elapsed time for evaluation of 9000 events: 0.099 sec
: TestRegression (training)
: Calculate regression for all events
: Elapsed time for evaluation of 1000 events: 0.0104 sec
TFHandler_KNN : Variable Mean RMS [ Min Max ]
: -----------------------------------------------------------
: var1: 3.3352 1.1893 [ 0.00020069 5.0000 ]
: var2: 2.4860 1.4342 [ 0.00071490 5.0000 ]
: fvalue: 163.91 83.651 [ 1.6186 394.84 ]
: -----------------------------------------------------------
: Evaluate regression method: LD
: TestRegression (testing)
: Calculate regression for all events
: Elapsed time for evaluation of 9000 events: 0.00786 sec
: TestRegression (training)
: Calculate regression for all events
: Elapsed time for evaluation of 1000 events: 0.00147 sec
TFHandler_LD : Variable Mean RMS [ Min Max ]
: -----------------------------------------------------------
: var1: 3.3352 1.1893 [ 0.00020069 5.0000 ]
: var2: 2.4860 1.4342 [ 0.00071490 5.0000 ]
: fvalue: 163.91 83.651 [ 1.6186 394.84 ]
: -----------------------------------------------------------
: Evaluate regression method: DNN_CPU
: TestRegression (testing)
: Calculate regression for all events
: Elapsed time for evaluation of 9000 events: 0.18 sec
: TestRegression (training)
: Calculate regression for all events
: Elapsed time for evaluation of 1000 events: 0.0209 sec
TFHandler_DNN_CPU : Variable Mean RMS [ Min Max ]
: -----------------------------------------------------------
: var1: -0.027278 1.0264 [ -3.3694 5.7307 ]
: var2: 0.0056047 0.98632 [ -5.7307 5.7307 ]
: fvalue: 163.91 83.651 [ 1.6186 394.84 ]
: -----------------------------------------------------------
TFHandler_DNN_CPU : Variable Mean RMS [ Min Max ]
: -----------------------------------------------------------
: var1: -0.027278 1.0264 [ -3.3694 5.7307 ]
: var2: 0.0056047 0.98632 [ -5.7307 5.7307 ]
: fvalue: 163.91 83.651 [ 1.6186 394.84 ]
: -----------------------------------------------------------
: Evaluate regression method: BDTG
: TestRegression (testing)
: Calculate regression for all events
: Elapsed time for evaluation of 9000 events: 2.13 sec
: TestRegression (training)
: Calculate regression for all events
: Elapsed time for evaluation of 1000 events: 0.238 sec
TFHandler_BDTG : Variable Mean RMS [ Min Max ]
: -----------------------------------------------------------
: var1: 3.3352 1.1893 [ 0.00020069 5.0000 ]
: var2: 2.4860 1.4342 [ 0.00071490 5.0000 ]
: fvalue: 163.91 83.651 [ 1.6186 394.84 ]
: -----------------------------------------------------------
:
: Evaluation results ranked by smallest RMS on test sample:
: ("Bias" quotes the mean deviation of the regression from true target.
: "MutInf" is the "Mutual Information" between regression and target.
: Indicated by "_T" are the corresponding "truncated" quantities ob-
: tained when removing events deviating more than 2sigma from average.)
: --------------------------------------------------------------------------------------------------
: --------------------------------------------------------------------------------------------------
: dataset BDTG : 0.0707 0.102 2.45 1.95 | 3.100 3.175
: dataset KNN : -0.237 0.578 5.17 3.44 | 2.898 2.939
: dataset PDEFoam : 0.106 -0.0677 9.22 7.74 | 2.283 2.375
: dataset LD : 0.461 2.22 19.6 17.6 | 1.985 1.979
: dataset DNN_CPU : 1.24 1.53 21.7 19.7 | 1.617 1.653
: --------------------------------------------------------------------------------------------------
:
: Evaluation results ranked by smallest RMS on training sample:
: (overtraining check)
: --------------------------------------------------------------------------------------------------
: DataSet Name: MVA Method: <Bias> <Bias_T> RMS RMS_T | MutInf MutInf_T
: --------------------------------------------------------------------------------------------------
: dataset BDTG : 0.0597 0.0107 0.566 0.293 | 3.441 3.466
: dataset KNN : -0.425 0.423 5.19 3.54 | 3.006 3.034
: dataset PDEFoam : 8.35e-07 0.106 8.04 6.57 | 2.488 2.579
: dataset LD :-1.03e-06 1.54 20.1 18.5 | 2.134 2.153
: dataset DNN_CPU : 0.613 0.405 21.1 19.4 | 1.861 1.880
: --------------------------------------------------------------------------------------------------
:
Dataset:dataset : Created tree 'TestTree' with 9000 events
:
Dataset:dataset : Created tree 'TrainTree' with 1000 events
:
Factory : ␛[1mThank you for using TMVA!␛[0m
: ␛[1mFor citation information, please visit: http://tmva.sf.net/citeTMVA.html␛[0m
==> Wrote root file: TMVAReg.root
==> TMVARegression is done!