Changeset 2307 for trunk/MagicSoft/Mars/mranforest
- Timestamp:
- 08/20/03 11:37:37 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mranforest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mranforest/MRanTree.cc
r2297 r2307 140 140 const TArrayF &winbag) 141 141 { 142 if(!gRandom)143 {144 *fLog << err << dbginf << "gRandom not initialized... aborting." << endl;145 return kFALSE;146 }147 148 142 const Int_t nrnodes = fBestSplit.GetSize(); 149 143 const Int_t numdata = (nrnodes-1)/2; … … 182 176 for(Int_t mt=0;mt<fNumTry;mt++) 183 177 { 184 Int_t mvar=Int_t(gRandom->Rndm()*mdim); 178 const Int_t mvar=Int_t(gRandom->Rndm()*mdim); 179 const Int_t mn = mvar*numdata; 185 180 186 181 // Gini index = rrn/rrd+rln/rld … … 197 192 for(Int_t nsp=ndstart;nsp<=ndend-1;nsp++) 198 193 { 199 const Int_t &nc=datasort[m var*numdata+nsp];194 const Int_t &nc=datasort[mn+nsp]; 200 195 const Int_t &k=hadtrue[nc]; 201 196 … … 210 205 wr[k]-=u; 211 206 212 if (datarang[m var*numdata+nc]>=datarang[mvar*numdata+datasort[mvar*numdata+nsp+1]])207 if (datarang[mn+nc]>=datarang[mn+datasort[mn+nsp+1]]) 213 208 continue; 214 209 if (TMath::Min(rrd,rld)<=1.0e-5) -
trunk/MagicSoft/Mars/mranforest/MRanTree.h
r2297 r2307 37 37 TArrayF fGiniDec; 38 38 39 Int_t FindBestSplit(const TArrayI &datasort, const TArrayI &datarang, 40 const TArrayI &hadtrue, 41 Int_t ndstart, Int_t ndend, TArrayF &tclasspop, 42 Int_t &msplit, Float_t &decsplit, Int_t &nbest, 43 const TArrayF &winbag); 44 45 void MoveData(TArrayI &datasort, Int_t ndstart, Int_t ndend, 46 TArrayI &idmove, TArrayI &ncase, Int_t msplit, 47 Int_t nbest, Int_t &ndendl); 48 49 void BuildTree(TArrayI &datasort, const TArrayI &datarang, 50 const TArrayI &hadtrue, 51 TArrayI &bestsplit,TArrayI &bestsplitnext, 52 TArrayF &tclasspop, 53 const TArrayF &winbag, 54 Int_t ninbag); 55 39 56 public: 40 57 MRanTree(const char *name=NULL, const char *title=NULL); … … 66 83 TArrayF &tclasspop, TArrayI &jinbag, const TArrayF &winbag); 67 84 68 Int_t FindBestSplit(const TArrayI &datasort, const TArrayI &datarang,69 const TArrayI &hadtrue,70 Int_t ndstart, Int_t ndend, TArrayF &tclasspop,71 Int_t &msplit, Float_t &decsplit, Int_t &nbest,72 const TArrayF &winbag);73 74 void MoveData(TArrayI &datasort, Int_t ndstart, Int_t ndend,75 TArrayI &idmove, TArrayI &ncase, Int_t msplit,76 Int_t nbest, Int_t &ndendl);77 78 void BuildTree(TArrayI &datasort, const TArrayI &datarang,79 const TArrayI &hadtrue,80 TArrayI &bestsplit,TArrayI &bestsplitnext,81 TArrayF &tclasspop,82 const TArrayF &winbag,83 Int_t ninbag);84 85 85 Double_t TreeHad(const TVector &event); 86 86 Double_t TreeHad(const TMatrixRow &event);
Note:
See TracChangeset
for help on using the changeset viewer.