This example explains how to use the cross-validation feature of TMVA.
It is validated the Fisher algorithm with a 5-fold cross-validation.
- Project : TMVA - a Root-integrated toolkit for multivariate data analysis
- Package : TMVA
- Exectuable: TMVACrossValidation
Processing /builddir/build/BUILD/root-6.10.00/tutorials/tmva/TMVACrossValidation.C...
DataSetInfo : [dataset] : Added class "Signal"
:
Add Tree TreeS of type Signal with 6000 events
DataSetInfo : [dataset] : Added class "Background"
:
Add Tree TreeB of type Background with 6000 events
: Dataset[dataset] :
Class index : 0 name : Signal
: Dataset[dataset] :
Class index : 1 name : Background
: Evaluate method: Fisher
: Evaluation done.
<HEADER> CrossValidation : ==== Results ====
: Fold 0 ROC-
Int : 0.9003
: Fold 1 ROC-
Int : 0.8958
: Fold 2 ROC-
Int : 0.8947
: Fold 3 ROC-
Int : 0.8914
: Fold 4 ROC-
Int : 0.8926
: ------------------------
: Average ROC-
Int : 0.8950
: Std-Dev ROC-
Int : 0.0034
void TMVACrossValidation()
{
TString fname =
"./tmva_class_example.root";
}
else {
input =
TFile::Open(
"http://root.cern.ch/files/tmva_class_example.root",
"CACHEREAD");
}
if (!input) {
std::cout << "ERROR: could not open data file" << std::endl;
exit(1);
}
cv.Evaluate();
}
{
TMVACrossValidation();
}
- Author
- Stefan Wunsch
Definition in file TMVACrossValidation.C.