113 fMonitorNtuple =
NULL;
169 for (
UInt_t i=0; i<fEventSample.size(); i++)
delete fEventSample[i];
170 for (
UInt_t i=0; i<fForest.size(); i++)
delete fForest[i];
229 DeclareOptionRef(fGDTau=-1,
"GDTau",
"Gradient-directed (GD) path: default fit cut-off");
230 DeclareOptionRef(fGDTauPrec=0.01,
"GDTauPrec",
"GD path: precision of tau");
231 DeclareOptionRef(fGDPathStep=0.01,
"GDStep",
"GD path: step size");
232 DeclareOptionRef(fGDNPathSteps=10000,
"GDNSteps",
"GD path: number of steps");
233 DeclareOptionRef(fGDErrScale=1.1,
"GDErrScale",
"Stop scan when error > scale*errmin");
234 DeclareOptionRef(fLinQuantile,
"LinQuantile",
"Quantile of linear terms (removes outliers)");
235 DeclareOptionRef(fGDPathEveFrac=0.5,
"GDPathEveFrac",
"Fraction of events used for the path search");
236 DeclareOptionRef(fGDValidEveFrac=0.5,
"GDValidEveFrac",
"Fraction of events used for the validation");
238 DeclareOptionRef(fMinFracNEve=0.1,
"fEventsMin",
"Minimum fraction of events in a splittable node");
239 DeclareOptionRef(fMaxFracNEve=0.9,
"fEventsMax",
"Maximum fraction of events in a splittable node");
240 DeclareOptionRef(fNTrees=20,
"nTrees",
"Number of trees in forest.");
242 DeclareOptionRef(fForestTypeS=
"AdaBoost",
"ForestType",
"Method to use for forest generation (AdaBoost or RandomForest)");
243 AddPreDefVal(
TString(
"AdaBoost"));
244 AddPreDefVal(
TString(
"Random"));
246 DeclareOptionRef(fRuleMinDist=0.001,
"RuleMinDist",
"Minimum distance between rules");
247 DeclareOptionRef(fMinimp=0.01,
"MinImp",
"Minimum rule importance accepted");
249 DeclareOptionRef(fModelTypeS=
"ModRuleLinear",
"Model",
"Model to be used");
250 AddPreDefVal(
TString(
"ModRule"));
251 AddPreDefVal(
TString(
"ModRuleLinear"));
252 AddPreDefVal(
TString(
"ModLinear"));
253 DeclareOptionRef(fRuleFitModuleS=
"RFTMVA",
"RuleFitModule",
"Which RuleFit module to use");
254 AddPreDefVal(
TString(
"RFTMVA"));
255 AddPreDefVal(
TString(
"RFFriedman"));
257 DeclareOptionRef(fRFWorkDir=
"./rulefit",
"RFWorkDir",
"Friedman\'s RuleFit module (RFF): working dir");
258 DeclareOptionRef(fRFNrules=2000,
"RFNrules",
"RFF: Mximum number of rules");
259 DeclareOptionRef(fRFNendnodes=4,
"RFNendnodes",
"RFF: Average number of end nodes");
267 if (IgnoreEventsWithNegWeightsInTraining()) {
268 Log() << kFATAL <<
"Mechanism to ignore events with negative weights in training not yet available for method: "
269 << GetMethodTypeName()
270 <<
" --> please remove \"IgnoreNegWeightsInTraining\" option from booking string."
274 fRuleFitModuleS.ToLower();
275 if (fRuleFitModuleS ==
"rftmva") fUseRuleFitJF =
kFALSE;
276 else if (fRuleFitModuleS ==
"rffriedman") fUseRuleFitJF =
kTRUE;
277 else fUseRuleFitJF =
kTRUE;
281 else if (fSepTypeS ==
"giniindex") fSepType =
new GiniIndex();
282 else if (fSepTypeS ==
"crossentropy") fSepType =
new CrossEntropy();
285 fModelTypeS.ToLower();
286 if (fModelTypeS ==
"modlinear" ) fRuleFit.SetModelLinear();
287 else if (fModelTypeS ==
"modrule" ) fRuleFit.SetModelRules();
288 else fRuleFit.SetModelFull();
290 fPruneMethodS.ToLower();
295 fForestTypeS.ToLower();
296 if (fForestTypeS ==
"random" ) fUseBoost =
kFALSE;
297 else if (fForestTypeS ==
"adaboost" ) fUseBoost =
kTRUE;
298 else fUseBoost =
kTRUE;
303 if (fUseBoost && (!fUseRuleFitJF)) fTreeEveFrac = 1.0;
307 if (fTreeEveFrac<=0) {
310 fTreeEveFrac = min( 0.5, (100.0 +6.0*sqrt(
n))/
n);
313 VerifyRange(Log(),
"nTrees", fNTrees,0,100000,20);
314 VerifyRange(Log(),
"MinImp", fMinimp,0.0,1.0,0.0);
315 VerifyRange(Log(),
"GDTauPrec", fGDTauPrec,1
e-5,5
e-1);
316 VerifyRange(Log(),
"GDTauMin", fGDTauMin,0.0,1.0);
317 VerifyRange(Log(),
"GDTauMax", fGDTauMax,fGDTauMin,1.0);
318 VerifyRange(Log(),
"GDPathStep", fGDPathStep,0.0,100.0,0.01);
319 VerifyRange(Log(),
"GDErrScale", fGDErrScale,1.0,100.0,1.1);
320 VerifyRange(Log(),
"GDPathEveFrac", fGDPathEveFrac,0.01,0.9,0.5);
321 VerifyRange(Log(),
"GDValidEveFrac",fGDValidEveFrac,0.01,1.0-fGDPathEveFrac,1.0-fGDPathEveFrac);
322 VerifyRange(Log(),
"fEventsMin", fMinFracNEve,0.0,1.0);
323 VerifyRange(Log(),
"fEventsMax", fMaxFracNEve,fMinFracNEve,1.0);
325 fRuleFit.GetRuleEnsemblePtr()->SetLinQuantile(fLinQuantile);
326 fRuleFit.GetRuleFitParamsPtr()->SetGDTauRange(fGDTauMin,fGDTauMax);
327 fRuleFit.GetRuleFitParamsPtr()->SetGDTau(fGDTau);
328 fRuleFit.GetRuleFitParamsPtr()->SetGDTauPrec(fGDTauPrec);
329 fRuleFit.GetRuleFitParamsPtr()->SetGDTauScan(fGDTauScan);
330 fRuleFit.GetRuleFitParamsPtr()->SetGDPathStep(fGDPathStep);
331 fRuleFit.GetRuleFitParamsPtr()->SetGDNPathSteps(fGDNPathSteps);
332 fRuleFit.GetRuleFitParamsPtr()->SetGDErrScale(fGDErrScale);
333 fRuleFit.SetImportanceCut(fMinimp);
334 fRuleFit.SetRuleMinDist(fRuleMinDist);
340 Log() << kINFO <<
"" <<
Endl;
341 Log() << kINFO <<
"--------------------------------------" <<
Endl;
342 Log() << kINFO <<
"Friedmans RuleFit module is selected." <<
Endl;
343 Log() << kINFO <<
"Only the following options are used:" <<
Endl;
344 Log() << kINFO <<
Endl;
352 Log() << kINFO <<
"--------------------------------------" <<
Endl;
353 Log() << kINFO <<
Endl;
363 fRuleFit.UseImportanceVisHists();
365 fRuleFit.SetMsgType( Log().GetMinType() );
367 if (HasTrainingTree()) InitEventSample();
377 fMonitorNtuple=
new TTree(
"MonitorNtuple_RuleFit",
"RuleFit variables");
378 fMonitorNtuple->Branch(
"importance",&fNTImportance,
"importance/D");
379 fMonitorNtuple->Branch(
"support",&fNTSupport,
"support/D");
380 fMonitorNtuple->Branch(
"coefficient",&fNTCoefficient,
"coefficient/D");
381 fMonitorNtuple->Branch(
"ncuts",&fNTNcuts,
"ncuts/I");
382 fMonitorNtuple->Branch(
"nvars",&fNTNvars,
"nvars/I");
383 fMonitorNtuple->Branch(
"type",&fNTType,
"type/I");
384 fMonitorNtuple->Branch(
"ptag",&fNTPtag,
"ptag/D");
385 fMonitorNtuple->Branch(
"pss",&fNTPss,
"pss/D");
386 fMonitorNtuple->Branch(
"psb",&fNTPsb,
"psb/D");
387 fMonitorNtuple->Branch(
"pbs",&fNTPbs,
"pbs/D");
388 fMonitorNtuple->Branch(
"pbb",&fNTPbb,
"pbb/D");
389 fMonitorNtuple->Branch(
"soversb",&fNTSSB,
"soversb/D");
398 SetSignalReferenceCut( 0.0 );
402 fLinQuantile = 0.025;
405 fSepTypeS =
"GiniIndex";
406 fPruneMethodS =
"NONE";
407 fPruneStrength = 3.5;
422 if (Data()->GetNEvents()==0) Log() << kFATAL <<
"<Init> Data().TrainingTree() is zero pointer" <<
Endl;
427 fEventSample.push_back(
new Event(*
ev));
429 if (fTreeEveFrac<=0) {
431 fTreeEveFrac = min( 0.5, (100.0 +6.0*sqrt(
n))/
n);
433 if (fTreeEveFrac>1.0) fTreeEveFrac=1.0;
435 std::shuffle(fEventSample.begin(), fEventSample.end(), std::default_random_engine{});
437 Log() << kDEBUG <<
"Set sub-sample fraction to " << fTreeEveFrac <<
Endl;
447 if(!IsSilentFile()) InitMonitorNtuple();
450 this->InitEventSample();
458 fRuleFit.GetRuleEnsemblePtr()->ClearRuleMap();
467 if (IsNormalised()) Log() << kFATAL <<
"\"Normalise\" option cannot be used with RuleFit; "
468 <<
"please remove the option from the configuration string, or "
469 <<
"use \"!Normalise\""
485 fRuleFit.Initialize(
this );
491 Log() << kDEBUG <<
"Fitting rule coefficients ..." <<
Endl;
492 fRuleFit.FitCoefficients();
495 Log() << kDEBUG <<
"Computing rule and variable importance" <<
Endl;
496 fRuleFit.CalcImportance();
499 fRuleFit.GetRuleEnsemblePtr()->
Print();
503 Log() << kDEBUG <<
"Filling rule ntuple" <<
Endl;
504 UInt_t nrules = fRuleFit.GetRuleEnsemble().GetRulesConst().size();
507 rule = fRuleFit.GetRuleEnsemble().GetRulesConst(i);
508 fNTImportance =
rule->GetRelImportance();
509 fNTSupport =
rule->GetSupport();
510 fNTCoefficient =
rule->GetCoefficient();
511 fNTType = (
rule->IsSignalRule() ? 1:-1 );
512 fNTNvars =
rule->GetRuleCut()->GetNvars();
513 fNTNcuts =
rule->GetRuleCut()->GetNcuts();
514 fNTPtag = fRuleFit.GetRuleEnsemble().GetRulePTag(i);
515 fNTPss = fRuleFit.GetRuleEnsemble().GetRulePSS(i);
516 fNTPsb = fRuleFit.GetRuleEnsemble().GetRulePSB(i);
517 fNTPbs = fRuleFit.GetRuleEnsemble().GetRulePBS(i);
518 fNTPbb = fRuleFit.GetRuleEnsemble().GetRulePBB(i);
519 fNTSSB =
rule->GetSSB();
520 fMonitorNtuple->Fill();
523 fRuleFit.MakeVisHists();
524 fRuleFit.MakeDebugHists();
526 Log() << kDEBUG <<
"Training done" <<
Endl;
535 fRuleFit.InitPtrs(
this );
538 std::vector<const TMVA::Event*>
tmp;
541 tmp.push_back(event);
543 fRuleFit.SetTrainingEvents(
tmp );
547 rfAPI->WelcomeMessage();
552 Log() << kINFO <<
"Training ..." <<
Endl;
553 rfAPI->TrainRuleFit();
555 Log() << kDEBUG <<
"reading model summary from rf_go.exe output" <<
Endl;
556 rfAPI->ReadModelSum();
560 Log() << kDEBUG <<
"calculating rule and variable importance" <<
Endl;
561 fRuleFit.CalcImportance();
564 fRuleFit.GetRuleEnsemblePtr()->
Print();
566 if(!IsSilentFile())fRuleFit.MakeVisHists();
570 Log() << kDEBUG <<
"done training" <<
Endl;
579 fRanking =
new Ranking( GetName(),
"Importance" );
582 fRanking->AddRank(
Rank( GetInputLabel(
ivar), fRuleFit.GetRuleEnsemble().GetVarImportance(
ivar) ) );
593 fRuleFit.GetRuleEnsemble().AddXMLTo( parent );
601 fRuleFit.GetRuleEnsemblePtr()->ReadRaw(
istr );
609 fRuleFit.GetRuleEnsemblePtr()->ReadFromXML(
wghtnode );
620 return fRuleFit.EvalEvent( *GetEvent() );
629 Log() << kINFO <<
"Write monitoring ntuple to file: " << BaseDir()->GetPath() <<
Endl;
630 fMonitorNtuple->
Write();
639 fout <<
" // not implemented for class: \"" << className <<
"\"" << std::endl;
640 fout <<
"};" << std::endl;
641 fout <<
"void " << className <<
"::Initialize(){}" << std::endl;
642 fout <<
"void " << className <<
"::Clear(){}" << std::endl;
643 fout <<
"double " << className <<
"::GetMvaValue__( const std::vector<double>& inputValues ) const {" << std::endl;
644 fout <<
" double rval=" << std::setprecision(10) << fRuleFit.GetRuleEnsemble().GetOffset() <<
";" << std::endl;
645 MakeClassRuleCuts(
fout);
646 MakeClassLinear(
fout);
647 fout <<
" return rval;" << std::endl;
648 fout <<
"}" << std::endl;
649 fout << std::setprecision(
dp);
658 if (!fRuleFit.GetRuleEnsemble().DoRules()) {
659 fout <<
" //" << std::endl;
660 fout <<
" // ==> MODEL CONTAINS NO RULES <==" << std::endl;
661 fout <<
" //" << std::endl;
665 const std::vector< Rule* > *
rules = &(
rens->GetRulesConst());
668 std::list< std::pair<Double_t,Int_t> >
sortedRules;
674 fout <<
" //" << std::endl;
675 fout <<
" // here follows all rules ordered in importance (most important first)" << std::endl;
676 fout <<
" // at the end of each line, the relative importance of the rule is given" << std::endl;
677 fout <<
" //" << std::endl;
679 for ( std::list< std::pair<double,int> >::reverse_iterator
itpair =
sortedRules.rbegin();
685 fout <<
" if (" << std::flush;
693 if (
ic>0)
fout <<
"&&" << std::flush;
695 fout <<
"(" << std::setprecision(10) <<
valmin << std::flush;
696 fout <<
"<inputValues[" <<
sel <<
"])" << std::flush;
700 fout <<
"(inputValues[" <<
sel <<
"]" << std::flush;
701 fout <<
"<" << std::setprecision(10) <<
valmax <<
")" <<std::flush;
704 fout <<
") rval+=" << std::setprecision(10) << (*rules)[
ir]->GetCoefficient() <<
";" << std::flush;
707 fout << std::setprecision(
dp);
715 if (!fRuleFit.GetRuleEnsemble().DoLinear()) {
716 fout <<
" //" << std::endl;
717 fout <<
" // ==> MODEL CONTAINS NO LINEAR TERMS <==" << std::endl;
718 fout <<
" //" << std::endl;
721 fout <<
" //" << std::endl;
722 fout <<
" // here follows all linear terms" << std::endl;
723 fout <<
" // at the end of each line, the relative importance of the term is given" << std::endl;
724 fout <<
" //" << std::endl;
728 if (
rens->IsLinTermOK(
il)) {
734 << std::setprecision(10) <<
rens->GetLinCoefficients(
il)*
norm
735 <<
"*std::min( double(" << std::setprecision(10) <<
rens->GetLinDP(
il)
736 <<
"), std::max( double(inputValues[" <<
il <<
"]), double(" << std::setprecision(10) <<
rens->GetLinDM(
il) <<
")));"
756 Log() << col <<
"--- Short description:" <<
colres <<
Endl;
758 Log() <<
"This method uses a collection of so called rules to create a" <<
Endl;
759 Log() <<
"discriminating scoring function. Each rule consists of a series" <<
Endl;
760 Log() <<
"of cuts in parameter space. The ensemble of rules are created" <<
Endl;
761 Log() <<
"from a forest of decision trees, trained using the training data." <<
Endl;
762 Log() <<
"Each node (apart from the root) corresponds to one rule." <<
Endl;
763 Log() <<
"The scoring function is then obtained by linearly combining" <<
Endl;
764 Log() <<
"the rules. A fitting procedure is applied to find the optimum" <<
Endl;
765 Log() <<
"set of coefficients. The goal is to find a model with few rules" <<
Endl;
766 Log() <<
"but with a strong discriminating power." <<
Endl;
768 Log() << col <<
"--- Performance optimisation:" <<
colres <<
Endl;
770 Log() <<
"There are two important considerations to make when optimising:" <<
Endl;
772 Log() <<
" 1. Topology of the decision tree forest" <<
brk <<
Endl;
773 Log() <<
" 2. Fitting of the coefficients" <<
Endl;
775 Log() <<
"The maximum complexity of the rules is defined by the size of" <<
Endl;
776 Log() <<
"the trees. Large trees will yield many complex rules and capture" <<
Endl;
777 Log() <<
"higher order correlations. On the other hand, small trees will" <<
Endl;
778 Log() <<
"lead to a smaller ensemble with simple rules, only capable of" <<
Endl;
779 Log() <<
"modeling simple structures." <<
Endl;
780 Log() <<
"Several parameters exists for controlling the complexity of the" <<
Endl;
781 Log() <<
"rule ensemble." <<
Endl;
783 Log() <<
"The fitting procedure searches for a minimum using a gradient" <<
Endl;
784 Log() <<
"directed path. Apart from step size and number of steps, the" <<
Endl;
785 Log() <<
"evolution of the path is defined by a cut-off parameter, tau." <<
Endl;
786 Log() <<
"This parameter is unknown and depends on the training data." <<
Endl;
787 Log() <<
"A large value will tend to give large weights to a few rules." <<
Endl;
788 Log() <<
"Similarly, a small value will lead to a large set of rules" <<
Endl;
789 Log() <<
"with similar weights." <<
Endl;
791 Log() <<
"A final point is the model used; rules and/or linear terms." <<
Endl;
792 Log() <<
"For a given training sample, the result may improve by adding" <<
Endl;
793 Log() <<
"linear terms. If best performance is obtained using only linear" <<
Endl;
794 Log() <<
"terms, it is very likely that the Fisher discriminant would be" <<
Endl;
795 Log() <<
"a better choice. Ideally the fitting procedure should be able to" <<
Endl;
796 Log() <<
"make this choice by giving appropriate weights for either terms." <<
Endl;
798 Log() << col <<
"--- Performance tuning via configuration options:" <<
colres <<
Endl;
800 Log() <<
"I. TUNING OF RULE ENSEMBLE:" <<
Endl;
802 Log() <<
" " << col <<
"ForestType " <<
colres
803 <<
": Recommended is to use the default \"AdaBoost\"." <<
brk <<
Endl;
804 Log() <<
" " << col <<
"nTrees " <<
colres
805 <<
": More trees leads to more rules but also slow" <<
Endl;
806 Log() <<
" performance. With too few trees the risk is" <<
Endl;
807 Log() <<
" that the rule ensemble becomes too simple." <<
brk <<
Endl;
808 Log() <<
" " << col <<
"fEventsMin " <<
colres <<
brk <<
Endl;
809 Log() <<
" " << col <<
"fEventsMax " <<
colres
810 <<
": With a lower min, more large trees will be generated" <<
Endl;
811 Log() <<
" leading to more complex rules." <<
Endl;
812 Log() <<
" With a higher max, more small trees will be" <<
Endl;
813 Log() <<
" generated leading to more simple rules." <<
Endl;
814 Log() <<
" By changing this range, the average complexity" <<
Endl;
815 Log() <<
" of the rule ensemble can be controlled." <<
brk <<
Endl;
816 Log() <<
" " << col <<
"RuleMinDist " <<
colres
817 <<
": By increasing the minimum distance between" <<
Endl;
818 Log() <<
" rules, fewer and more diverse rules will remain." <<
Endl;
819 Log() <<
" Initially it is a good idea to keep this small" <<
Endl;
820 Log() <<
" or zero and let the fitting do the selection of" <<
Endl;
821 Log() <<
" rules. In order to reduce the ensemble size," <<
Endl;
822 Log() <<
" the value can then be increased." <<
Endl;
825 Log() <<
"II. TUNING OF THE FITTING:" <<
Endl;
827 Log() <<
" " << col <<
"GDPathEveFrac " <<
colres
828 <<
": fraction of events in path evaluation" <<
Endl;
829 Log() <<
" Increasing this fraction will improve the path" <<
Endl;
830 Log() <<
" finding. However, a too high value will give few" <<
Endl;
831 Log() <<
" unique events available for error estimation." <<
Endl;
832 Log() <<
" It is recommended to use the default = 0.5." <<
brk <<
Endl;
833 Log() <<
" " << col <<
"GDTau " <<
colres
834 <<
": cutoff parameter tau" <<
Endl;
835 Log() <<
" By default this value is set to -1.0." <<
Endl;
837 Log() <<
" This means that the cut off parameter is" <<
Endl;
838 Log() <<
" automatically estimated. In most cases" <<
Endl;
839 Log() <<
" this should be fine. However, you may want" <<
Endl;
840 Log() <<
" to fix this value if you already know it" <<
Endl;
841 Log() <<
" and want to reduce on training time." <<
brk <<
Endl;
842 Log() <<
" " << col <<
"GDTauPrec " <<
colres
843 <<
": precision of estimated tau" <<
Endl;
844 Log() <<
" Increase this precision to find a more" <<
Endl;
845 Log() <<
" optimum cut-off parameter." <<
brk <<
Endl;
846 Log() <<
" " << col <<
"GDNStep " <<
colres
847 <<
": number of steps in path search" <<
Endl;
848 Log() <<
" If the number of steps is too small, then" <<
Endl;
849 Log() <<
" the program will give a warning message." <<
Endl;
851 Log() <<
"III. WARNING MESSAGES" <<
Endl;
853 Log() << col <<
"Risk(i+1)>=Risk(i) in path" <<
colres <<
brk <<
Endl;
854 Log() << col <<
"Chaotic behaviour of risk evolution." <<
colres <<
Endl;
856 Log() <<
" The error rate was still decreasing at the end" <<
Endl;
857 Log() <<
" By construction the Risk should always decrease." <<
Endl;
858 Log() <<
" However, if the training sample is too small or" <<
Endl;
859 Log() <<
" the model is overtrained, such warnings can" <<
Endl;
860 Log() <<
" occur." <<
Endl;
861 Log() <<
" The warnings can safely be ignored if only a" <<
Endl;
862 Log() <<
" few (<3) occur. If more warnings are generated," <<
Endl;
863 Log() <<
" the fitting fails." <<
Endl;
864 Log() <<
" A remedy may be to increase the value" <<
brk <<
Endl;
866 << col <<
"GDValidEveFrac" <<
colres
867 <<
" to 1.0 (or a larger value)." <<
brk <<
Endl;
868 Log() <<
" In addition, if "
869 << col <<
"GDPathEveFrac" <<
colres
870 <<
" is too high" <<
Endl;
871 Log() <<
" the same warnings may occur since the events" <<
Endl;
872 Log() <<
" used for error estimation are also used for" <<
Endl;
873 Log() <<
" path estimation." <<
Endl;
874 Log() <<
" Another possibility is to modify the model - " <<
Endl;
875 Log() <<
" See above on tuning the rule ensemble." <<
Endl;
877 Log() << col <<
"The error rate was still decreasing at the end of the path"
879 Log() <<
" Too few steps in path! Increase "
880 << col <<
"GDNSteps" <<
colres <<
"." <<
Endl;
882 Log() << col <<
"Reached minimum early in the search" <<
colres <<
Endl;
884 Log() <<
" Minimum was found early in the fitting. This" <<
Endl;
885 Log() <<
" may indicate that the used step size "
887 Log() <<
" was too large. Reduce it and rerun." <<
Endl;
888 Log() <<
" If the results still are not OK, modify the" <<
Endl;
889 Log() <<
" model either by modifying the rule ensemble" <<
Endl;
890 Log() <<
" or add/remove linear terms" <<
Endl;
#define REGISTER_METHOD(CLASS)
for example
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 Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
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
Bool_t WriteOptionsReference() const
Implementation of the CrossEntropy as separation criterion.
Class that contains all the data information.
static void SetIsTraining(bool on)
Implementation of a Decision Tree.
Implementation of the GiniIndex as separation criterion.
Virtual base Class for all MVA method.
J Friedman's RuleFit method.
void GetHelpMessage() const override
get help message text
void ReadWeightsFromXML(void *wghtnode) override
read rules from XML node
void DeclareOptions() override
define the options (their key words) that can be set in the option string know options.
Double_t GetMvaValue(Double_t *err=nullptr, Double_t *errUpper=nullptr) override
returns MVA value for given event
void MakeClassLinear(std::ostream &) const
print out the linear terms
void TrainJFRuleFit()
training of rules using Jerome Friedmans implementation
void InitEventSample(void)
write all Events from the Tree into a vector of Events, that are more easily manipulated.
void MakeClassRuleCuts(std::ostream &) const
print out the rule cuts
void Init(void) override
default initialization
void InitMonitorNtuple()
initialize the monitoring ntuple
virtual ~MethodRuleFit(void)
destructor
void ReadWeightsFromStream(std::istream &istr) override
read rules from an std::istream
TTree * fMonitorNtuple
pointer to monitor rule ntuple
void ProcessOptions() override
process the options specified by the user
void AddWeightsXMLTo(void *parent) const override
add the rules to XML node
MethodRuleFit(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
standard constructor
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t) override
RuleFit can handle classification with 2 classes.
const Ranking * CreateRanking() override
computes ranking of input variables
void MakeClassSpecific(std::ostream &, const TString &) const override
write specific classifier response
void Train(void) override
void WriteMonitoringHistosToFile(void) const override
write special monitoring histograms to file (here ntuple)
void TrainTMVARuleFit()
training of rules using TMVA implementation
Implementation of the MisClassificationError as separation criterion.
Ranking for variables in method (implementation)
A class describing a 'rule cut'.
J Friedman's RuleFit method.
Implementation of a rule.
Implementation of the SdivSqrtSplusB as separation criterion.
Timing information for training and evaluation of MVA methods.
Singleton class for Global types used by TMVA.
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
A TTree represents a columnar dataset.
create variable transformations
MsgLogger & Endl(MsgLogger &ml)