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 #ifndef ROOT_TMVA_MethodFDA
00032 #define ROOT_TMVA_MethodFDA
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #ifndef ROOT_TMVA_MethodBase
00050 #include "TMVA/MethodBase.h"
00051 #endif
00052 #ifndef ROOT_TMVA_IFitterTarget
00053 #include "TMVA/IFitterTarget.h"
00054 #endif
00055
00056 class TFormula;
00057
00058 namespace TMVA {
00059
00060 class Interval;
00061 class Event;
00062 class FitterBase;
00063
00064 class MethodFDA : public MethodBase, public IFitterTarget {
00065
00066 public:
00067
00068 MethodFDA( const TString& jobName,
00069 const TString& methodTitle,
00070 DataSetInfo& theData,
00071 const TString& theOption = "",
00072 TDirectory* theTargetDir = 0 );
00073
00074 MethodFDA( DataSetInfo& theData,
00075 const TString& theWeightFile,
00076 TDirectory* theTargetDir = NULL );
00077
00078 virtual ~MethodFDA( void );
00079
00080 Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
00081
00082
00083 void Train( void );
00084
00085 using MethodBase::ReadWeightsFromStream;
00086
00087 void AddWeightsXMLTo ( void* parent ) const;
00088
00089 void ReadWeightsFromStream( std::istream & i );
00090 void ReadWeightsFromXML ( void* wghtnode );
00091
00092
00093 Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
00094
00095 virtual const std::vector<Float_t>& GetRegressionValues();
00096 virtual const std::vector<Float_t>& GetMulticlassValues();
00097
00098 void Init( void );
00099
00100
00101 const Ranking* CreateRanking() { return 0; }
00102
00103 Double_t EstimatorFunction( std::vector<Double_t>& );
00104
00105
00106 void CheckSetup() {}
00107
00108 protected:
00109
00110
00111 void MakeClassSpecific( std::ostream&, const TString& ) const;
00112
00113
00114 void GetHelpMessage() const;
00115
00116 private:
00117
00118
00119 void CalculateMulticlassValues( const TMVA::Event*& evt, std::vector<Double_t>& parameters, std::vector<Float_t>& values);
00120
00121
00122
00123 void CreateFormula ();
00124 Double_t InterpretFormula( const Event*, std::vector<Double_t>::iterator begin, std::vector<Double_t>::iterator end );
00125
00126
00127 void ClearAll();
00128
00129
00130 void PrintResults( const TString&, std::vector<Double_t>&, const Double_t ) const;
00131
00132
00133 void DeclareOptions();
00134 void ProcessOptions();
00135
00136 TString fFormulaStringP;
00137 TString fParRangeStringP;
00138 TString fFormulaStringT;
00139 TString fParRangeStringT;
00140
00141 TFormula* fFormula;
00142 UInt_t fNPars;
00143 std::vector<Interval*> fParRange;
00144 std::vector<Double_t> fBestPars;
00145 TString fFitMethod;
00146 TString fConverger;
00147 FitterBase* fFitter;
00148 IFitterTarget* fConvergerFitter;
00149
00150
00151
00152 Double_t fSumOfWeightsSig;
00153 Double_t fSumOfWeightsBkg;
00154 Double_t fSumOfWeights;
00155
00156
00157 Int_t fOutputDimensions;
00158
00159 ClassDef(MethodFDA,0)
00160 };
00161
00162 }
00163
00164 #endif // MethodFDA_H