Logo ROOT  
Reference Guide
IMethod.h
Go to the documentation of this file.
1// @(#)root/tmva $Id$
2// Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
3
4/**********************************************************************************
5 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6 * Package: TMVA *
7 * Class : IMethod *
8 * Web : http://tmva.sourceforge.net *
9 * *
10 * Description: *
11 * Interface for all concrete MVA method implementations *
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 * *
19 * Copyright (c) 2005: *
20 * CERN, Switzerland *
21 * U. of Victoria, Canada *
22 * MPI-K Heidelberg, Germany *
23 * LAPP, Annecy, France *
24 * *
25 * Redistribution and use in source and binary forms, with or without *
26 * modification, are permitted according to the terms listed in LICENSE *
27 * (http://tmva.sourceforge.net/LICENSE) *
28 **********************************************************************************/
29
30#ifndef ROOT_TMVA_IMethod
31#define ROOT_TMVA_IMethod
32
33//////////////////////////////////////////////////////////////////////////
34// //
35// IMethod //
36// //
37// Interface for all concrete MVA method implementations //
38// //
39//////////////////////////////////////////////////////////////////////////
40
41#include "TObject.h"
42#include "TString.h"
43#include <iosfwd>
44#include "Rtypes.h"
45#include "TMVA/Types.h"
46
47class TString;
48
49namespace TMVA {
50
51 class Ranking;
52 class MethodBoost;
53
54 class IMethod {
55
56 public:
57
58 // default constructor
60
61 // default destructor
62 virtual ~IMethod() {}
63
64 // ------- virtual member functions to be implemented by each MVA method
65 // the name of the method
66 virtual const char *GetName() const = 0;
67
68 // calculate the MVA value - some methods may return a per-event error estimate (unless: *err = -1)
69 virtual Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 ) = 0;
70
71 // training method
72 virtual void Train( void ) = 0;
73
74 // read weights from output stream
75 virtual void ReadWeightsFromStream( std::istream& ) = 0;
76
77 // write method specific monitoring histograms to target file
78 virtual void WriteMonitoringHistosToFile( void ) const = 0;
79
80 // make ROOT-independent C++ class for classifier response
81 virtual void MakeClass( const TString& classFileName = TString("") ) const = 0;
82
83 // create ranking
84 virtual const Ranking* CreateRanking() = 0;
85
86 // print help message
87 virtual void PrintHelpMessage() const = 0;
88
89 virtual void Init() = 0;
90 virtual void DeclareOptions() = 0;
91 virtual void ProcessOptions() = 0;
92
93 virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets ) = 0;
94
95 protected:
96
97 // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
98 virtual void MakeClassSpecific( std::ostream&, const TString& ) const = 0;
99
100 // get specific help message from classifier
101 virtual void GetHelpMessage() const = 0;
102
103 ClassDef(IMethod,0); // Method Interface
104
105 };
106} // namespace TMVA
107
108#endif
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:326
int type
Definition: TGX11.cxx:120
Interface for all concrete MVA method implementations.
Definition: IMethod.h:54
virtual const char * GetName() const =0
virtual void DeclareOptions()=0
virtual void WriteMonitoringHistosToFile(void) const =0
virtual void PrintHelpMessage() const =0
virtual void GetHelpMessage() const =0
virtual ~IMethod()
Definition: IMethod.h:62
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)=0
virtual void MakeClass(const TString &classFileName=TString("")) const =0
virtual void Init()=0
virtual void MakeClassSpecific(std::ostream &, const TString &) const =0
virtual const Ranking * CreateRanking()=0
virtual void ProcessOptions()=0
virtual void Train(void)=0
virtual Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)=0
virtual void ReadWeightsFromStream(std::istream &)=0
Ranking for variables in method (implementation)
Definition: Ranking.h:48
EAnalysisType
Definition: Types.h:127
Basic string class.
Definition: TString.h:131
create variable transformations