class TMVA::RuleFit


  Implementation of various fits of rule ensembles


Function Members (Methods)

public:
virtual~RuleFit()
voidBoost(TMVA::DecisionTree* dt)
voidBuildTree(TMVA::DecisionTree* dt)
voidCalcImportance()
Double_tCalcWeightSum(const vector<TMVA::Event*>* events, UInt_t neve = 0)
static TClass*Class()
Double_tEvalEvent(const TMVA::Event& e)
voidFillCorr(TH2F* h2, const TMVA::Rule* rule, Int_t v1, Int_t v2)
voidFillCut(TH2F* h2, const TMVA::Rule* rule, Int_t vind)
voidFillLin(TH2F* h2, Int_t vind)
voidFillVisHistCorr(const TMVA::Rule* rule, vector<TH2F*>& hlist)
voidFillVisHistCut(const TMVA::Rule* rule, vector<TH2F*>& hlist)
voidFitCoefficients()
voidForestStatistics()
Bool_tGetCorrVars(TString& title, TString& var1, TString& var2)
const vector<const TMVA::DecisionTree*>&GetForest() const
const TMVA::MethodBase*GetMethodBase() const
const TMVA::MethodRuleFit*GetMethodRuleFit() const
Double_tGetNEveEff() const
UInt_tGetNTreeSample() const
voidGetRndmSampleEvents(vector<const TMVA::Event*>& evevec, UInt_t nevents)
const TMVA::RuleEnsemble&GetRuleEnsemble() const
TMVA::RuleEnsemble*GetRuleEnsemblePtr()
const TMVA::RuleFitParams&GetRuleFitParams() const
TMVA::RuleFitParams*GetRuleFitParamsPtr()
const TMVA::Event*GetTrainingEvent(UInt_t i) const
const vector<TMVA::Event*>&GetTrainingEvents() const
Double_tGetTrainingEventWeight(UInt_t i) const
voidInitialize(const TMVA::MethodBase* rfbase)
voidInitNEveEff()
voidInitPtrs(const TMVA::MethodBase* rfbase)
virtual TClass*IsA() const
voidMakeDebugHists()
voidMakeForest()
voidMakeVisHists()
voidNormVisHists(vector<TH2F*>& hlist)
voidReshuffleEvents()
voidRestoreEventWeights()
TMVA::RuleFitRuleFit()
TMVA::RuleFitRuleFit(const TMVA::MethodBase* rfbase)
voidSaveEventWeights()
voidSetGDNPathSteps(Int_t n = 100)
voidSetGDPathStep(Double_t s = 0.01)
voidSetGDTau(Double_t t = 0.0)
voidSetImportanceCut(Double_t minimp = 0)
voidSetMethodBase(const TMVA::MethodBase* rfbase)
voidSetModelFull()
voidSetModelLinear()
voidSetModelRules()
voidSetMsgType(TMVA::EMsgType t)
voidSetRuleMinDist(Double_t d)
voidSetTrainingEvents(const vector<TMVA::Event*>& el)
voidSetVisHistsUseImp(Bool_t f)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
voidUseCoefficientsVisHists()
voidUseImportanceVisHists()
private:
TMVA::RuleFitRuleFit(const TMVA::RuleFit& other)

Data Members

private:
vector<Double_t>fEventWeightsoriginal weights of the events - follows fTrainingEvents
vector<const TMVA::DecisionTree*>fForestthe input forest of decision trees
TMVA::MsgLoggerfLoggermessage logger
const TMVA::MethodBase*fMethodBasepointer the method base which initialized this RuleFit instance
const TMVA::MethodRuleFit*fMethodRuleFitpointer the method which initialized this RuleFit instance
Double_tfNEveEffTrainreweighted number of events = sum(wi)
UInt_tfNTreeSamplenumber of events in sub sample = frac*neve
TMVA::RuleEnsemblefRuleEnsemblethe ensemble of rules
TMVA::RuleFitParamsfRuleFitParamsfit rule parameters
vector<TMVA::Event*>fTrainingEventsall training events
vector<TMVA::Event*>fTrainingEventsRndmidem, but randomly shuffled
Bool_tfVisHistsUseImpif true, use importance as weight; else coef in vis hists

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

RuleFit( const MethodBase *rfbase )
 constructor
RuleFit()
 default constructor
~RuleFit()
 destructor
void InitNEveEff()
 init effective number of events (using event weights)
void InitPtrs(const TMVA::MethodBase* rfbase)
 initialize pointers
void Initialize(const TMVA::MethodBase* rfbase)
 initialize the parameters of the RuleFit method and make rules
void SetMethodBase(const TMVA::MethodBase* rfbase)
 set MethodBase
Double_t CalcWeightSum(const vector<TMVA::Event*>* events, UInt_t neve = 0)
 calculate the sum of weights
void SetMsgType(TMVA::EMsgType t)
 set the current message type to that of mlog for this class and all other subtools
void BuildTree(TMVA::DecisionTree* dt)
 build the decision tree using fNTreeSample events from fTrainingEventsRndm
void MakeForest()
 make a forest of decisiontrees
void SaveEventWeights()
 save event weights - must be done before making the forest
void RestoreEventWeights()
 save event weights - must be done before making the forest
void Boost(TMVA::DecisionTree* dt)
 Boost the events. The algorithm below is the called AdaBoost.
 See MethodBDT for details.
 Actually, this is a more or less copy of MethodBDT::AdaBoost().
void ForestStatistics()
 summary of statistics of all trees
 * end-nodes: average and spread
void FitCoefficients()
 Fit the coefficients for the rule ensemble

void CalcImportance()
 calculates the importance of each rule
Double_t EvalEvent(const TMVA::Event& e)
 evaluate single event
void SetTrainingEvents(const vector<TMVA::Event*>& el)
 set the training events randomly
void GetRndmSampleEvents(vector<const TMVA::Event*>& evevec, UInt_t nevents)
 draw a random subsample of the training events without replacement
void NormVisHists(vector<TH2F*>& hlist)
 normalize rule importance hists

 if all weights are positive, the scale will be 1/maxweight
 if minimum weight < 0, then the scale will be 1/max(maxweight,abs(minweight))

void FillCut(TH2F* h2, const TMVA::Rule* rule, Int_t vind)
 Fill cut
void FillLin(TH2F* h2, Int_t vind)
 fill lin
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 FillVisHistCut(const TMVA::Rule* rule, vector<TH2F*>& hlist)
 help routine to MakeVisHists() - fills for all variables
   if (rule==0) return;
void FillVisHistCorr(const TMVA::Rule* rule, vector<TH2F*>& hlist)
 help routine to MakeVisHists() - fills for all correlation plots
Bool_t GetCorrVars(TString& title, TString& var1, TString& var2)
 get first and second variables from title
void MakeVisHists()
 this will create histograms visualizing the rule ensemble
void MakeDebugHists()
 this will create a histograms intended rather for debugging or for the curious user
RuleFit( const TMVA::MethodBase *rfbase )
 main constructor
void ReshuffleEvents()
{ std::random_shuffle(fTrainingEventsRndm.begin(),fTrainingEventsRndm.end()); }
void SetModelLinear()
 set usage of linear term
{ fRuleEnsemble.SetModelLinear(); }
void SetModelRules()
 set usage of linear term
{ fRuleEnsemble.SetModelRules(); }
void SetModelFull()
 set minimum importance allowed
{ fRuleEnsemble.SetModelFull(); }
void SetImportanceCut(Double_t minimp = 0)
 set minimum rule distance - see RuleEnsemble
{ fRuleEnsemble.SetImportanceCut(minimp); }
void SetRuleMinDist(Double_t d)
 set path related parameters
{ fRuleEnsemble.SetRuleMinDist(d); }
void SetGDTau(Double_t t = 0.0)
{ fRuleFitParams.SetGDTau(t); }
void SetGDPathStep(Double_t s = 0.01)
{ fRuleFitParams.SetGDPathStep(s); }
void SetGDNPathSteps(Int_t n = 100)
 make visualization histograms
{ fRuleFitParams.SetGDNPathSteps(n); }
void SetVisHistsUseImp(Bool_t f)
{ fVisHistsUseImp = f; }
void UseImportanceVisHists()
{ fVisHistsUseImp = kTRUE; }
void UseCoefficientsVisHists()
{ fVisHistsUseImp = kFALSE; }
UInt_t GetNTreeSample()
 accessors
{ return fNTreeSample; }
Double_t GetNEveEff()
{ return fNEveEffTrain; }
const Event* GetTrainingEvent(UInt_t i) const
{ return static_cast< const Event *>(fTrainingEvents[i]); }
Double_t GetTrainingEventWeight(UInt_t i) const
{ return fTrainingEvents[i]->GetWeight(); }
const std::vector< TMVA::Event * > & GetTrainingEvents()
      const Event*  GetTrainingEvent(UInt_t i, UInt_t isub)  const { return &(fTrainingEvents[fSubsampleEvents[isub]])[i]; }
{ return fTrainingEvents; }
const std::vector< const TMVA::DecisionTree *> & GetForest()
{ return fForest; }
const RuleEnsemble & GetRuleEnsemble()
{ return fRuleEnsemble; }
RuleEnsemble * GetRuleEnsemblePtr()
{ return &fRuleEnsemble; }
const RuleFitParams & GetRuleFitParams()
{ return fRuleFitParams; }
RuleFitParams * GetRuleFitParamsPtr()
{ return &fRuleFitParams; }
const MethodRuleFit * GetMethodRuleFit()
{ return fMethodRuleFit; }
const MethodBase * GetMethodBase()
{ return fMethodBase; }

Author: Andreas Hoecker, Joerg Stelzer, Fredrik Tegenfeldt, Helge Voss
Last change: root/tmva $Id: RuleFit.h 23334 2008-04-19 18:38:57Z brun $
Last generated: 2008-11-01 10:22
Copyright (c) 2005: *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.