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
0.0156800746918
4.76969313622
Processing /mnt/build/workspace/root-makedoc-v612/rootspi/rdoc/src/v6-12-00-patches/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.9036
: Fold 1 ROC-Int : 0.9088
: Fold 2 ROC-Int : 0.8942
: Fold 3 ROC-Int : 0.8802
: Fold 4 ROC-Int : 0.8858
: ------------------------
: Average ROC-Int : 0.8945
: Std-Dev ROC-Int : 0.0119
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();
auto results = cv.GetResults();
for (auto r : results)
}
{
TMVACrossValidation();
}
- Author
- Stefan Wunsch
Definition in file TMVACrossValidation.C.