This macro provides an example of how to use TMVA for k-folds cross evaluation in application.
This requires that CrossValidation was run with a deterministic split, such as "...:splitExpr=int([eventID])%int([numFolds]):..."
.
- Project : TMVA - a ROOT-integrated toolkit for multivariate data analysis
- Package : TMVA
- Root Macro: TMVACrossValidationApplication
: Booking "BDTG" of type "CrossValidation" from datasetcv/weights/TMVACrossValidation_BDTG.weights.xml.
: Reading weight file: datasetcv/weights/TMVACrossValidation_BDTG.weights.xml
<HEADER> DataSetInfo : [Default] : Added class "Signal"
<HEADER> DataSetInfo : [Default] : Added class "Background"
: Reading weightfile: datasetcv/weights/TMVACrossValidation_BDTG_fold1.weights.xml
: Reading weight file: datasetcv/weights/TMVACrossValidation_BDTG_fold1.weights.xml
: Reading weightfile: datasetcv/weights/TMVACrossValidation_BDTG_fold2.weights.xml
: Reading weight file: datasetcv/weights/TMVACrossValidation_BDTG_fold2.weights.xml
: Booked classifier "BDTG" of type: "CrossValidation"
: Booking "Fisher" of type "CrossValidation" from datasetcv/weights/TMVACrossValidation_Fisher.weights.xml.
: Reading weight file: datasetcv/weights/TMVACrossValidation_Fisher.weights.xml
: Reading weightfile: datasetcv/weights/TMVACrossValidation_Fisher_fold1.weights.xml
: Reading weight file: datasetcv/weights/TMVACrossValidation_Fisher_fold1.weights.xml
: Reading weightfile: datasetcv/weights/TMVACrossValidation_Fisher_fold2.weights.xml
: Reading weight file: datasetcv/weights/TMVACrossValidation_Fisher_fold2.weights.xml
: Booked classifier "Fisher" of type: "CrossValidation"
: Rebuilding Dataset Default
(int) 0
#include <cstdlib>
#include <iostream>
#include <map>
#include <string>
{
tree->SetBranchAddress(
"x", &
x);
tree->SetBranchAddress(
"y", &
y);
tree->SetBranchAddress(
"eventID", &
eventID);
tree->Fill();
}
tree->ResetBranchAddresses();
return tree;
}
{
{
} else {
std::cout << "Weightfile for method " << methodName << " not found."
" Did you run TMVACrossValidation with a specified"
" splitExpr?" << std::endl;
}
}
{
} else {
std::cout << "Weightfile for method " << methodName << " not found."
" Did you run TMVACrossValidation with a specified"
" splitExpr?" << std::endl;
}
}
tree->Branch(
"x", &
x,
"x/F");
tree->Branch(
"y", &
y,
"y/F");
tree->SetBranchAddress(
"x", &
x);
tree->SetBranchAddress(
"y", &
y);
}
tree->ResetBranchAddresses();
}
else
{
}
return 0;
}
{
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
R__EXTERN TSystem * gSystem
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
1-D histogram with a float per channel (see TH1 documentation)
The Reader class serves to use the MVAs in a specific analysis context.
Random number generator class based on M.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
A TTree represents a columnar dataset.
- Author
- Kim Albertsson (adapted from code originally by Andreas Hoecker)
Definition in file TMVACrossValidationApplication.C.