Changeset 7425 for trunk/MagicSoft/Mars/mranforest
- Timestamp:
- 11/22/05 17:40:37 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mranforest
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mranforest/MHRanForestGini.cc
r7419 r7425 134 134 // --- Produce some text information --- 135 135 fRules.AddText(""); 136 fRules.AddText(Form("%d trees trained with %d events", fRanForest->GetNumTrees(), 136 fRules.AddText(Form("%s w/ %d trees of node size %d trained by %d events", 137 fRanForest->IsClassify()?"Classification":"Regression", 138 fRanForest->GetNumTrees(), 139 fRanForest->GetNdSize(), 137 140 fRanForest->GetNumData())); 138 fRules.AddText("---"); 141 fRules.AddText("---");//Form("---> %s", fRanForest->GetTargetRule().Data())); 142 139 143 const MDataArray &arr = *fRanForest->GetRules(); 144 140 145 int i; 141 146 for (i=0; i<arr.GetNumEntries(); i++) 142 { 143 TString s; 144 s += i+1; 145 s += ") "; 146 s += arr.GetRule(i); 147 fRules.AddText(s); 148 } 147 fRules.AddText(Form("%d) %s", i+1, arr.GetRule(i).Data())); 148 149 149 for (; i<20; i++) 150 150 fRules.AddText(""); -
trunk/MagicSoft/Mars/mranforest/MRanForest.cc
r7424 r7425 201 201 } 202 202 203 MRanTree *MRanForest::GetTree(Int_t i) const 204 { 205 return static_cast<MRanTree*>(fForest->UncheckedAt(i)); 206 } 207 203 208 Int_t MRanForest::GetNumDim() const 204 209 { … … 372 377 return kFALSE; 373 378 } 374 fRanTree->SetName(target_rule);379 //fRanTree->SetName(target_rule); // Is not stored anyhow 375 380 376 381 const Int_t tryest = TMath::Nint(TMath::Sqrt(dim)); -
trunk/MagicSoft/Mars/mranforest/MRanForest.h
r7424 r7425 97 97 TObjArray *GetForest() const { return fForest; } 98 98 MRanTree *GetCurTree() const { return fRanTree; } 99 MRanTree *GetTree(Int_t i) const { return static_cast<MRanTree*>(fForest->UncheckedAt(i)); }99 MRanTree *GetTree(Int_t i) const; 100 100 MDataArray *GetRules() const { return fRules; } 101 101 … … 104 104 Int_t GetNumData() const; 105 105 Int_t GetNumDim() const; 106 Int_t GetNdSize() const { return fNdSize; } 106 107 Int_t GetNclass() const; 107 108 Double_t GetTreeHad(Int_t i) const { return fTreeHad.At(i); } 108 109 Double_t GetUserVal() const { return fUserVal; } 109 110 Bool_t IsClassify() const { return fClassify; } 111 110 112 // use forest to calculate hadronness of event 111 113 Double_t CalcHadroness(const TVector &event); -
trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc
r7424 r7425 311 311 if (fEForests.GetEntriesFast()==1) 312 312 { 313 MRanForest *rf = static_cast<MRanForest*> fEForests.UncheckedAt(0);313 MRanForest *rf = static_cast<MRanForest*>(fEForests.UncheckedAt(0)); 314 314 fRFOut->SetVal(rf->CalcHadroness(event)); 315 315 fRFOut->SetReadyToSave(); -
trunk/MagicSoft/Mars/mranforest/MRanForestCalc.h
r7423 r7425 71 71 72 72 // TObject 73 void Print(Option_t *o="") const; 73 void Print(Option_t *o="") const; //*MENU* 74 74 75 75 // Setter for estimation
Note:
See TracChangeset
for help on using the changeset viewer.