65   : fVisHistsUseImp( 
kTRUE )
 
   80   , fVisHistsUseImp(
kTRUE)
 
   99   UInt_t neve = fTrainingEvents.size();
 
  102   fNEveEffTrain = CalcWeightSum( &fTrainingEvents );
 
  111   this->SetMethodBase(rfbase);
 
  112   fRuleEnsemble.Initialize( 
this );
 
  113   fRuleFitParams.SetRuleFit( 
this );
 
  125      UInt_t nevents = fMethodRuleFit->Data()->GetNTrainingEvents();
 
  126      std::vector<const TMVA::Event*> tmp;
 
  127      for (
Long64_t ievt=0; ievt<nevents; ievt++) {
 
  128         const Event *
event = fMethodRuleFit->GetEvent(ievt);
 
  129         tmp.push_back(
event);
 
  131      SetTrainingEvents( tmp );
 
  140   fRuleEnsemble.MakeModel();
 
  143   fRuleFitParams.Init();
 
  152   fMethodBase = rfbase;
 
  153   fMethodRuleFit = 
dynamic_cast<const MethodRuleFit *
>(rfbase);
 
  177   if (events==0) 
return 0.0;
 
  178   if (neve==0) neve=events->size();
 
  181   for (
UInt_t ie=0; ie<neve; ie++) {
 
  182      sumw += ((*events)[ie])->GetWeight();
 
  192   fLogger->SetMinType(t);
 
  193   fRuleEnsemble.SetMsgType(t);
 
  194   fRuleFitParams.SetMsgType(t);
 
  203   if (fMethodRuleFit==0) {
 
  204      Log() << kFATAL << 
"RuleFit::BuildTree() - Attempting to build a tree NOT from a MethodRuleFit" << 
Endl;
 
  206   std::vector<const Event *> evevec;
 
  207   for (
UInt_t ie=0; ie<fNTreeSample; ie++) {
 
  208      evevec.push_back(fTrainingEventsRndm[ie]);
 
  223   if (fMethodRuleFit==0) {
 
  224      Log() << kFATAL << 
"RuleFit::BuildTree() - Attempting to build a tree NOT from a MethodRuleFit" << 
Endl;
 
  226   Log() << kDEBUG << 
"Creating a forest with " << fMethodRuleFit->GetNTrees() << 
" decision trees" << 
Endl;
 
  227   Log() << kDEBUG << 
"Each tree is built using a random subsample with " << fNTreeSample << 
" events" << 
Endl;
 
  229   Timer timer( fMethodRuleFit->GetNTrees(), 
"RuleFit" );
 
  238   Bool_t useBoost = fMethodRuleFit->UseBoost(); 
 
  240   if (useBoost) SaveEventWeights();
 
  242   for (
Int_t i=0; i<fMethodRuleFit->GetNTrees(); i++) {
 
  244      if (!useBoost) ReshuffleEvents();
 
  249      const Int_t ntriesMax=10;
 
  252         frnd = 100*rndGen.
Uniform( fMethodRuleFit->GetMinFracNEve(), 0.5*fMethodRuleFit->GetMaxFracNEve() );
 
  254         Bool_t    useRandomisedTree = !useBoost;
 
  255         dt = 
new DecisionTree( fMethodRuleFit->GetSeparationBase(), frnd, fMethodRuleFit->GetNCuts(), &(fMethodRuleFit->DataInfo()), iclass, useRandomisedTree);
 
  256         dt->
SetNVars(fMethodBase->GetNvar());
 
  264         tryAgain = ((dt==0) && (ntries<ntriesMax));
 
  267         fForest.push_back(dt);
 
  268         if (useBoost) Boost(dt);
 
  272         Log() << kWARNING << 
"------------------------------------------------------------------" << 
Endl;
 
  273         Log() << kWARNING << 
" Failed growing a tree even after " << ntriesMax << 
" trials" << 
Endl;
 
  274         Log() << kWARNING << 
" Possible solutions: " << 
Endl;
 
  275         Log() << kWARNING << 
"   1. increase the number of training events" << 
Endl;
 
  276         Log() << kWARNING << 
"   2. set a lower min fraction cut (fEventsMin)" << 
Endl;
 
  277         Log() << kWARNING << 
"   3. maybe also decrease the max fraction cut (fEventsMax)" << 
Endl;
 
  278         Log() << kWARNING << 
" If the above warning occurs rarely only, it can be ignored" << 
Endl;
 
  279         Log() << kWARNING << 
"------------------------------------------------------------------" << 
Endl;
 
  282      Log() << kDEBUG << 
"Built tree with minimum cut at N = " << frnd <<
"% events" 
  283            << 
" => N(nodes) = " << fForest.back()->GetNNodes()
 
  284            << 
" ; n(tries) = " << ntries
 
  289   if (useBoost) RestoreEventWeights();
 
  300   fEventWeights.clear();
 
  301   for (std::vector<const Event*>::iterator 
e=fTrainingEvents.begin(); 
e!=fTrainingEvents.end(); ++
e) {
 
  303      fEventWeights.push_back(
w);
 
  313   if (fEventWeights.size() != fTrainingEvents.size()) {
 
  314      Log() << kERROR << 
"RuleFit::RestoreEventWeights() called without having called SaveEventWeights() before!" << 
Endl;
 
  317   for (std::vector<const Event*>::iterator 
e=fTrainingEvents.begin(); 
e!=fTrainingEvents.end(); ++
e) {
 
  318      (*e)->SetBoostWeight(fEventWeights[ie]);
 
  333   std::vector<Char_t> correctSelected; 
 
  335   for (std::vector<const Event*>::iterator 
e=fTrainingEvents.begin(); 
e!=fTrainingEvents.end(); ++
e) {
 
  340      if (isSignalType == fMethodBase->DataInfo().IsSignal(*
e)) { 
 
  341         correctSelected.push_back(
kTRUE);
 
  345         correctSelected.push_back(
kFALSE);
 
  353   Double_t boostWeight = (err>0 ? (1.0-err)/err : 1000.0);
 
  357   for (std::vector<const Event*>::iterator 
e=fTrainingEvents.begin(); 
e!=fTrainingEvents.end(); ++
e) {
 
  358      if (!correctSelected[ie])
 
  359         (*e)->SetBoostWeight( (*e)->GetBoostWeight() * boostWeight);
 
  360      newSumw+=(*e)->GetWeight();
 
  365   for (std::vector<const Event*>::iterator 
e=fTrainingEvents.begin(); 
e!=fTrainingEvents.end(); ++
e) {
 
  366      (*e)->SetBoostWeight( (*e)->GetBoostWeight() * scale);
 
  368   Log() << kDEBUG << 
"boostWeight = " << boostWeight << 
"    scale = " << scale << 
Endl;
 
  377   UInt_t ntrees = fForest.size();
 
  378   if (ntrees==0) 
return;
 
  383   for (
UInt_t i=0; i<ntrees; i++) {
 
  390   Log() << kVERBOSE << 
"Nodes in trees: average & std dev = " << sumn/ntrees << 
" , " << sig << 
Endl;
 
  400   Log() << kVERBOSE << 
"Fitting rule/linear terms" << 
Endl;
 
  401   fRuleFitParams.MakeGDPath();
 
  409   Log() << kVERBOSE << 
"Calculating importance" << 
Endl;
 
  410   fRuleEnsemble.CalcImportance();
 
  411   fRuleEnsemble.CleanupRules();
 
  412   fRuleEnsemble.CleanupLinear();
 
  413   fRuleEnsemble.CalcVarImportance();
 
  414   Log() << kVERBOSE << 
"Filling rule statistics" << 
Endl;
 
  415   fRuleEnsemble.RuleResponseStats();
 
  423   return fRuleEnsemble.EvalEvent( 
e );
 
  431   if (fMethodRuleFit==0) Log() << kFATAL << 
"RuleFit::SetTrainingEvents - MethodRuleFit not initialized" << 
Endl;
 
  433   if (neve==0) Log() << kWARNING << 
"An empty sample of training events was given" << 
Endl;
 
  436   fTrainingEvents.clear();
 
  437   fTrainingEventsRndm.clear();
 
  438   for (
UInt_t i=0; i<neve; i++) {
 
  439      fTrainingEvents.push_back(
static_cast< const Event *
>(el[i]));
 
  440      fTrainingEventsRndm.push_back(
static_cast< const Event *
>(el[i]));
 
  444   std::shuffle(fTrainingEventsRndm.begin(), fTrainingEventsRndm.end(), fRNGEngine);
 
  447   fNTreeSample = 
static_cast<UInt_t>(neve*fMethodRuleFit->GetTreeEveFrac());
 
  448   Log() << kDEBUG << 
"Number of events per tree : " << fNTreeSample
 
  449         << 
" ( N(events) = " << neve << 
" )" 
  450         << 
" randomly drawn without replacement" << 
Endl;
 
  459   if ((nevents<fTrainingEventsRndm.size()) && (nevents>0)) {
 
  460      evevec.resize(nevents);
 
  461      for (
UInt_t ie=0; ie<nevents; ie++) {
 
  462         evevec[ie] = fTrainingEventsRndm[ie];
 
  466      Log() << kWARNING << 
"GetRndmSampleEvents() : requested sub sample size larger than total size (BUG!).";
 
  477   if (hlist.empty()) 
return;
 
  484   for (
UInt_t i=0; i<hlist.size(); i++) {
 
  511   for (
UInt_t i=0; i<hlist.size(); i++) {
 
  530   if (!ruleHasVar) 
return;
 
  533   if(firstbin<0) firstbin=0;
 
  541   Double_t fbfrac = (dormin ? ((fbmin+xbinw-rmin)/xbinw):1.0);
 
  542   Double_t lbfrac = (dormax ? ((rmax-lbmax+xbinw)/xbinw):1.0);
 
  547   for (
Int_t bin = binmin; bin<binmax+1; bin++) {
 
  548      fbin = bin-firstbin+1;
 
  552      else if (bin==binmax) {
 
  560      if (fVisHistsUseImp) {
 
  566      h2->
Fill(xc,0.5,val*
f);
 
  576   if (!fRuleEnsemble.DoLinear()) 
return;
 
  582   if (fVisHistsUseImp) {
 
  583      val = fRuleEnsemble.GetLinImportance(vind);
 
  586      val = fRuleEnsemble.GetLinCoefficients(vind);
 
  588   for (
Int_t bin = firstbin; bin<lastbin+1; bin++) {
 
  590      h2->
Fill(xc,0.5,val);
 
  602   if (fVisHistsUseImp) {
 
  609   Double_t rxmin,   rxmax,   rymin,   rymax;
 
  610   Bool_t   dorxmin, dorxmax, dorymin, dorymax;
 
  616   if (!(ruleHasVarX || ruleHasVarY)) 
return;
 
  635   Double_t fxbinmin = (dorxmin ? ((xbinmin+xbinw-vxmin)/xbinw):1.0);
 
  636   Double_t fxbinmax = (dorxmax ? ((vxmax-xbinmax+xbinw)/xbinw):1.0);
 
  637   Double_t fybinmin = (dorymin ? ((ybinmin+ybinw-vymin)/ybinw):1.0);
 
  638   Double_t fybinmax = (dorymax ? ((vymax-ybinmax+ybinw)/ybinw):1.0);
 
  643   for (
Int_t binx = binxmin; binx<binxmax+1; binx++) {
 
  647      else if (binx==binxmax) {
 
  654      for (
Int_t biny = binymin; biny<binymax+1; biny++) {
 
  658         else if (biny==binymax) {
 
  665         h2->
Fill(xc,yc,val*fx*fy);
 
  675   Int_t nhists = hlist.size();
 
  676   Int_t nvar   = fMethodBase->GetNvar();
 
  677   if (nhists!=nvar) Log() << kFATAL << 
"BUG TRAP: number of hists is not equal the number of variables!" << 
Endl;
 
  679   std::vector<Int_t> vindex;
 
  682   for (
Int_t ih=0; ih<nhists; ih++) {
 
  683      hstr = hlist[ih]->GetTitle();
 
  684      for (
Int_t iv=0; iv<nvar; iv++) {
 
  685         if (fMethodBase->GetInputTitle(iv) == hstr)
 
  686            vindex.push_back(iv);
 
  690   for (
Int_t iv=0; iv<nvar; iv++) {
 
  693            FillCut(hlist[iv],rule,vindex[iv]);
 
  697         FillLin(hlist[iv],vindex[iv]);
 
  708   if (!(ruleimp>0)) 
return;
 
  709   if (ruleimp<fRuleEnsemble.GetImportanceCut()) 
return;
 
  711   Int_t nhists = hlist.size();
 
  712   Int_t nvar   = fMethodBase->GetNvar();
 
  713   Int_t ncorr  = (nvar*(nvar+1)/2)-nvar;
 
  714   if (nhists!=ncorr) Log() << kERROR << 
"BUG TRAP: number of corr hists is not correct! ncorr = " 
  715                            << ncorr << 
" nvar = " << nvar << 
" nhists = " << nhists << 
Endl;
 
  717   std::vector< std::pair<Int_t,Int_t> > vindex;
 
  721   for (
Int_t ih=0; ih<nhists; ih++) {
 
  722      hstr = hlist[ih]->GetName();
 
  723      if (GetCorrVars( hstr, var1, var2 )) {
 
  724         iv1 = fMethodBase->DataInfo().FindVarIndex( var1 );
 
  725         iv2 = fMethodBase->DataInfo().FindVarIndex( var2 );
 
  726         vindex.push_back( std::pair<Int_t,Int_t>(iv2,iv1) ); 
 
  729         Log() << kERROR << 
"BUG TRAP: should not be here - failed getting var1 and var2" << 
Endl;
 
  733   for (
Int_t ih=0; ih<nhists; ih++) {
 
  736         FillCorr(hlist[ih],rule,vindex[ih].
first,vindex[ih].second);
 
  754      var1 = titleCopy(0,splitPos);
 
  755      var2 = titleCopy(splitPos+4, titleCopy.
Length());
 
  768   const TString directories[5] = { 
"InputVariables_Id",
 
  769                                    "InputVariables_Deco",
 
  770                                    "InputVariables_PCA",
 
  771                                    "InputVariables_Gauss",
 
  772                                    "InputVariables_Gauss_Deco" };
 
  774   const TString corrDirName = 
"CorrelationPlots";
 
  780   TDirectory* methodDir = fMethodBase->BaseDir();
 
  786      Log() << kWARNING << 
"No basedir - BUG??" << 
Endl;
 
  792      done = ((varDir!=0) || (
type>4));
 
  795      Log() << kWARNING << 
"No input variable directory found - BUG?" << 
Endl;
 
  800      Log() << kWARNING << 
"No correlation directory found" << 
Endl;
 
  801      Log() << kWARNING << 
"Check for other warnings related to correlation histograms" << 
Endl;
 
  805      Log() << kWARNING << 
"No rulefit method directory found - BUG?" << 
Endl;
 
  809   varDirName = varDir->
GetName();
 
  815      Log() << kWARNING << 
"No correlation directory found : " << corrDirName << 
Endl;
 
  821   Log() << kDEBUG << 
"Got number of plots = " << noPlots << 
Endl;
 
  824   std::vector<TH2F *> h1Vector;
 
  825   std::vector<TH2F *> h2CorrVector;
 
  828   while ((key = (
TKey*)next())) {
 
  834      Log() << kDEBUG << 
"Got histogram : " << hname << 
Endl;
 
  848         h1Vector.push_back( newhist );
 
  855   while ((key = (
TKey*)nextCorr())) {
 
  864         Log() << kDEBUG << 
"Got histogram (2D) : " << hname << 
Endl;
 
  872         TH2F *newhist = 
new TH2F(newname,htitle,
 
  875         if (GetCorrVars( newname, var1, var2 )) {
 
  876            Int_t iv1 = fMethodBase->DataInfo().FindVarIndex(var1);
 
  877            Int_t iv2 = fMethodBase->DataInfo().FindVarIndex(var2);
 
  892         h2CorrVector.push_back( newhist );
 
  898   UInt_t nrules = fRuleEnsemble.GetNRules();
 
  900   for (
UInt_t i=0; i<nrules; i++) {
 
  901      rule = fRuleEnsemble.GetRulesConst(i);
 
  902      FillVisHistCut(rule, h1Vector);
 
  905   FillVisHistCut(0, h1Vector);
 
  906   NormVisHists(h1Vector);
 
  911   for (
UInt_t i=0; i<nrules; i++) {
 
  912      rule = fRuleEnsemble.GetRulesConst(i);
 
  913      FillVisHistCorr(rule, h2CorrVector);
 
  915   NormVisHists(h2CorrVector);
 
  919   for (
UInt_t i=0; i<h1Vector.size();     i++) h1Vector[i]->Write();
 
  920   for (
UInt_t i=0; i<h2CorrVector.size(); i++) h2CorrVector[i]->Write();
 
  928   TDirectory* methodDir = fMethodBase->BaseDir();
 
  930      Log() << kWARNING << 
"<MakeDebugHists> No rulefit method directory found - bug?" << 
Endl;
 
  935   std::vector<Double_t> distances;
 
  936   std::vector<Double_t> fncuts;
 
  937   std::vector<Double_t> fnvars;
 
  942   UInt_t nrules = fRuleEnsemble.GetNRules();
 
  943   for (
UInt_t i=0; i<nrules; i++) {
 
  944      ruleA = fRuleEnsemble.GetRulesConst(i);
 
  945      for (
UInt_t j=i+1; j<nrules; j++) {
 
  946         ruleB = fRuleEnsemble.GetRulesConst(j);
 
  951            distances.push_back(dAB);
 
  952            fncuts.push_back(
static_cast<Double_t>(nc));
 
  953            fnvars.push_back(
static_cast<Double_t>(nv));
 
  954            if (dAB<dABmin) dABmin=dAB;
 
  955            if (dAB>dABmax) dABmax=dAB;
 
  960   TH1F *histDist = 
new TH1F(
"RuleDist",
"Rule distances",100,dABmin,dABmax);
 
  961   TTree *distNtuple = 
new TTree(
"RuleDistNtuple",
"RuleDist ntuple");
 
  965   distNtuple->
Branch(
"dist", &ntDist,  
"dist/D");
 
  966   distNtuple->
Branch(
"ncuts",&ntNcuts, 
"ncuts/D");
 
  967   distNtuple->
Branch(
"nvars",&ntNvars, 
"nvars/D");
 
  969   for (
UInt_t i=0; i<distances.size(); i++) {
 
  970      histDist->
Fill(distances[i]);
 
  971      ntDist  = distances[i];
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
 
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 Atom_t Time_t type
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
 
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
 
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
 
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
 
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
 
TClass instances represent classes, structs and namespaces in the ROOT type system.
 
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
 
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
 
Describe directory structure in memory.
 
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
 
virtual TFile * GetFile() const
 
virtual Bool_t cd()
Change current directory to "this" directory.
 
virtual TList * GetListOfKeys() const
 
1-D histogram with a float per channel (see TH1 documentation)}
 
virtual Int_t GetNbinsY() const
 
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
 
virtual Int_t GetNbinsX() const
 
virtual void SetMaximum(Double_t maximum=-1111)
 
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
 
virtual void SetMinimum(Double_t minimum=-1111)
 
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
 
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
 
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
 
2-D histogram with a float per channel (see TH1 documentation)}
 
Int_t GetBin(Int_t binx, Int_t biny, Int_t binz=0) const override
Return Global bin number corresponding to binx,y,z.
 
Int_t Fill(Double_t) override
Invalid Fill method.
 
Book space in a file, create I/O buffers, to fill them, (un)compress them.
 
virtual const char * GetClassName() const
 
virtual TObject * ReadObj()
To read a TObject* from the file.
 
Implementation of a Decision Tree.
 
UInt_t BuildTree(const EventConstList &eventSample, DecisionTreeNode *node=nullptr)
building the decision tree by recursively calling the splitting of one (root-) node into two daughter...
 
void SetPruneMethod(EPruneMethod m=kCostComplexityPruning)
 
void SetPruneStrength(Double_t p)
 
Double_t CheckEvent(const TMVA::Event *, Bool_t UseYesNoLeaf=kFALSE) const
the event e is put into the decision tree (starting at the root node) and the output is NodeType (sig...
 
Double_t PruneTree(const EventConstList *validationSample=nullptr)
prune (get rid of internal nodes) the Decision tree to avoid overtraining several different pruning m...
 
Virtual base Class for all MVA method.
 
J Friedman's RuleFit method.
 
ostringstream derivative to redirect and format output
 
Bool_t GetCutRange(Int_t sel, Double_t &rmin, Double_t &rmax, Bool_t &dormin, Bool_t &dormax) const
get cut range for a given selector
 
A class implementing various fits of rule ensembles.
 
void GetRndmSampleEvents(std::vector< const TMVA::Event * > &evevec, UInt_t nevents)
draw a random subsample of the training events without replacement
 
Double_t EvalEvent(const Event &e)
evaluate single event
 
void SetMethodBase(const MethodBase *rfbase)
set MethodBase
 
void InitPtrs(const TMVA::MethodBase *rfbase)
initialize pointers
 
void Boost(TMVA::DecisionTree *dt)
Boost the events.
 
void ForestStatistics()
summary of statistics of all trees
 
static const Int_t randSEED
 
void CalcImportance()
calculates the importance of each rule
 
void SetMsgType(EMsgType t)
set the current message type to that of mlog for this class and all other subtools
 
void Initialize(const TMVA::MethodBase *rfbase)
initialize the parameters of the RuleFit method and make rules
 
virtual ~RuleFit(void)
destructor
 
void FillVisHistCorr(const Rule *rule, std::vector< TH2F * > &hlist)
help routine to MakeVisHists() - fills for all correlation plots
 
std::default_random_engine fRNGEngine
 
void InitNEveEff()
init effective number of events (using event weights)
 
void SaveEventWeights()
save event weights - must be done before making the forest
 
void FillCut(TH2F *h2, const TMVA::Rule *rule, Int_t vind)
Fill cut.
 
void FillLin(TH2F *h2, Int_t vind)
fill lin
 
Bool_t GetCorrVars(TString &title, TString &var1, TString &var2)
get first and second variables from title
 
void MakeForest()
make a forest of decisiontrees
 
const std::vector< const TMVA::DecisionTree * > & GetForest() const
 
void FitCoefficients()
Fit the coefficients for the rule ensemble.
 
const MethodBase * GetMethodBase() const
 
void FillCorr(TH2F *h2, const TMVA::Rule *rule, Int_t v1, Int_t v2)
fill rule correlation between vx and vy, weighted with either the importance or the coefficient
 
void NormVisHists(std::vector< TH2F * > &hlist)
normalize rule importance hists
 
void RestoreEventWeights()
save event weights - must be done before making the forest
 
void MakeVisHists()
this will create histograms visualizing the rule ensemble
 
void FillVisHistCut(const Rule *rule, std::vector< TH2F * > &hlist)
help routine to MakeVisHists() - fills for all variables
 
void BuildTree(TMVA::DecisionTree *dt)
build the decision tree using fNTreeSample events from fTrainingEventsRndm
 
const std::vector< const TMVA::Event * > & GetTrainingEvents() const
 
const MethodRuleFit * GetMethodRuleFit() const
 
void SetTrainingEvents(const std::vector< const TMVA::Event * > &el)
set the training events randomly
 
void Copy(const RuleFit &other)
copy method
 
const RuleEnsemble & GetRuleEnsemble() const
 
Double_t CalcWeightSum(const std::vector< const TMVA::Event * > *events, UInt_t neve=0)
calculate the sum of weights
 
RuleFit(void)
default constructor
 
void MakeDebugHists()
this will create a histograms intended rather for debugging or for the curious user
 
Implementation of a rule.
 
Double_t GetSupport() const
 
UInt_t GetNumVarsUsed() const
 
const RuleCut * GetRuleCut() const
 
Double_t GetCoefficient() const
 
Double_t GetImportance() const
 
Double_t RuleDist(const Rule &other, Bool_t useCutValue) const
Returns:
 
Bool_t ContainsVariable(UInt_t iv) const
check if variable in node
 
Timing information for training and evaluation of MVA methods.
 
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
 
const char * GetName() const override
Returns name of object.
 
const char * GetTitle() const override
Returns title of object.
 
Random number generator class based on M.
 
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
 
TString & ReplaceAll(const TString &s1, const TString &s2)
 
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
 
TString & Remove(Ssiz_t pos)
 
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
 
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
 
A TTree represents a columnar dataset.
 
virtual Int_t Fill()
Fill all branches.
 
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
 
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
 
MsgLogger & Endl(MsgLogger &ml)
 
Double_t Sqrt(Double_t x)
Returns the square root of x.
 
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.