Ignore:
Timestamp:
11/02/06 09:00:59 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mranforest
Files:
4 edited

Legend:

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

    r7425 r8203  
    11/* ======================================================================== *\
     2! $Name: not supported by cvs2svn $:$Id: MHRanForestGini.cc,v 1.7 2006-11-02 08:57:00 tbretz Exp $
     3! --------------------------------------------------------------------------
    24!
    35! *
     
    1719!
    1820!   Author(s): Thomas Hengstebeck 3/2003 <mailto:hengsteb@alwa02.physik.uni-siegen.de>
    19 !
    20 !   Copyright: MAGIC Software Development, 2000-2003
     21!   Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de>
     22!
     23!   Copyright: MAGIC Software Development, 2000-2006
    2124!
    2225!
     
    134137    // --- Produce some text information ---
    135138    fRules.AddText("");
    136     fRules.AddText(Form("%s w/ %d trees of node size %d trained by %d events",
     139    fRules.AddText(Form("%s w/ %d trees of node size %d trained by %d evts",
    137140                        fRanForest->IsClassify()?"Classification":"Regression",
    138141                        fRanForest->GetNumTrees(),
  • trunk/MagicSoft/Mars/mranforest/MRanForest.cc

    r8022 r8203  
    11/* ======================================================================== *\
     2! $Name: not supported by cvs2svn $:$Id: MRanForest.cc,v 1.26 2006-11-02 08:57:00 tbretz Exp $
     3! --------------------------------------------------------------------------
    24!
    35! *
     
    1719!
    1820!   Author(s): Thomas Hengstebeck 3/2003 <mailto:hengsteb@physik.hu-berlin.de>
     21!   Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de>
    1922!
    20 !   Copyright: MAGIC Software Development, 2000-2005
     23!   Copyright: MAGIC Software Development, 2000-2006
    2124!
    2225!
     
    498501    // error-estimates from out-of-bag data (oob data):
    499502    //
    500     // For a single tree the events not(!) contained in the bootstrap sample of
    501     // this tree can be used to obtain estimates for the classification error of
    502     // this tree.
    503     // If you take a certain event, it is contained in the oob-data of 1/3 of
    504     // the trees (see comment to ModifyData). This means that the classification error
    505     // determined from oob-data is underestimated, but can still be taken as upper limit.
    506 
     503    // For a single tree the events not(!) contained in the bootstrap
     504    // sample of this tree can be used to obtain estimates for the
     505    // classification error of this tree.
     506    // If you take a certain event, it is contained in the oob-data of
     507    // 1/3 of the trees (see comment to ModifyData). This means that the
     508    // classification error determined from oob-data is underestimated,
     509    // but can still be taken as upper limit.
    507510    Int_t ninbag = 0;
    508511    for (Int_t ievt=0;ievt<numdata;ievt++)
     
    584587        TMath::Sort(numdata,v.GetArray(),isort.GetArray(),kFALSE);
    585588
    586         // this sorts the v[n] in ascending order. isort[n] is the event number
    587         // of that v[n], which is the n-th from the lowest (assume the original
    588         // event numbers are 0,1,...).
     589        // this sorts the v[n] in ascending order. isort[n] is the
     590        // event number of that v[n], which is the n-th from the
     591        // lowest (assume the original event numbers are 0,1,...).
    589592
    590593        // control sorting
     
    608611            const Int_t n2=isort[n+1];
    609612
    610             // FIXME: Copying isort[n] to fDataSort[mvar*numdata] can be accelerated!
     613            // FIXME: Copying isort[n] to fDataSort[mvar*numdata]
     614            // can be accelerated!
    611615            fDataSort[mvar*numdata+n]=n1;
    612616            if(n==0) fDataRang[mvar*numdata+n1]=0;
  • trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc

    r8171 r8203  
    1 /* ================================q======================================== *\
     1/* ======================================================================== *\
     2! $Name: not supported by cvs2svn $:$Id: MRanForestCalc.cc,v 1.25 2006-11-02 08:57:00 tbretz Exp $
     3! --------------------------------------------------------------------------
    24!
    35! *
     
    1921!   Author(s): Thomas Bretz 8/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
    2022!
    21 !   Copyright: MAGIC Software Development, 2000-2005
     23!   Copyright: MAGIC Software Development, 2000-2006
    2224!
    2325!
  • trunk/MagicSoft/Mars/mranforest/MRanTree.cc

    r7804 r8203  
    8383void MRanTree::SetNdSize(Int_t n)
    8484{
    85     // threshold nodesize of terminal nodes, i.e. the training data is splitted
    86     // until there is only pure date in the subsets(=terminal nodes) or the
    87     // subset size is LE n
     85    // threshold nodesize of terminal nodes, i.e. the training data is
     86    // splitted until there is only pure date in the subsets(=terminal
     87    // nodes) or the subset size is LE n
    8888
    8989    fNdSize=TMath::Max(1,n);//at least 1 event per node
     
    163163    const Int_t mdim = fGiniDec.GetSize();
    164164
    165     // For the best split, msplit is the index of the variable (e.g Hillas par.,
    166     // zenith angle ,...)
    167     // split on. decsplit is the decreae in impurity measured by Gini-index.
    168     // nsplit is the case number of value of msplit split on,
     165    // For the best split, msplit is the index of the variable (e.g
     166    // Hillas par., zenith angle ,...)
     167    // split on. decsplit is the decreae in impurity measured by
     168    // Gini-index. nsplit is the case number of value of msplit split on,
    169169    // and nsplitnext is the case number of the next larger value of msplit.
    170170
     
    287287    const Int_t mdim = fGiniDec.GetSize();
    288288
    289     // For the best split, msplit is the index of the variable (e.g Hillas par., zenith angle ,...)
    290     // split on. decsplit is the decreae in impurity measured by Gini-index.
    291     // nsplit is the case number of value of msplit split on,
    292     // and nsplitnext is the case number of the next larger value of msplit.
     289    // For the best split, msplit is the index of the variable (e.g
     290    // Hillas par., zenith angle ,...) split on. decsplit is the decreae
     291    // in impurity measured by Gini-index. nsplit is the case number of
     292    // value of msplit split on, and nsplitnext is the case number of
     293    // the next larger value of msplit.
    293294
    294295    Int_t nbestvar=0;
     
    429430                        Int_t nbest,Int_t &ndendl)
    430431{
    431     // This is the heart of the BuildTree construction. Based on the best split
    432     // the data in the part of datasort corresponding to the current node is moved to the
    433     // left if it belongs to the left child and right if it belongs to the right child-node.
     432    // This is the heart of the BuildTree construction. Based on the
     433    // best split the data in the part of datasort corresponding to
     434    // the current node is moved to the left if it belongs to the left
     435    // child and right if it belongs to the right child-node.
    434436    const Int_t numdata = ncase.GetSize();
    435437    const Int_t mdim    = fGiniDec.GetSize();
     
    478480                         Int_t ninbag, const int nclass)
    479481{
    480     // Buildtree consists of repeated calls to two void functions, FindBestSplit and MoveData.
    481     // Findbestsplit does just that--it finds the best split of the current node.
    482     // MoveData moves the data in the split node right and left so that the data
    483     // corresponding to each child node is contiguous.
     482    // Buildtree consists of repeated calls to two void functions,
     483    // FindBestSplit and MoveData. Findbestsplit does just that--it finds
     484    // the best split of the current node. MoveData moves the data in
     485    // the split node right and left so that the data corresponding to
     486    // each child node is contiguous.
    484487    //
    485488    // buildtree bookkeeping:
    486     // ncur is the total number of nodes to date.  nodestatus(k)=1 if the kth node has been split.
    487     // nodestatus(k)=2 if the node exists but has not yet been split, and =-1 if the node is
    488     // terminal.  A node is terminal if its size is below a threshold value, or if it is all
    489     // one class, or if all the data-values are equal.  If the current node k is split, then its
    490     // children are numbered ncur+1 (left), and ncur+2(right), ncur increases to ncur+2 and
    491     // the next node to be split is numbered k+1.  When no more nodes can be split, buildtree
    492     // returns.
     489    // ncur is the total number of nodes to date.  nodestatus(k)=1 if
     490    // the kth node has been split. nodestatus(k)=2 if the node exists
     491    // but has not yet been split, and =-1 if the node is terminal.
     492    // A node is terminal if its size is below a threshold value, or
     493    // if it is all one class, or if all the data-values are equal.
     494    // If the current node k is split, then its children are numbered
     495    // ncur+1 (left), and ncur+2(right), ncur increases to ncur+2 and
     496    // the next node to be split is numbered k+1.  When no more nodes
     497    // can be split, buildtree returns.
    493498    const Int_t mdim    = fGiniDec.GetSize();
    494499    const Int_t nrnodes = fBestSplit.GetSize();
Note: See TracChangeset for help on using the changeset viewer.