File indexing completed on 2025-01-18 10:11:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef ROOT_TMVA_MethodCompositeBase
0032 #define ROOT_TMVA_MethodCompositeBase
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 #include <iosfwd>
0043 #include <vector>
0044
0045 #include "TMVA/MethodBase.h"
0046
0047 namespace TMVA {
0048 class IMethod;
0049
0050 class MethodCompositeBase : public MethodBase {
0051
0052 public :
0053 MethodCompositeBase( const TString& jobName,
0054 Types::EMVA methodType,
0055 const TString& methodTitle,
0056 DataSetInfo& theData,
0057 const TString& theOption = "" );
0058
0059
0060 MethodCompositeBase( Types::EMVA methodType,
0061 DataSetInfo& dsi,
0062 const TString& weightFile );
0063
0064 using MethodBase::ReadWeightsFromStream;
0065
0066
0067 void AddWeightsXMLTo( void* parent ) const;
0068 void ReadWeightsFromXML( void* wghtnode );
0069
0070
0071 Double_t GetMvaValue( Double_t* err = nullptr, Double_t* errUpper = nullptr );
0072
0073 using MethodBase::GetMvaValue;
0074
0075
0076 void ReadWeightsFromStream( std::istream& istr );
0077
0078
0079 virtual void Train() = 0;
0080
0081
0082 virtual const Ranking* CreateRanking() = 0;
0083
0084 virtual ~MethodCompositeBase( void );
0085
0086 protected:
0087
0088 void DeclareOptions() = 0;
0089 void ProcessOptions() = 0;
0090
0091 IMethod* GetMethod( const TString& title ) const;
0092
0093 IMethod* GetMethod( const Int_t index ) const;
0094
0095
0096 UInt_t fCurrentMethodIdx;
0097 MethodBase* fCurrentMethod;
0098 UInt_t GetCurrentMethodIndex() { return fCurrentMethodIdx; }
0099
0100 IMethod* GetLastMethod() { return fMethods.back(); }
0101
0102 IMethod* GetPreviousMethod() { return (fCurrentMethodIdx>0)?fMethods[fCurrentMethodIdx-1]:nullptr; }
0103
0104 MethodBase* GetCurrentMethod(){ return fCurrentMethod;}
0105 MethodBase* GetCurrentMethod(UInt_t idx){return dynamic_cast<MethodBase*>(fMethods.at(idx)); }
0106
0107
0108
0109 std::vector<IMethod*> fMethods;
0110
0111
0112 std::vector<Double_t> fMethodWeight;
0113
0114 ClassDef(MethodCompositeBase,0);
0115
0116 };
0117 }
0118
0119 #endif
0120