Ignore:
Timestamp:
07/19/07 19:59:27 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjtrain
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc

    r8244 r8643  
    145145    rf.SetLogStream(fLog);
    146146    rf.SetFileName(out);
    147     rf.SetDebug(fDebug);
     147    rf.SetDebug(fDebug>1);
    148148    rf.SetNameOutput("Disp");
    149149
     
    251251    hist.GetAlphaFitter().Print("result");
    252252
    253     if (!WriteDisplay(out))
     253    if (!WriteDisplay(out, "UPDATE"))
    254254        return kFALSE;
    255255
  • trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.cc

    r8636 r8643  
    139139    rf.SetLogStream(fLog);
    140140    rf.SetFileName(out);
    141     rf.SetDebug(fDebug);
     141    rf.SetDebug(fDebug>1);
    142142    rf.SetNameOutput("MEnergyEst");
    143143
     
    193193        return kFALSE;
    194194
    195     if (!WriteDisplay(out))
     195    if (!WriteDisplay(out, "UPDATE"))
    196196        return kFALSE;
    197197
  • trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.cc

    r8091 r8643  
    1818!   Author(s): Thomas Bretz 11/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2005-2006
     20!   Copyright: MAGIC Software Development, 2005-2007
    2121!
    2222!
     
    2828//
    2929// Base class for classes training a random forest
     30//
     31// The order when reading a file is:
     32//   1) Execution of PreTasks  (set by user)
     33//   2) Execution of PreCuts   (set by user)
     34//   3) Selector               (calculated from number of requested events)
     35//   4) Splitter               (if sample is split automatically in test/train)
     36//   5) PostTasks              (set by user)
     37//
     38// The split into Pre- and PostTasks is done for speed reason. So, if
     39// you calculate a vlue which is not needed for your PreCuts, you can
     40// calculate it afterwards, which will speed up execution.
    3041//
    3142/////////////////////////////////////////////////////////////////////////////
     
    4556
    4657using namespace std;
    47 
     58/*
    4859//------------------------------------------------------------------------
    4960//
     
    120131    return kTRUE;
    121132}
     133*/
  • trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.h

    r7697 r8643  
    22#define MARS_MJTrainRanForest
    33
    4 #ifndef MARS_MJob
    5 #include "MJob.h"
     4#ifndef MARS_MJOptimizeBase
     5#include "MJOptimizeBase.h"
    66#endif
    77
     
    99class MFilter;
    1010
    11 class MJTrainRanForest : public MJob
     11class MJTrainRanForest : public MJOptimizeBase
    1212{
    1313protected:
    14     Bool_t fDebug;
    15     Bool_t fEnableWeights;
    16 
    17     TList fRules;
    18 
    19     TList fPreCuts;
    20     TList fTrainCuts;
    21     TList fTestCuts;
    22     TList fPreTasks;
    23     TList fPostTasks;
    24 
    2514    UShort_t fNumTrees;
    2615    UShort_t fNdSize;
    2716    UShort_t fNumTry;
    2817
    29     Bool_t WriteDisplay(const char *fname) const;
    30 
    31     void AddCut(TList &l, const char *rule);
    32     void AddPar(TList &l, const char *rule, const char *name);
    33     void Add(TList &l, MTask *f);
    34 
    3518public:
    36     MJTrainRanForest() : fDebug(kFALSE), fEnableWeights(kFALSE)
     19    MJTrainRanForest()
    3720    {
    3821        fNumTrees = 100; //100
     
    4124    }
    4225
    43     void AddPreTask(MTask *t)                    { Add(fPreTasks,  t); }
    44     void AddPreTask(const char *rule,
    45                     const char *name="MWeight")  { AddPar(fPreTasks, rule, name); }
    46 
    47     void AddPostTask(MTask *t)                   { Add(fPostTasks, t); }
    48     void AddPostTask(const char *rule,
    49                      const char *name="MWeight") { AddPar(fPostTasks, rule, name); }
    50 
    51     void SetDebug(Bool_t b=kTRUE)      { fDebug = b; }
    52 
    53     void SetWeights(const char *rule)  { if (fEnableWeights) return; fEnableWeights=kTRUE; AddPostTask(rule); }
    54     void SetWeights(MTask *t)          { if (fEnableWeights) return; fEnableWeights=kTRUE; AddPostTask(t);    }
    55 
    56     void AddPreCut(const char *rule)   { AddCut(fPreCuts, rule); }
    57     void AddPreCut(MFilter *f)         { Add(fPreCuts, (MTask*)(f)); }
    58 
    59     void AddTrainCut(const char *rule) { AddCut(fTrainCuts, rule); }
    60     void AddTrainCut(MFilter *f)       { Add(fTrainCuts, (MTask*)(f)); }
    61 
    62     void AddTestCut(const char *rule)  { AddCut(fTestCuts, rule); }
    63     void AddTestCut(MFilter *f)        { Add(fTestCuts, (MTask*)(f)); }
    64 
    6526    void SetNumTrees(UShort_t n=100)   { fNumTrees = n; }
    6627    void SetNdSize(UShort_t n=5)       { fNdSize   = n; }
    6728    void SetNumTry(UShort_t n=0)       { fNumTry   = n; }
    68 
    69     Int_t AddParameter(const char *rule);
    7029
    7130    ClassDef(MJTrainRanForest, 0)//Base class for Random Forest training classes
  • trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc

    r8223 r8643  
    802802    rf.SetNumObsoleteVariables(1);
    803803    rf.SetLastDataColumnHasWeights(fEnableWeights[kTrainOn] || fEnableWeights[kTrainOff]);
    804     rf.SetDebug(fDebug);
     804    rf.SetDebug(fDebug>1);
    805805    rf.SetDisplay(fDisplay);
    806806    rf.SetLogStream(fLog);
     
    10391039
    10401040    // Write the display
    1041     if (!WriteDisplay(out))
     1041    if (!WriteDisplay(out, "UPDATE"))
    10421042        return kFALSE;
    10431043
  • trunk/MagicSoft/Mars/mjtrain/Makefile

    r7702 r8643  
    2222           -I../manalysis -I../mfilter -I../mjobs -I../mtools \
    2323           -I../mranforest -I../mhflux -I../mmc -I../mhist -I../mpointing \
    24            -I../mimage
     24           -I../mimage -I../mjoptim
    2525
    2626SRCFILES = MJTrainRanForest.cc \
Note: See TracChangeset for help on using the changeset viewer.