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
00028
00029
00030
00031
00032
00033 #ifndef ROOT_TMVA_MethodSVM
00034 #define ROOT_TMVA_MethodSVM
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef ROOT_TMVA_MethodBase
00045 #include "TMVA/MethodBase.h"
00046 #endif
00047 #ifndef ROOT_TMVA_TMatrixD
00048 #ifndef ROOT_TMatrixDfwd
00049 #include "TMatrixDfwd.h"
00050 #endif
00051 #endif
00052 #ifndef ROOT_TMVA_TVectorD
00053 #ifndef ROOT_TVectorD
00054 #include "TVectorD.h"
00055 #endif
00056 #endif
00057
00058 namespace TMVA
00059 {
00060 class SVWorkingSet;
00061 class SVEvent;
00062 class SVKernelFunction;
00063
00064 class MethodSVM : public MethodBase {
00065
00066 public:
00067
00068 MethodSVM( const TString& jobName, const TString& methodTitle, DataSetInfo& theData,
00069 const TString& theOption = "", TDirectory* theTargetDir = 0 );
00070
00071 MethodSVM( DataSetInfo& theData, const TString& theWeightFile, TDirectory* theTargetDir = NULL );
00072
00073 virtual ~MethodSVM( void );
00074
00075 virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
00076
00077
00078 void Train( void );
00079
00080 using MethodBase::ReadWeightsFromStream;
00081
00082
00083 void WriteWeightsToStream( TFile& fout ) const;
00084 void AddWeightsXMLTo ( void* parent ) const;
00085
00086
00087 void ReadWeightsFromStream( std::istream& istr );
00088 void ReadWeightsFromStream( TFile& fFin );
00089 void ReadWeightsFromXML ( void* wghtnode );
00090
00091
00092 Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
00093 const std::vector<Float_t>& GetRegressionValues();
00094
00095 void Init( void );
00096
00097
00098 const Ranking* CreateRanking() { return 0; }
00099
00100 protected:
00101
00102
00103 void MakeClassSpecific( std::ostream&, const TString& ) const;
00104
00105
00106 void GetHelpMessage() const;
00107
00108 private:
00109
00110
00111 void DeclareOptions();
00112 void DeclareCompatibilityOptions();
00113 void ProcessOptions();
00114
00115 Float_t fCost;
00116 Float_t fTolerance;
00117 UInt_t fMaxIter;
00118 UShort_t fNSubSets;
00119 Float_t fBparm;
00120 Float_t fGamma;
00121 SVWorkingSet* fWgSet;
00122 std::vector<TMVA::SVEvent*>* fInputData;
00123 std::vector<TMVA::SVEvent*>* fSupportVectors;
00124 SVKernelFunction* fSVKernelFunction;
00125
00126 TVectorD* fMinVars;
00127 TVectorD* fMaxVars;
00128
00129
00130 TString fTheKernel;
00131 Float_t fDoubleSigmaSquared;
00132 Int_t fOrder;
00133 Float_t fTheta;
00134 Float_t fKappa;
00135
00136 ClassDef(MethodSVM,0)
00137 };
00138
00139 }
00140
00141 #endif // MethodSVM_H