![]() |
ROOT
6.06/08
Reference Guide
|
Public Member Functions | |
| RuleFit (const TMVA::MethodBase *rfbase) | |
| constructor More... | |
| RuleFit (void) | |
| default constructor More... | |
| virtual | ~RuleFit (void) |
| destructor More... | |
| void | InitNEveEff () |
| init effective number of events (using event weights) More... | |
| void | InitPtrs (const TMVA::MethodBase *rfbase) |
| initialize pointers More... | |
| void | Initialize (const TMVA::MethodBase *rfbase) |
| initialize the parameters of the RuleFit method and make rules More... | |
| void | SetMsgType (EMsgType t) |
| set the current message type to that of mlog for this class and all other subtools More... | |
| void | SetTrainingEvents (const std::vector< const TMVA::Event *> &el) |
| set the training events randomly More... | |
| void | ReshuffleEvents () |
| void | SetMethodBase (const MethodBase *rfbase) |
| set MethodBase More... | |
| void | MakeForest () |
| make a forest of decisiontrees More... | |
| void | BuildTree (TMVA::DecisionTree *dt) |
| build the decision tree using fNTreeSample events from fTrainingEventsRndm More... | |
| void | SaveEventWeights () |
| save event weights - must be done before making the forest More... | |
| void | RestoreEventWeights () |
| save event weights - must be done before making the forest More... | |
| void | Boost (TMVA::DecisionTree *dt) |
| Boost the events. More... | |
| void | ForestStatistics () |
| summary of statistics of all trees More... | |
| Double_t | EvalEvent (const Event &e) |
| evaluate single event More... | |
| Double_t | CalcWeightSum (const std::vector< const TMVA::Event *> *events, UInt_t neve=0) |
| calculate the sum of weights More... | |
| void | FitCoefficients () |
| Fit the coefficients for the rule ensemble. More... | |
| void | CalcImportance () |
| calculates the importance of each rule More... | |
| void | SetModelLinear () |
| void | SetModelRules () |
| void | SetModelFull () |
| void | SetImportanceCut (Double_t minimp=0) |
| void | SetRuleMinDist (Double_t d) |
| void | SetGDTau (Double_t t=0.0) |
| void | SetGDPathStep (Double_t s=0.01) |
| void | SetGDNPathSteps (Int_t n=100) |
| void | SetVisHistsUseImp (Bool_t f) |
| void | UseImportanceVisHists () |
| void | UseCoefficientsVisHists () |
| void | MakeVisHists () |
| this will create histograms visualizing the rule ensemble More... | |
| void | FillVisHistCut (const Rule *rule, std::vector< TH2F *> &hlist) |
| help routine to MakeVisHists() - fills for all variables More... | |
| void | FillVisHistCorr (const Rule *rule, std::vector< TH2F *> &hlist) |
| help routine to MakeVisHists() - fills for all correlation plots More... | |
| void | FillCut (TH2F *h2, const TMVA::Rule *rule, Int_t vind) |
| Fill cut. More... | |
| void | FillLin (TH2F *h2, Int_t vind) |
| fill lin More... | |
| 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 More... | |
| void | NormVisHists (std::vector< TH2F *> &hlist) |
| normalize rule importance hists More... | |
| void | MakeDebugHists () |
| this will create a histograms intended rather for debugging or for the curious user More... | |
| Bool_t | GetCorrVars (TString &title, TString &var1, TString &var2) |
| get first and second variables from title More... | |
| UInt_t | GetNTreeSample () const |
| Double_t | GetNEveEff () const |
| const Event * | GetTrainingEvent (UInt_t i) const |
| Double_t | GetTrainingEventWeight (UInt_t i) const |
| const std::vector< const TMVA::Event *> & | GetTrainingEvents () const |
| void | GetRndmSampleEvents (std::vector< const TMVA::Event * > &evevec, UInt_t nevents) |
| draw a random subsample of the training events without replacement More... | |
| const std::vector< const TMVA::DecisionTree * > & | GetForest () const |
| const RuleEnsemble & | GetRuleEnsemble () const |
| RuleEnsemble * | GetRuleEnsemblePtr () |
| const RuleFitParams & | GetRuleFitParams () const |
| RuleFitParams * | GetRuleFitParamsPtr () |
| const MethodRuleFit * | GetMethodRuleFit () const |
| const MethodBase * | GetMethodBase () const |
Private Member Functions | |
| RuleFit (const RuleFit &other) | |
| void | Copy (const RuleFit &other) |
| copy method More... | |
| MsgLogger & | Log () const |
Private Attributes | |
| std::vector< const TMVA::Event * > | fTrainingEvents |
| std::vector< const TMVA::Event * > | fTrainingEventsRndm |
| std::vector< Double_t > | fEventWeights |
| UInt_t | fNTreeSample |
| Double_t | fNEveEffTrain |
| std::vector< const TMVA::DecisionTree * > | fForest |
| RuleEnsemble | fRuleEnsemble |
| RuleFitParams | fRuleFitParams |
| const MethodRuleFit * | fMethodRuleFit |
| const MethodBase * | fMethodBase |
| Bool_t | fVisHistsUseImp |
| MsgLogger * | fLogger |
Static Private Attributes | |
| static const Int_t | randSEED = 0 |
#include <TMVA/RuleFit.h>
Collaboration diagram for TMVA::RuleFit:| TMVA::RuleFit::RuleFit | ( | const TMVA::MethodBase * | rfbase | ) |
constructor
Definition at line 49 of file RuleFit.cxx.
| TMVA::RuleFit::RuleFit | ( | void | ) |
|
virtual |
destructor
Definition at line 74 of file RuleFit.cxx.
|
private |
| 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 324 of file RuleFit.cxx.
Referenced by MakeForest(), and ReshuffleEvents().
| void TMVA::RuleFit::BuildTree | ( | TMVA::DecisionTree * | dt | ) |
build the decision tree using fNTreeSample events from fTrainingEventsRndm
Definition at line 185 of file RuleFit.cxx.
Referenced by MakeForest(), and ReshuffleEvents().
| void TMVA::RuleFit::CalcImportance | ( | ) |
calculates the importance of each rule
Definition at line 403 of file RuleFit.cxx.
Referenced by ReshuffleEvents(), TMVA::MethodRuleFit::TrainJFRuleFit(), and TMVA::MethodRuleFit::TrainTMVARuleFit().
| Double_t TMVA::RuleFit::CalcWeightSum | ( | const std::vector< const TMVA::Event *> * | events, |
| UInt_t | neve = 0 |
||
| ) |
calculate the sum of weights
Definition at line 160 of file RuleFit.cxx.
Referenced by InitNEveEff(), and ReshuffleEvents().
evaluate single event
Definition at line 417 of file RuleFit.cxx.
Referenced by TMVA::MethodRuleFit::GetMvaValue(), and ReshuffleEvents().
| 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 594 of file RuleFit.cxx.
Referenced by FillVisHistCorr(), and UseCoefficientsVisHists().
| void TMVA::RuleFit::FillCut | ( | TH2F * | h2, |
| const TMVA::Rule * | rule, | ||
| Int_t | vind | ||
| ) |
Fill cut.
Definition at line 519 of file RuleFit.cxx.
Referenced by FillVisHistCut(), and UseCoefficientsVisHists().
fill lin
Definition at line 570 of file RuleFit.cxx.
Referenced by FillVisHistCut(), and UseCoefficientsVisHists().
help routine to MakeVisHists() - fills for all correlation plots
Definition at line 701 of file RuleFit.cxx.
Referenced by MakeVisHists(), and UseCoefficientsVisHists().
help routine to MakeVisHists() - fills for all variables
Definition at line 670 of file RuleFit.cxx.
Referenced by MakeVisHists(), and UseCoefficientsVisHists().
| void TMVA::RuleFit::FitCoefficients | ( | ) |
Fit the coefficients for the rule ensemble.
Definition at line 394 of file RuleFit.cxx.
Referenced by ReshuffleEvents(), and TMVA::MethodRuleFit::TrainTMVARuleFit().
| void TMVA::RuleFit::ForestStatistics | ( | ) |
summary of statistics of all trees
Definition at line 371 of file RuleFit.cxx.
Referenced by MakeForest(), and ReshuffleEvents().
get first and second variables from title
Definition at line 740 of file RuleFit.cxx.
Referenced by FillVisHistCorr(), MakeVisHists(), and UseCoefficientsVisHists().
|
inline |
Definition at line 147 of file RuleFit.h.
Referenced by Copy(), TMVA::RuleEnsemble::MakeModel(), and TMVA::RuleEnsemble::PrintRuleGen().
|
inline |
Definition at line 153 of file RuleFit.h.
Referenced by Copy(), TMVA::RuleEnsemble::GetMethodBase(), and TMVA::Rule::RuleDist().
|
inline |
Definition at line 152 of file RuleFit.h.
Referenced by TMVA::RuleFitParams::CalcAverageTruth(), Copy(), TMVA::RuleFitParams::ErrorRateBin(), TMVA::RuleFitParams::ErrorRateRoc(), TMVA::RuleFitParams::ErrorRateRocTst(), TMVA::RuleEnsemble::GetMethodRuleFit(), TMVA::RuleFitParams::Init(), TMVA::RuleFitParams::LossFunction(), TMVA::RuleFitParams::MakeGradientVector(), TMVA::RuleFitParams::MakeTstGradientVector(), TMVA::RuleFitParams::Optimism(), and TMVA::RuleFitParams::Type().
|
inline |
Definition at line 135 of file RuleFit.h.
Referenced by TMVA::RuleEnsemble::CalcRuleSupport(), and TMVA::RuleEnsemble::MakeLinearTerms().
|
inline |
Definition at line 134 of file RuleFit.h.
Referenced by TMVA::RuleEnsemble::PrintRuleGen().
| 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 452 of file RuleFit.cxx.
Referenced by GetTrainingEvents().
|
inline |
Definition at line 148 of file RuleFit.h.
Referenced by TMVA::MethodRuleFit::AddWeightsXMLTo(), Copy(), TMVA::MethodRuleFit::CreateRanking(), TMVA::MethodRuleFit::MakeClassLinear(), TMVA::MethodRuleFit::MakeClassRuleCuts(), TMVA::MethodRuleFit::MakeClassSpecific(), and TMVA::MethodRuleFit::TrainTMVARuleFit().
|
inline |
Definition at line 149 of file RuleFit.h.
Referenced by TMVA::RuleFitAPI::ImportSetup(), TMVA::RuleFitParams::Init(), TMVA::MethodRuleFit::ProcessOptions(), TMVA::RuleFitAPI::ReadModelSum(), TMVA::MethodRuleFit::ReadWeightsFromStream(), TMVA::MethodRuleFit::ReadWeightsFromXML(), TMVA::MethodRuleFit::Train(), TMVA::MethodRuleFit::TrainJFRuleFit(), and TMVA::MethodRuleFit::TrainTMVARuleFit().
|
inline |
|
inline |
Definition at line 151 of file RuleFit.h.
Referenced by TMVA::MethodRuleFit::ProcessOptions().
Definition at line 136 of file RuleFit.h.
Referenced by TMVA::RuleEnsemble::GetTrainingEvent().
|
inline |
Definition at line 141 of file RuleFit.h.
Referenced by TMVA::RuleFitParams::CalcAverageTruth(), TMVA::RuleFitParams::CalcFStar(), Copy(), TMVA::RuleFitParams::ErrorRateBin(), TMVA::RuleFitParams::ErrorRateReg(), TMVA::RuleFitParams::ErrorRateRoc(), TMVA::RuleFitParams::ErrorRateRocTst(), TMVA::RuleFitParams::EvaluateAverage(), TMVA::RuleEnsemble::GetTrainingEvents(), TMVA::RuleFitParams::Init(), TMVA::RuleFitParams::MakeGradientVector(), TMVA::RuleFitParams::MakeTstGradientVector(), and TMVA::RuleFitParams::Optimism().
Definition at line 137 of file RuleFit.h.
Referenced by TMVA::RuleFitParams::CalcAverageTruth(), TMVA::RuleFitParams::EvaluateAverage(), TMVA::RuleFitParams::Init(), TMVA::RuleFitParams::LossFunction(), TMVA::RuleFitParams::MakeGradientVector(), TMVA::RuleFitParams::MakeTstGradientVector(), and TMVA::RuleFitParams::Optimism().
| void TMVA::RuleFit::Initialize | ( | const TMVA::MethodBase * | rfbase | ) |
initialize the parameters of the RuleFit method and make rules
Definition at line 104 of file RuleFit.cxx.
Referenced by TMVA::MethodRuleFit::TrainTMVARuleFit().
| void TMVA::RuleFit::InitNEveEff | ( | ) |
init effective number of events (using event weights)
Definition at line 82 of file RuleFit.cxx.
Referenced by Initialize().
| void TMVA::RuleFit::InitPtrs | ( | const TMVA::MethodBase * | rfbase | ) |
initialize pointers
Definition at line 94 of file RuleFit.cxx.
Referenced by Initialize(), and TMVA::MethodRuleFit::TrainJFRuleFit().
|
inlineprivate |
Definition at line 177 of file RuleFit.h.
Referenced by Boost(), BuildTree(), CalcImportance(), FillVisHistCorr(), FillVisHistCut(), FitCoefficients(), ForestStatistics(), GetRndmSampleEvents(), MakeDebugHists(), MakeForest(), MakeVisHists(), RestoreEventWeights(), and SetTrainingEvents().
| void TMVA::RuleFit::MakeDebugHists | ( | ) |
this will create a histograms intended rather for debugging or for the curious user
Definition at line 924 of file RuleFit.cxx.
Referenced by TMVA::MethodRuleFit::TrainTMVARuleFit(), and UseCoefficientsVisHists().
| void TMVA::RuleFit::MakeForest | ( | ) |
make a forest of decisiontrees
Definition at line 206 of file RuleFit.cxx.
Referenced by Initialize(), and ReshuffleEvents().
| void TMVA::RuleFit::MakeVisHists | ( | ) |
this will create histograms visualizing the rule ensemble
Definition at line 763 of file RuleFit.cxx.
Referenced by TMVA::MethodRuleFit::TrainJFRuleFit(), TMVA::MethodRuleFit::TrainTMVARuleFit(), and UseCoefficientsVisHists().
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 472 of file RuleFit.cxx.
Referenced by MakeVisHists(), and UseCoefficientsVisHists().
|
inline |
Definition at line 72 of file RuleFit.h.
Referenced by GetRndmSampleEvents(), and MakeForest().
| void TMVA::RuleFit::RestoreEventWeights | ( | ) |
save event weights - must be done before making the forest
Definition at line 306 of file RuleFit.cxx.
Referenced by MakeForest(), and ReshuffleEvents().
| void TMVA::RuleFit::SaveEventWeights | ( | ) |
save event weights - must be done before making the forest
Definition at line 294 of file RuleFit.cxx.
Referenced by MakeForest(), and ReshuffleEvents().
Definition at line 113 of file RuleFit.h.
Referenced by TMVA::MethodRuleFit::ProcessOptions().
| void TMVA::RuleFit::SetMethodBase | ( | const MethodBase * | rfbase | ) |
set MethodBase
Definition at line 135 of file RuleFit.cxx.
Referenced by InitPtrs(), and ReshuffleEvents().
|
inline |
Definition at line 111 of file RuleFit.h.
Referenced by TMVA::MethodRuleFit::ProcessOptions().
|
inline |
Definition at line 107 of file RuleFit.h.
Referenced by TMVA::MethodRuleFit::ProcessOptions().
|
inline |
Definition at line 109 of file RuleFit.h.
Referenced by TMVA::MethodRuleFit::ProcessOptions().
set the current message type to that of mlog for this class and all other subtools
Definition at line 175 of file RuleFit.cxx.
Referenced by TMVA::MethodRuleFit::ProcessOptions().
Definition at line 115 of file RuleFit.h.
Referenced by TMVA::MethodRuleFit::ProcessOptions().
| void TMVA::RuleFit::SetTrainingEvents | ( | const std::vector< const TMVA::Event *> & | el | ) |
set the training events randomly
Definition at line 425 of file RuleFit.cxx.
Referenced by Initialize(), and TMVA::MethodRuleFit::TrainJFRuleFit().
|
inline |
Definition at line 122 of file RuleFit.h.
Referenced by TMVA::MethodRuleFit::ProcessOptions().
|
private |
Definition at line 165 of file RuleFit.h.
Referenced by RestoreEventWeights(), and SaveEventWeights().
|
private |
Definition at line 169 of file RuleFit.h.
Referenced by Copy(), ForestStatistics(), GetForest(), and MakeForest().
|
mutableprivate |
Definition at line 176 of file RuleFit.h.
Referenced by Log(), SetMsgType(), and ~RuleFit().
|
private |
Definition at line 173 of file RuleFit.h.
Referenced by Boost(), Copy(), FillVisHistCorr(), FillVisHistCut(), GetMethodBase(), MakeDebugHists(), MakeForest(), MakeVisHists(), and SetMethodBase().
|
private |
Definition at line 172 of file RuleFit.h.
Referenced by BuildTree(), Copy(), GetMethodRuleFit(), Initialize(), MakeForest(), SetMethodBase(), and SetTrainingEvents().
|
private |
Definition at line 168 of file RuleFit.h.
Referenced by GetNEveEff(), and InitNEveEff().
|
private |
Definition at line 166 of file RuleFit.h.
Referenced by BuildTree(), GetNTreeSample(), MakeForest(), and SetTrainingEvents().
|
private |
Definition at line 170 of file RuleFit.h.
Referenced by CalcImportance(), Copy(), EvalEvent(), FillLin(), FillVisHistCorr(), GetRuleEnsemble(), GetRuleEnsemblePtr(), Initialize(), InitPtrs(), MakeDebugHists(), MakeVisHists(), SetImportanceCut(), SetModelFull(), SetModelLinear(), SetModelRules(), SetMsgType(), and SetRuleMinDist().
|
private |
Definition at line 171 of file RuleFit.h.
Referenced by FitCoefficients(), GetRuleFitParams(), GetRuleFitParamsPtr(), Initialize(), InitPtrs(), SetGDNPathSteps(), SetGDPathStep(), SetGDTau(), and SetMsgType().
|
private |
Definition at line 163 of file RuleFit.h.
Referenced by Boost(), Copy(), GetTrainingEvent(), GetTrainingEvents(), GetTrainingEventWeight(), InitNEveEff(), RestoreEventWeights(), SaveEventWeights(), and SetTrainingEvents().
|
private |
Definition at line 164 of file RuleFit.h.
Referenced by BuildTree(), GetRndmSampleEvents(), MakeForest(), ReshuffleEvents(), and SetTrainingEvents().
|
private |
Definition at line 174 of file RuleFit.h.
Referenced by FillCorr(), FillCut(), FillLin(), SetVisHistsUseImp(), UseCoefficientsVisHists(), and UseImportanceVisHists().
|
staticprivate |