33 #ifndef ROOT_TMVA_MethodSVM
34 #define ROOT_TMVA_MethodSVM
46 #ifndef ROOT_TMVA_TVectorD
55 class SVKernelFunction;
57 class MethodSVM :
public MethodBase {
61 MethodSVM(
const TString& jobName,
const TString& methodTitle, DataSetInfo& theData,
62 const TString& theOption =
"" );
64 MethodSVM( DataSetInfo& theData,
const TString& theWeightFile);
66 virtual ~MethodSVM(
void );
68 virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
71 virtual std::map<TString,Double_t> OptimizeTuningParameters(TString fomType=
"ROCIntegral", TString fitType=
"Minuit");
72 virtual void SetTuneParameters(std::map<TString,Double_t> tuneParameters);
73 std::vector<TMVA::SVKernelFunction::EKernelType> MakeKernelList(std::string multiKernels, TString kernel);
74 std::map< TString,std::vector<Double_t> > GetTuningOptions();
82 using MethodBase::ReadWeightsFromStream;
85 void WriteWeightsToStream( TFile& fout )
const;
86 void AddWeightsXMLTo (
void* parent )
const;
89 void ReadWeightsFromStream( std::istream& istr );
90 void ReadWeightsFromStream( TFile& fFin );
91 void ReadWeightsFromXML (
void* wghtnode );
94 Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
95 const std::vector<Float_t>& GetRegressionValues();
100 const Ranking* CreateRanking() {
return 0; }
103 void SetGamma(Double_t g){fGamma = g;}
104 void SetCost(Double_t c){fCost = c;}
105 void SetMGamma(std::string & mg);
106 void SetOrder(Double_t o){fOrder = o;}
107 void SetTheta(Double_t t){fTheta = t;}
108 void SetKappa(Double_t k){fKappa = k;}
109 void SetMult(Double_t m){fMult = m;}
111 void GetMGamma(
const std::vector<float> & gammas);
116 void MakeClassSpecific( std::ostream&,
const TString& )
const;
119 void GetHelpMessage()
const;
124 void DeclareOptions();
125 void DeclareCompatibilityOptions();
126 void ProcessOptions();
127 Double_t getLoss( TString lossFunction );
135 SVWorkingSet* fWgSet;
136 std::vector<TMVA::SVEvent*>* fInputData;
137 std::vector<TMVA::SVEvent*>* fSupportVectors;
138 SVKernelFunction* fSVKernelFunction;
145 Float_t fDoubleSigmaSquared;
150 std::vector<Float_t> fmGamma;
152 std::vector<TString> fVarNames;
154 std::string fGammaList;
156 std::string fMultiKernels;
161 ClassDef(MethodSVM,0);
166 #endif // MethodSVM_H