Public Member Functions | |
RuleFit (const TMVA::MethodBase *rfbase) | |
constructor | |
RuleFit (void) | |
default constructor | |
virtual | ~RuleFit (void) |
destructor | |
void | Boost (TMVA::DecisionTree *dt) |
Boost the events. | |
void | BuildTree (TMVA::DecisionTree *dt) |
build the decision tree using fNTreeSample events from fTrainingEventsRndm | |
void | CalcImportance () |
calculates the importance of each rule | |
Double_t | CalcWeightSum (const std::vector< const TMVA::Event * > *events, UInt_t neve=0) |
calculate the sum of weights | |
Double_t | EvalEvent (const Event &e) |
evaluate single event | |
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 | FillCut (TH2F *h2, const TMVA::Rule *rule, Int_t vind) |
Fill cut. | |
void | FillLin (TH2F *h2, Int_t vind) |
fill lin | |
void | FillVisHistCorr (const Rule *rule, std::vector< TH2F * > &hlist) |
help routine to MakeVisHists() - fills for all correlation plots | |
void | FillVisHistCut (const Rule *rule, std::vector< TH2F * > &hlist) |
help routine to MakeVisHists() - fills for all variables | |
void | FitCoefficients () |
Fit the coefficients for the rule ensemble. | |
void | ForestStatistics () |
summary of statistics of all trees | |
Bool_t | GetCorrVars (TString &title, TString &var1, TString &var2) |
get first and second variables from title | |
const std::vector< const TMVA::DecisionTree * > & | GetForest () const |
const MethodBase * | GetMethodBase () const |
const MethodRuleFit * | GetMethodRuleFit () const |
Double_t | GetNEveEff () const |
UInt_t | GetNTreeSample () const |
void | GetRndmSampleEvents (std::vector< const TMVA::Event * > &evevec, UInt_t nevents) |
draw a random subsample of the training events without replacement | |
const RuleEnsemble & | GetRuleEnsemble () const |
RuleEnsemble * | GetRuleEnsemblePtr () |
const RuleFitParams & | GetRuleFitParams () const |
RuleFitParams * | GetRuleFitParamsPtr () |
const Event * | GetTrainingEvent (UInt_t i) const |
const std::vector< const TMVA::Event * > & | GetTrainingEvents () const |
Double_t | GetTrainingEventWeight (UInt_t i) const |
void | Initialize (const TMVA::MethodBase *rfbase) |
initialize the parameters of the RuleFit method and make rules | |
void | InitNEveEff () |
init effective number of events (using event weights) | |
void | InitPtrs (const TMVA::MethodBase *rfbase) |
initialize pointers | |
virtual TClass * | IsA () const |
void | MakeDebugHists () |
this will create a histograms intended rather for debugging or for the curious user | |
void | MakeForest () |
make a forest of decisiontrees | |
void | MakeVisHists () |
this will create histograms visualizing the rule ensemble | |
void | NormVisHists (std::vector< TH2F * > &hlist) |
normalize rule importance hists | |
void | ReshuffleEvents () |
void | RestoreEventWeights () |
save event weights - must be done before making the forest | |
void | SaveEventWeights () |
save event weights - must be done before making the forest | |
void | SetGDNPathSteps (Int_t n=100) |
void | SetGDPathStep (Double_t s=0.01) |
void | SetGDTau (Double_t t=0.0) |
void | SetImportanceCut (Double_t minimp=0) |
void | SetMethodBase (const MethodBase *rfbase) |
set MethodBase | |
void | SetModelFull () |
void | SetModelLinear () |
void | SetModelRules () |
void | SetMsgType (EMsgType t) |
set the current message type to that of mlog for this class and all other subtools | |
void | SetRuleMinDist (Double_t d) |
void | SetTrainingEvents (const std::vector< const TMVA::Event * > &el) |
set the training events randomly | |
void | SetVisHistsUseImp (Bool_t f) |
virtual void | Streamer (TBuffer &) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
void | UseCoefficientsVisHists () |
void | UseImportanceVisHists () |
Static Public Member Functions | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Private Member Functions | |
RuleFit (const RuleFit &other) | |
void | Copy (const RuleFit &other) |
copy method | |
MsgLogger & | Log () const |
Private Attributes | |
std::vector< Double_t > | fEventWeights |
original weights of the events - follows fTrainingEvents | |
std::vector< const TMVA::DecisionTree * > | fForest |
the input forest of decision trees | |
MsgLogger * | fLogger |
! message logger | |
const MethodBase * | fMethodBase |
pointer the method base which initialized this RuleFit instance | |
const MethodRuleFit * | fMethodRuleFit |
pointer the method which initialized this RuleFit instance | |
Double_t | fNEveEffTrain |
reweighted number of events = sum(wi) | |
UInt_t | fNTreeSample |
number of events in sub sample = frac*neve | |
std::default_random_engine | fRNGEngine |
RuleEnsemble | fRuleEnsemble |
the ensemble of rules | |
RuleFitParams | fRuleFitParams |
fit rule parameters | |
std::vector< const TMVA::Event * > | fTrainingEvents |
all training events | |
std::vector< const TMVA::Event * > | fTrainingEventsRndm |
idem, but randomly shuffled | |
Bool_t | fVisHistsUseImp |
if true, use importance as weight; else coef in vis hists | |
Static Private Attributes | |
static const Int_t | randSEED = 0 |
#include <TMVA/RuleFit.h>
TMVA::RuleFit::RuleFit | ( | const TMVA::MethodBase * | rfbase | ) |
constructor
Definition at line 64 of file RuleFit.cxx.
TMVA::RuleFit::RuleFit | ( | void | ) |
default constructor
Definition at line 75 of file RuleFit.cxx.
|
virtual |
destructor
Definition at line 89 of file RuleFit.cxx.
void TMVA::RuleFit::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().
Definition at line 328 of file RuleFit.cxx.
void TMVA::RuleFit::BuildTree | ( | TMVA::DecisionTree * | dt | ) |
build the decision tree using fNTreeSample events from fTrainingEventsRndm
Definition at line 200 of file RuleFit.cxx.
void TMVA::RuleFit::CalcImportance | ( | ) |
calculates the importance of each rule
Definition at line 407 of file RuleFit.cxx.
Double_t TMVA::RuleFit::CalcWeightSum | ( | const std::vector< const TMVA::Event * > * | events, |
UInt_t | neve = 0 ) |
calculate the sum of weights
Definition at line 175 of file RuleFit.cxx.
copy method
Definition at line 159 of file RuleFit.cxx.
evaluate single event
Definition at line 421 of file RuleFit.cxx.
void TMVA::RuleFit::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
Definition at line 597 of file RuleFit.cxx.
void TMVA::RuleFit::FillCut | ( | TH2F * | h2, |
const TMVA::Rule * | rule, | ||
Int_t | vind ) |
Fill cut.
Definition at line 522 of file RuleFit.cxx.
fill lin
Definition at line 573 of file RuleFit.cxx.
help routine to MakeVisHists() - fills for all correlation plots
Definition at line 704 of file RuleFit.cxx.
help routine to MakeVisHists() - fills for all variables
Definition at line 673 of file RuleFit.cxx.
void TMVA::RuleFit::FitCoefficients | ( | ) |
Fit the coefficients for the rule ensemble.
Definition at line 398 of file RuleFit.cxx.
void TMVA::RuleFit::ForestStatistics | ( | ) |
summary of statistics of all trees
Definition at line 375 of file RuleFit.cxx.
get first and second variables from title
Definition at line 743 of file RuleFit.cxx.
|
inline |
|
inline |
|
inline |
void TMVA::RuleFit::GetRndmSampleEvents | ( | std::vector< const TMVA::Event * > & | evevec, |
UInt_t | nevents ) |
draw a random subsample of the training events without replacement
Definition at line 456 of file RuleFit.cxx.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void TMVA::RuleFit::Initialize | ( | const TMVA::MethodBase * | rfbase | ) |
initialize the parameters of the RuleFit method and make rules
Definition at line 119 of file RuleFit.cxx.
void TMVA::RuleFit::InitNEveEff | ( | ) |
init effective number of events (using event weights)
Definition at line 97 of file RuleFit.cxx.
void TMVA::RuleFit::InitPtrs | ( | const TMVA::MethodBase * | rfbase | ) |
initialize pointers
Definition at line 109 of file RuleFit.cxx.
void TMVA::RuleFit::MakeDebugHists | ( | ) |
this will create a histograms intended rather for debugging or for the curious user
Definition at line 926 of file RuleFit.cxx.
void TMVA::RuleFit::MakeForest | ( | ) |
make a forest of decisiontrees
Definition at line 221 of file RuleFit.cxx.
void TMVA::RuleFit::MakeVisHists | ( | ) |
this will create histograms visualizing the rule ensemble
Definition at line 766 of file RuleFit.cxx.
void TMVA::RuleFit::NormVisHists | ( | std::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))
Definition at line 475 of file RuleFit.cxx.
void TMVA::RuleFit::RestoreEventWeights | ( | ) |
save event weights - must be done before making the forest
Definition at line 310 of file RuleFit.cxx.
void TMVA::RuleFit::SaveEventWeights | ( | ) |
save event weights - must be done before making the forest
Definition at line 298 of file RuleFit.cxx.
|
inline |
|
inline |
|
inline |
void TMVA::RuleFit::SetMethodBase | ( | const MethodBase * | rfbase | ) |
set MethodBase
Definition at line 150 of file RuleFit.cxx.
void TMVA::RuleFit::SetMsgType | ( | EMsgType | t | ) |
set the current message type to that of mlog for this class and all other subtools
Definition at line 190 of file RuleFit.cxx.
void TMVA::RuleFit::SetTrainingEvents | ( | const std::vector< const TMVA::Event * > & | el | ) |
set the training events randomly
Definition at line 429 of file RuleFit.cxx.
|
inline |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |