Logo ROOT   6.08/07
Reference Guide
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 
58  const TString& theWeightFile);
59 
60  virtual ~MethodBayesClassifier( void );
61 
62  virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
63 
64  // training method
65  void Train( void );
66 
68 
69  // write weights to file
70  void AddWeightsXMLTo( void* parent ) const;
71 
72  // read weights from file
73  void ReadWeightsFromStream( std::istream& istr );
74  void ReadWeightsFromXML ( void* /*wghtnode*/ ) {}
75 
76  // calculate the MVA value
77  Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
78 
79  void Init( void );
80 
81  // ranking of input variables
82  const Ranking* CreateRanking() { return 0; }
83 
84  protected:
85 
86  // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
87  void MakeClassSpecific( std::ostream&, const TString& ) const;
88 
89  // get help message text
90  void GetHelpMessage() const;
91 
92  private:
93 
94  // the option handling methods
95  void DeclareOptions();
96  void ProcessOptions();
97 
98  ClassDef(MethodBayesClassifier,0); // Friedman's BayesClassifier method
99  };
100 
101 } // namespace TMVA
102 
103 #endif // MethodBayesClassifier_H
EAnalysisType
Definition: Types.h:129
Basic string class.
Definition: TString.h:137
bool Bool_t
Definition: RtypesCore.h:59
void GetHelpMessage() const
get help message text
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 AddWeightsXMLTo(void *parent) const
void ReadWeightsFromStream(std::istream &istr)
read back the training results from a file (stream)
unsigned int UInt_t
Definition: RtypesCore.h:42
MethodBayesClassifier(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
standard constructor
double Double_t
Definition: RtypesCore.h:55
int type
Definition: TGX11.cxx:120
void Train(void)
some training
Abstract ClassifierFactory template that handles arbitrary types.
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
virtual void ReadWeightsFromStream(std::istream &)=0
void MakeClassSpecific(std::ostream &, const TString &) const
write specific classifier response