Changeset 7170 for trunk/MagicSoft/Mars/mranforest
- Timestamp:
- 06/27/05 10:45:56 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mranforest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mranforest/MRanForest.cc
r2307 r7170 24 24 25 25 ///////////////////////////////////////////////////////////////////////////// 26 // // 27 // MRanForest // 28 // // 29 // ParameterContainer for Forest structure // 30 // // 31 // A random forest can be grown by calling GrowForest. // 32 // In advance SetupGrow must be called in order to initialize arrays and // 33 // do some preprocessing. // 34 // GrowForest() provides the training data for a single tree (bootstrap // 35 // aggregate procedure) // 36 // // 37 // Essentially two random elements serve to provide a "random" forest, // 38 // namely bootstrap aggregating (which is done in GrowForest()) and random // 39 // split selection (which is subject to MRanTree::GrowTree()) // 40 // // 26 // 27 // MRanForest 28 // 29 // ParameterContainer for Forest structure 30 // 31 // A random forest can be grown by calling GrowForest. 32 // In advance SetupGrow must be called in order to initialize arrays and 33 // do some preprocessing. 34 // GrowForest() provides the training data for a single tree (bootstrap 35 // aggregate procedure) 36 // 37 // Essentially two random elements serve to provide a "random" forest, 38 // namely bootstrap aggregating (which is done in GrowForest()) and random 39 // split selection (which is subject to MRanTree::GrowTree()) 40 // 41 // Version 2: 42 // + fUserVal 43 // 41 44 ///////////////////////////////////////////////////////////////////////////// 42 45 #include "MRanForest.h" … … 59 62 // Default constructor. 60 63 // 61 MRanForest::MRanForest(const char *name, const char *title) : fNumTrees(100), fRanTree(NULL),fUsePriors(kFALSE) 64 MRanForest::MRanForest(const char *name, const char *title) : fNumTrees(100), fRanTree(NULL),fUsePriors(kFALSE), fUserVal(-1) 62 65 { 63 66 fName = name ? name : "MRanForest"; -
trunk/MagicSoft/Mars/mranforest/MRanForest.h
r6479 r7170 70 70 TArrayD fTreeHad; // 71 71 72 Double_t fUserVal; 73 72 74 void InitHadEst(Int_t from, Int_t to, const TMatrix &m, TArrayI &jinbag); 73 75 … … 91 93 void SetCurTree(MRanTree *rantree) { fRanTree=rantree; } 92 94 Bool_t AddTree(MRanTree *rantree); 95 void SetUserVal(Double_t d) { fUserVal = d; } 93 96 94 97 // getter methods … … 98 101 MDataArray *GetRules() { return ((MRanTree*)(fForest->At(0)))->GetRules(); } 99 102 100 101 103 Int_t GetNumTrees() const { return fNumTrees; } 102 104 Int_t GetNumData() const; 103 105 Int_t GetNumDim() const; 104 106 Double_t GetTreeHad(Int_t i) const { return fTreeHad.At(i); } 107 Double_t GetUserVal() const { return fUserVal; } 105 108 106 109 // use forest to calculate hadronness of event … … 109 112 Bool_t AsciiWrite(ostream &out) const; 110 113 111 ClassDef(MRanForest, 1) // Storage container for tree structure114 ClassDef(MRanForest, 2) // Storage container for tree structure 112 115 }; 113 116
Note:
See TracChangeset
for help on using the changeset viewer.