source: trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.h@ 7591

Last change on this file since 7591 was 7552, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 1.4 KB
Line 
1#ifndef MARS_MJTrainRanForest
2#define MARS_MJTrainRanForest
3
4#ifndef MARS_MJob
5#include "MJob.h"
6#endif
7
8class MFilter;
9
10class MJTrainRanForest : public MJob
11{
12protected:
13 Bool_t fDebug;
14
15 TList fRules;
16
17 TList fPreCuts;
18 TList fTrainCuts;
19 TList fTestCuts;
20
21 UShort_t fNumTrees;
22 UShort_t fNdSize;
23 UShort_t fNumTry;
24
25 Bool_t WriteDisplay(const char *fname) const;
26
27 void AddCut(TList &l, const char *rule);
28 void AddCut(TList &l, MFilter *f);
29
30public:
31 MJTrainRanForest() : fDebug(kFALSE)
32 {
33 fNumTrees = 100; //100
34 fNumTry = 0; //3 0 means: in MRanForest estimated best value will be calculated
35 fNdSize = 1; //1
36 }
37
38 void SetDebug(Bool_t b=kTRUE) { fDebug = b; }
39
40 void AddPreCut(const char *rule) { AddCut(fPreCuts, rule); }
41 void AddPreCut(MFilter *f) { AddCut(fPreCuts, f); }
42
43 void AddTrainCut(const char *rule) { AddCut(fTrainCuts, rule); }
44 void AddTrainCut(MFilter *f) { AddCut(fTrainCuts, f); }
45
46 void AddTestCut(const char *rule) { AddCut(fTestCuts, rule); }
47 void AddTestCut(MFilter *f) { AddCut(fTestCuts, f); }
48
49 void SetNumTrees(UShort_t n=100) { fNumTrees = n; }
50 void SetNdSize(UShort_t n=5) { fNdSize = n; }
51 void SetNumTry(UShort_t n=0) { fNumTry = n; }
52
53 Int_t AddParameter(const char *rule);
54
55 ClassDef(MJTrainRanForest, 0)//Base class for Random Forest training classes
56};
57
58#endif
Note: See TracBrowser for help on using the repository browser.