43 fLogger(new MsgLogger(
"RuleFit"))
72 UInt_t nnodes = nodes.size();
74 Log() << kWARNING <<
"<MakeCuts()> Empty cut created." <<
Endl;
85 typedef std::pair<Double_t,Int_t> CutDir_t;
86 typedef std::pair<Int_t,CutDir_t> SelCut_t;
97 std::list<SelCut_t> allsel;
101 const Node *nextNode;
102 for (
UInt_t i=0; i<nnodes-1; i++) {
103 nextNode = nodes[i+1];
108 if (nodes[i]->GetRight() == nextNode) {
111 else if (nodes[i]->GetLeft() == nextNode) {
115 Log() << kFATAL <<
"<MakeTheRule> BUG! Should not be here - an end-node before the end!" <<
Endl;
118 allsel.push_back(SelCut_t(sel,CutDir_t(val,dir)));
126 for ( std::list<SelCut_t>::const_iterator it = allsel.begin(); it!=allsel.end(); it++ ) {
128 val = (*it).second.first;
129 dir = (*it).second.second;
142 if ((val<
fCutMin[nsel-1]) || firstMin) {
149 if ((val>
fCutMax[nsel-1]) || firstMax) {
186 done = (foundIt || (ind==
fSelector.size()));
188 if (!foundIt)
return kFALSE;
MsgLogger & Endl(MsgLogger &ml)
Float_t GetNEvents(void) const
Bool_t GetCutRange(Int_t sel, Double_t &rmin, Double_t &rmax, Bool_t &dormin, Bool_t &dormax) const
get cut range for a given selector
std::vector< Double_t > fCutMax
std::vector< Char_t > fCutDoMin
Float_t GetCutValue(void) const
RuleCut()
empty constructor
std::vector< Char_t > fCutDoMax
std::vector< UInt_t > fSelector
UInt_t GetNcuts() const
get number of cuts
Float_t GetPurity(void) const
ostringstream derivative to redirect and format output
void MakeCuts(const std::vector< const TMVA::Node * > &nodes)
Construct the cuts from the given array of nodes.
Node for the BinarySearch or Decision Trees.
std::vector< Double_t > fCutMin
virtual ~RuleCut()
destructor
Short_t GetSelector() const