ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MethodBayesClassifier.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Abhishek Narain
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : MethodBayesClassifier *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Bayesian Classifier *
12  * *
13  * Authors (alphabetical): *
14  * Abhishek Narain, <narainabhi@gmail.com> - University of Houston *
15  * *
16  * Copyright (c) 2005-2006: *
17  * University of Houston, *
18  * CERN, Switzerland *
19  * U. of Victoria, Canada *
20  * MPI-K Heidelberg, Germany *
21  * LAPP, Annecy, France *
22  * *
23  * Redistribution and use in source and binary forms, with or without *
24  * modification, are permitted according to the terms listed in LICENSE *
25  * (http://tmva.sourceforge.net/LICENSE) *
26  **********************************************************************************/
27 
28 #ifndef ROOT_TMVA_MethodBayesClassifier
29 #define ROOT_TMVA_MethodBayesClassifier
30 
31 //////////////////////////////////////////////////////////////////////////
32 // //
33 // MethodBayesClassifier //
34 // //
35 // Description... //
36 // //
37 //////////////////////////////////////////////////////////////////////////
38 
39 #ifndef ROOT_TMVA_MethodBase
40 #include "TMVA/MethodBase.h"
41 #endif
42 #ifndef ROOT_TMVA_Types
43 #include "TMVA/Types.h"
44 #endif
45 
46 namespace TMVA {
47 
49 
50  public:
51 
52  MethodBayesClassifier( const TString& jobName,
53  const TString& methodTitle,
54  DataSetInfo& theData,
55  const TString& theOption = "",
56  TDirectory* theTargetDir = 0 );
57 
59  const TString& theWeightFile,
60  TDirectory* theTargetDir = NULL );
61 
62  virtual ~MethodBayesClassifier( void );
63 
64  virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
65 
66  // training method
67  void Train( void );
68 
70 
71  // write weights to file
72  void AddWeightsXMLTo( void* parent ) const;
73 
74  // read weights from file
75  void ReadWeightsFromStream( std::istream& istr );
76  void ReadWeightsFromXML ( void* /*wghtnode*/ ) {}
77 
78  // calculate the MVA value
79  Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
80 
81  void Init( void );
82 
83  // ranking of input variables
84  const Ranking* CreateRanking() { return 0; }
85 
86  protected:
87 
88  // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
89  void MakeClassSpecific( std::ostream&, const TString& ) const;
90 
91  // get help message text
92  void GetHelpMessage() const;
93 
94  private:
95 
96  // the option handling methods
97  void DeclareOptions();
98  void ProcessOptions();
99 
100  ClassDef(MethodBayesClassifier,0) // Friedman's BayesClassifier method
101  };
102 
103 } // namespace TMVA
104 
105 #endif // MethodBayesClassifier_H
EAnalysisType
Definition: Types.h:124
Basic string class.
Definition: TString.h:137
bool Bool_t
Definition: RtypesCore.h:59
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
returns MVA value for given event
virtual ~MethodBayesClassifier(void)
destructor
void ProcessOptions()
the option string is decoded, for availabel options see "DeclareOptions"
#define ClassDef(name, id)
Definition: Rtypes.h:254
void Init(void)
default initialisation
void ReadWeightsFromStream(std::istream &istr)
read back the training results from a file (stream)
unsigned int UInt_t
Definition: RtypesCore.h:42
void GetHelpMessage() const
get help message text
double Double_t
Definition: RtypesCore.h:55
Describe directory structure in memory.
Definition: TDirectory.h:44
int type
Definition: TGX11.cxx:120
void Train(void)
some training
void MakeClassSpecific(std::ostream &, const TString &) const
write specific classifier response
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
Variable can handle classification with 2 classes.
void DeclareOptions()
define the options (their key words) that can be set in the option string
void AddWeightsXMLTo(void *parent) const
#define NULL
Definition: Rtypes.h:82
MethodBayesClassifier(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="", TDirectory *theTargetDir=0)
virtual void ReadWeightsFromStream(std::istream &)=0