Logo ROOT  
Reference Guide
MethodCompositeBase.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss,Or Cohen
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : MethodCompositeBase *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Virtual base class for all MVA method *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
16  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
17  * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada *
18  * Or Cohen <orcohenor@gmail.com> - Weizmann Inst., Israel *
19  * *
20  * Copyright (c) 2005: *
21  * CERN, Switzerland *
22  * U. of Victoria, Canada *
23  * MPI-K Heidelberg, Germany *
24  * LAPP, Annecy, France *
25  * *
26  * Redistribution and use in source and binary forms, with or without *
27  * modification, are permitted according to the terms listed in LICENSE *
28  * (http://tmva.sourceforge.net/LICENSE) *
29  **********************************************************************************/
30 
31 #ifndef ROOT_TMVA_MethodCompositeBase
32 #define ROOT_TMVA_MethodCompositeBase
33 
34 //////////////////////////////////////////////////////////////////////////
35 // //
36 // MethodCompositeBase //
37 // //
38 // Virtual base class for combining several TMVA method //
39 // //
40 //////////////////////////////////////////////////////////////////////////
41 
42 #include <iosfwd>
43 #include <vector>
44 
45 #include "TMVA/MethodBase.h"
46 
47 namespace TMVA {
48  class IMethod;
49 
51 
52  public :
53  MethodCompositeBase( const TString& jobName,
54  Types::EMVA methodType,
55  const TString& methodTitle,
56  DataSetInfo& theData,
57  const TString& theOption = "" );
58 
59 
60  MethodCompositeBase( Types::EMVA methodType,
61  DataSetInfo& dsi,
62  const TString& weightFile );
63 
65 
66  // write weights to file
67  void AddWeightsXMLTo( void* parent ) const;
68  void ReadWeightsFromXML( void* wghtnode );
69 
70  // calculate the MVA value combining all classifiers according to thier fMethodWeight
71  Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
72 
74 
75  // read weights from file
76  void ReadWeightsFromStream( std::istream& istr );
77 
78  // performs classifier training
79  virtual void Train() = 0;
80 
81  // create ranking
82  virtual const Ranking* CreateRanking() = 0;
83 
84  virtual ~MethodCompositeBase( void );
85 
86  protected:
87 
88  void DeclareOptions() = 0;
89  void ProcessOptions() = 0;
90 
91  IMethod* GetMethod( const TString& title ) const; // accessor by name
92 
93  IMethod* GetMethod( const Int_t index ) const; // accessor by index in vector
94 
95  //the index of the classifier currently boosted
99 
100  IMethod* GetLastMethod() { return fMethods.back(); }
101 
103 
105  MethodBase* GetCurrentMethod(UInt_t idx){return dynamic_cast<MethodBase*>(fMethods.at(idx)); }
106 
107 
108 
109  std::vector<IMethod*> fMethods; // vector of all classifiers
110 
111  //the weight of every classifier used in the GetMVA method
112  std::vector<Double_t> fMethodWeight;
113 
115 
116  };
117 }
118 
119 #endif
120 
TMVA::MethodCompositeBase::Train
virtual void Train()=0
TMVA::MethodCompositeBase::DeclareOptions
void DeclareOptions()=0
TMVA::MethodBase::ReadWeightsFromStream
virtual void ReadWeightsFromStream(std::istream &)=0
TMVA::Ranking
Ranking for variables in method (implementation)
Definition: Ranking.h:48
TMVA::MethodCompositeBase::~MethodCompositeBase
virtual ~MethodCompositeBase(void)
delete methods
Definition: MethodCompositeBase.cxx:141
TMVA::MethodCompositeBase::GetLastMethod
IMethod * GetLastMethod()
Definition: MethodCompositeBase.h:100
MethodBase.h
TString
Basic string class.
Definition: TString.h:136
TMVA::MethodCompositeBase::GetCurrentMethodIndex
UInt_t GetCurrentMethodIndex()
Definition: MethodCompositeBase.h:98
TMVA::MethodCompositeBase
Virtual base class for combining several TMVA method.
Definition: MethodCompositeBase.h:50
TMVA::MethodCompositeBase::fMethodWeight
std::vector< Double_t > fMethodWeight
Definition: MethodCompositeBase.h:112
TMVA::MethodBase::GetMvaValue
virtual Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)=0
TMVA::MethodCompositeBase::AddWeightsXMLTo
void AddWeightsXMLTo(void *parent) const
Definition: MethodCompositeBase.cxx:114
TMVA::DataSetInfo
Class that contains all the data information.
Definition: DataSetInfo.h:62
TMVA::MethodCompositeBase::fCurrentMethodIdx
UInt_t fCurrentMethodIdx
Definition: MethodCompositeBase.h:96
TMVA::MethodCompositeBase::GetCurrentMethod
MethodBase * GetCurrentMethod(UInt_t idx)
Definition: MethodCompositeBase.h:105
TMVA::MethodCompositeBase::GetMethod
IMethod * GetMethod(const TString &title) const
returns pointer to MVA that corresponds to given method title
Definition: MethodCompositeBase.cxx:89
TMVA::MethodCompositeBase::fCurrentMethod
MethodBase * fCurrentMethod
Definition: MethodCompositeBase.h:97
TMVA::MethodCompositeBase::GetMvaValue
virtual Double_t GetMvaValue(Double_t *errLower=0, Double_t *errUpper=0)=0
TMVA::MethodBase
Virtual base Class for all MVA method.
Definition: MethodBase.h:111
TMVA::MethodCompositeBase::CreateRanking
virtual const Ranking * CreateRanking()=0
TMVA::MethodCompositeBase::ProcessOptions
void ProcessOptions()=0
unsigned int
TMVA::IMethod
Interface for all concrete MVA method implementations.
Definition: IMethod.h:53
TMVA::MethodCompositeBase::ReadWeightsFromStream
virtual void ReadWeightsFromStream(std::istream &)=0
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::MethodCompositeBase::ReadWeightsFromXML
void ReadWeightsFromXML(void *wghtnode)
XML streamer.
Definition: MethodCompositeBase.cxx:154
TMVA::MethodCompositeBase::fMethods
std::vector< IMethod * > fMethods
Definition: MethodCompositeBase.h:109
TMVA::MethodBase::MethodCompositeBase
friend class MethodCompositeBase
Definition: MethodBase.h:269
TMVA::Types::EMVA
EMVA
Definition: Types.h:78
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMVA::MethodCompositeBase::GetCurrentMethod
MethodBase * GetCurrentMethod()
Definition: MethodCompositeBase.h:104
TMVA::MethodCompositeBase::GetPreviousMethod
IMethod * GetPreviousMethod()
Definition: MethodCompositeBase.h:102
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
int