00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ROOT_TMVA_MethodDT
00028 #define ROOT_TMVA_MethodDT
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include <vector>
00039 #ifndef ROOT_TH1
00040 #include "TH1.h"
00041 #endif
00042 #ifndef ROOT_TH2
00043 #include "TH2.h"
00044 #endif
00045 #ifndef ROOT_TTree
00046 #include "TTree.h"
00047 #endif
00048 #ifndef ROOT_TMVA_MethodBase
00049 #include "TMVA/MethodBase.h"
00050 #endif
00051 #ifndef ROOT_TMVA_DecisionTree
00052 #include "TMVA/DecisionTree.h"
00053 #endif
00054 #ifndef ROOT_TMVA_Event
00055 #include "TMVA/Event.h"
00056 #endif
00057
00058 namespace TMVA {
00059 class MethodBoost;
00060
00061 class MethodDT : public MethodBase {
00062 public:
00063 MethodDT( const TString& jobName,
00064 const TString& methodTitle,
00065 DataSetInfo& theData,
00066 const TString& theOption = "",
00067 TDirectory* theTargetDir = 0 );
00068
00069 MethodDT( DataSetInfo& dsi,
00070 const TString& theWeightFile,
00071 TDirectory* theTargetDir = NULL );
00072
00073 virtual ~MethodDT( void );
00074
00075 virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
00076
00077 void Train( void );
00078
00079 using MethodBase::ReadWeightsFromStream;
00080
00081
00082 void AddWeightsXMLTo( void* parent ) const;
00083
00084
00085 void ReadWeightsFromStream( istream& istr );
00086 void ReadWeightsFromXML ( void* wghtnode );
00087
00088
00089 Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
00090
00091
00092 void DeclareOptions();
00093 void ProcessOptions();
00094
00095 void GetHelpMessage() const;
00096
00097
00098 const Ranking* CreateRanking();
00099
00100 Double_t PruneTree(const Int_t methodIndex);
00101
00102 Double_t TestTreeQuality( DecisionTree *dt );
00103
00104 Double_t GetPruneStrength () { return fPruneStrength; }
00105
00106 Bool_t MonitorBoost( MethodBoost* booster);
00107
00108 private:
00109
00110 void Init( void );
00111
00112 private:
00113
00114 std::vector<Event*> fEventSample;
00115
00116 DecisionTree* fTree;
00117
00118 SeparationBase *fSepType;
00119 TString fSepTypeS;
00120 Int_t fNodeMinEvents;
00121
00122 Int_t fNCuts;
00123 Bool_t fUseYesNoLeaf;
00124 Double_t fNodePurityLimit;
00125 UInt_t fNNodesMax;
00126 UInt_t fMaxDepth;
00127
00128
00129 Double_t fErrorFraction;
00130 Double_t fPruneStrength;
00131 DecisionTree::EPruneMethod fPruneMethod;
00132 TString fPruneMethodS;
00133 Bool_t fAutomatic;
00134 Bool_t fRandomisedTrees;
00135 Int_t fUseNvars;
00136 Bool_t fPruneBeforeBoost;
00137
00138 std::vector<Double_t> fVariableImportance;
00139
00140 Double_t fDeltaPruneStrength;
00141
00142 static const Int_t fgDebugLevel = 0;
00143
00144 ClassDef(MethodDT,0)
00145
00146 };
00147 }
00148
00149 #endif