ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/src/GBRForest.cxx
Revision: 1.1
Committed: Wed Sep 28 00:08:48 2011 UTC (13 years, 7 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2
Log Message:
optimized bdt implementation for regression, so that disk and memory requirements are manageable

File Contents

# User Rev Content
1 bendavid 1.1
2    
3    
4     #include "../interface/GBRForest.h"
5     //#include <iostream>
6     #include "TMVA/DecisionTree.h"
7     #include "TMVA/MethodBDT.h"
8    
9    
10     ClassImp(GBRForest)
11    
12    
13     //_______________________________________________________________________
14     GBRForest::GBRForest() :
15     fInitialResponse(0.)
16     {
17    
18     }
19    
20     //_______________________________________________________________________
21     GBRForest::~GBRForest()
22     {
23     for (UInt_t i=0; i<fTrees.size(); ++i) {
24     delete fTrees.at(i);
25     }
26     }
27    
28     //_______________________________________________________________________
29     GBRForest::GBRForest(const TMVA::MethodBDT *bdt) :
30     TNamed("GBRForest","GBRForest"),
31     fInitialResponse(bdt->GetBoostWeights().front())
32     {
33    
34     const std::vector<TMVA::DecisionTree*> &forest = bdt->GetForest();
35     for (std::vector<TMVA::DecisionTree*>::const_iterator it=forest.begin(); it!=forest.end(); ++it) {
36     GBRTree *tree = new GBRTree(*it);
37     fTrees.push_back(tree);
38     }
39     }
40    
41    
42