27#ifndef ROOT_TMVA_RuleFit
28#define ROOT_TMVA_RuleFit
166 std::vector< const TMVA::DecisionTree *>
fForest;
#define ClassDef(name, id)
2-D histogram with a float per channel (see TH1 documentation)}
Implementation of a Decision Tree.
Virtual base Class for all MVA method.
J Friedman's RuleFit method.
ostringstream derivative to redirect and format output
void SetRuleMinDist(Double_t d)
void SetImportanceCut(Double_t minimp=0)
A class doing the actual fitting of a linear model using rules as base functions.
void SetGDPathStep(Double_t s)
void SetGDTau(Double_t t)
void SetGDNPathSteps(Int_t np)
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
UInt_t fNTreeSample
number of events in sub sample = frac*neve
void SetMethodBase(const MethodBase *rfbase)
set MethodBase
Double_t GetNEveEff() const
void InitPtrs(const TMVA::MethodBase *rfbase)
initialize pointers
void Boost(TMVA::DecisionTree *dt)
Boost the events.
RuleEnsemble * GetRuleEnsemblePtr()
Bool_t fVisHistsUseImp
if true, use importance as weight; else coef in vis hists
const RuleFitParams & GetRuleFitParams() const
void ForestStatistics()
summary of statistics of all trees
static const Int_t randSEED
void CalcImportance()
calculates the importance of each rule
RuleFitParams * GetRuleFitParamsPtr()
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
std::vector< const TMVA::Event * > fTrainingEventsRndm
idem, but randomly shuffled
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)
UInt_t GetNTreeSample() const
std::vector< const TMVA::DecisionTree * > fForest
the input forest of decision trees
void SetGDPathStep(Double_t s=0.01)
const MethodBase * fMethodBase
pointer the method base which initialized this RuleFit instance
Double_t GetTrainingEventWeight(UInt_t i) const
std::vector< const TMVA::Event * > fTrainingEvents
all training events
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 UseCoefficientsVisHists()
const Event * GetTrainingEvent(UInt_t i) const
void MakeForest()
make a forest of decisiontrees
const std::vector< const TMVA::DecisionTree * > & GetForest() const
void FitCoefficients()
Fit the coefficients for the rule ensemble.
void SetRuleMinDist(Double_t d)
RuleFit(const RuleFit &other)
const MethodRuleFit * fMethodRuleFit
pointer the method which initialized this RuleFit instance
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 SetGDNPathSteps(Int_t n=100)
void RestoreEventWeights()
save event weights - must be done before making the forest
RuleFitParams fRuleFitParams
fit rule parameters
void SetVisHistsUseImp(Bool_t f)
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
std::vector< Double_t > fEventWeights
original weights of the events - follows fTrainingEvents
void BuildTree(TMVA::DecisionTree *dt)
build the decision tree using fNTreeSample events from fTrainingEventsRndm
const std::vector< const TMVA::Event * > & GetTrainingEvents() const
void SetGDTau(Double_t t=0.0)
const MethodRuleFit * GetMethodRuleFit() const
void UseImportanceVisHists()
void SetTrainingEvents(const std::vector< const TMVA::Event * > &el)
set the training events randomly
Double_t fNEveEffTrain
reweighted number of events = sum(wi)
void Copy(const RuleFit &other)
copy method
RuleEnsemble fRuleEnsemble
the ensemble of rules
const RuleEnsemble & GetRuleEnsemble() const
void SetImportanceCut(Double_t minimp=0)
Double_t CalcWeightSum(const std::vector< const TMVA::Event * > *events, UInt_t neve=0)
calculate the sum of weights
RuleFit(void)
default constructor
MsgLogger * fLogger
message logger
void MakeDebugHists()
this will create a histograms intended rather for debugging or for the curious user
Implementation of a rule.
create variable transformations