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_MethodCompositeBase
00032 #define ROOT_TMVA_MethodCompositeBase
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 #include <iosfwd>
00043 #include <vector>
00044 
00045 #ifndef ROOT_TMVA_MethodBase
00046 #include "TMVA/MethodBase.h"
00047 #endif
00048 
00049 namespace TMVA {
00050    class IMethod;
00051 
00052    class MethodCompositeBase : public MethodBase {
00053 
00054    public :
00055       MethodCompositeBase( const TString& jobName,
00056                            Types::EMVA methodType,
00057                            const TString& methodTitle,
00058                            DataSetInfo& theData,
00059                            const TString& theOption = "",
00060                            TDirectory* theTargetDir = NULL );
00061 
00062 
00063       MethodCompositeBase( Types::EMVA methodType,
00064                            DataSetInfo& dsi,
00065                            const TString& weightFile,
00066                            TDirectory* theBaseDir = 0 );
00067 
00068       using MethodBase::ReadWeightsFromStream;
00069 
00070       
00071       void AddWeightsXMLTo( void* parent ) const;
00072       void ReadWeightsFromXML( void* wghtnode );
00073 
00074       
00075       Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
00076 
00077       using MethodBase::GetMvaValue;
00078 
00079       
00080       void ReadWeightsFromStream( istream& istr );
00081 
00082       
00083       virtual void Train() = 0;
00084 
00085       
00086       virtual const Ranking* CreateRanking() = 0;
00087 
00088       virtual ~MethodCompositeBase( void );
00089 
00090       UInt_t GetMethodIndex() { return fMethodIndex; }
00091 
00092       IMethod* GetLastMethod() { return fMethods.back(); }
00093 
00094       IMethod* GetPreviousMethod() { return (fMethodIndex>0)?fMethods[fMethodIndex-1]:0; }
00095 
00096       IMethod* GetCurrentMethod()
00097       { return (fMethodIndex>0)?fMethods[fMethodIndex]:0; }
00098 
00099    protected:
00100 
00101       void DeclareOptions() = 0;
00102       void ProcessOptions() = 0;
00103 
00104       IMethod* GetMethod( const TString& title ) const;  
00105 
00106       IMethod* GetMethod( const Int_t index ) const;  
00107 
00108       
00109       Int_t          fMethodIndex;
00110 
00111       std::vector<IMethod*>      fMethods;          
00112 
00113       
00114       std::vector<Double_t>      fMethodWeight;
00115 
00116       ClassDef(MethodCompositeBase,0)
00117 
00118    };
00119 }
00120 
00121 #endif
00122