Ignore:
Timestamp:
06/27/05 10:45:56 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mranforest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mranforest/MRanForest.cc

    r2307 r7170  
    2424
    2525/////////////////////////////////////////////////////////////////////////////
    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//
    4144/////////////////////////////////////////////////////////////////////////////
    4245#include "MRanForest.h"
     
    5962// Default constructor.
    6063//
    61 MRanForest::MRanForest(const char *name, const char *title) : fNumTrees(100), fRanTree(NULL),fUsePriors(kFALSE)
     64MRanForest::MRanForest(const char *name, const char *title) : fNumTrees(100), fRanTree(NULL),fUsePriors(kFALSE), fUserVal(-1)
    6265{
    6366    fName  = name  ? name  : "MRanForest";
  • trunk/MagicSoft/Mars/mranforest/MRanForest.h

    r6479 r7170  
    7070    TArrayD fTreeHad;   //
    7171
     72    Double_t fUserVal;
     73
    7274    void InitHadEst(Int_t from, Int_t to, const TMatrix &m, TArrayI &jinbag);
    7375
     
    9193    void SetCurTree(MRanTree *rantree) { fRanTree=rantree; }
    9294    Bool_t AddTree(MRanTree *rantree);
     95    void SetUserVal(Double_t d) { fUserVal = d; }
    9396
    9497    // getter methods
     
    98101    MDataArray *GetRules() { return ((MRanTree*)(fForest->At(0)))->GetRules(); }
    99102
    100 
    101103    Int_t      GetNumTrees() const { return fNumTrees; }
    102104    Int_t      GetNumData()  const;
    103105    Int_t      GetNumDim()   const;
    104106    Double_t   GetTreeHad(Int_t i) const { return fTreeHad.At(i); }
     107    Double_t   GetUserVal() const { return fUserVal; }
    105108 
    106109    // use forest to calculate hadronness of event
     
    109112    Bool_t AsciiWrite(ostream &out) const;
    110113
    111     ClassDef(MRanForest, 1) // Storage container for tree structure
     114    ClassDef(MRanForest, 2) // Storage container for tree structure
    112115};
    113116
Note: See TracChangeset for help on using the changeset viewer.