Logo ROOT  
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 #include "TMVA/MethodBase.h"
40 #include "TMVA/Types.h"
41 
42 namespace TMVA {
43 
45 
46  public:
47 
48  MethodBayesClassifier( const TString& jobName,
49  const TString& methodTitle,
50  DataSetInfo& theData,
51  const TString& theOption = "");
52 
54  const TString& theWeightFile);
55 
56  virtual ~MethodBayesClassifier( void );
57 
58  virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
59 
60  // training method
61  void Train( void );
62 
64 
65  // write weights to file
66  void AddWeightsXMLTo( void* parent ) const;
67 
68  // read weights from file
69  void ReadWeightsFromStream( std::istream& istr );
70  void ReadWeightsFromXML ( void* /*wghtnode*/ ) {}
71 
72  // calculate the MVA value
73  Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
74 
75  void Init( void );
76 
77  // ranking of input variables
78  const Ranking* CreateRanking() { return 0; }
79 
80  protected:
81 
82  // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
83  void MakeClassSpecific( std::ostream&, const TString& ) const;
84 
85  // get help message text
86  void GetHelpMessage() const;
87 
88  private:
89 
90  // the option handling methods
91  void DeclareOptions();
92  void ProcessOptions();
93 
94  ClassDef(MethodBayesClassifier,0); // Friedman's BayesClassifier method
95  };
96 
97 } // namespace TMVA
98 
99 #endif // MethodBayesClassifier_H
TMVA::MethodBase::ReadWeightsFromStream
virtual void ReadWeightsFromStream(std::istream &)=0
TMVA::MethodBayesClassifier::~MethodBayesClassifier
virtual ~MethodBayesClassifier(void)
destructor
Definition: MethodBayesClassifier.cxx:105
TMVA::Ranking
Ranking for variables in method (implementation)
Definition: Ranking.h:48
TMVA::MethodBayesClassifier::GetMvaValue
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
returns MVA value for given event
Definition: MethodBayesClassifier.cxx:132
TMVA::MethodBayesClassifier::GetHelpMessage
void GetHelpMessage() const
get help message text
Definition: MethodBayesClassifier.cxx:157
MethodBase.h
TString
Basic string class.
Definition: TString.h:136
TMVA::MethodBayesClassifier
Description of bayesian classifiers.
Definition: MethodBayesClassifier.h:44
bool
TMVA::DataSetInfo
Class that contains all the data information.
Definition: DataSetInfo.h:62
TMVA::MethodBayesClassifier::ReadWeightsFromXML
void ReadWeightsFromXML(void *)
Definition: MethodBayesClassifier.h:70
TMVA::MethodBayesClassifier::ProcessOptions
void ProcessOptions()
the option string is decoded, for available options see "DeclareOptions"
Definition: MethodBayesClassifier.cxx:98
TMVA::Types::EAnalysisType
EAnalysisType
Definition: Types.h:128
TMVA::MethodBayesClassifier::AddWeightsXMLTo
void AddWeightsXMLTo(void *parent) const
Definition: MethodBayesClassifier.cxx:118
TMVA::MethodBayesClassifier::ReadWeightsFromStream
virtual void ReadWeightsFromStream(std::istream &)=0
TMVA::MethodBase
Virtual base Class for all MVA method.
Definition: MethodBase.h:111
TMVA::MethodBayesClassifier::Init
void Init(void)
default initialisation
Definition: MethodBayesClassifier.cxx:84
Types.h
TMVA::MethodBayesClassifier::Train
void Train(void)
some training
Definition: MethodBayesClassifier.cxx:112
TMVA::MethodBayesClassifier::DeclareOptions
void DeclareOptions()
define the options (their key words) that can be set in the option string
Definition: MethodBayesClassifier.cxx:91
unsigned int
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::MethodBayesClassifier::MakeClassSpecific
void MakeClassSpecific(std::ostream &, const TString &) const
write specific classifier response
Definition: MethodBayesClassifier.cxx:145
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMVA::MethodBayesClassifier::MethodBayesClassifier
MethodBayesClassifier(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
standard constructor
Definition: MethodBayesClassifier.cxx:54
TMVA::MethodBayesClassifier::CreateRanking
const Ranking * CreateRanking()
Definition: MethodBayesClassifier.h:78
TMVA::MethodBayesClassifier::HasAnalysisType
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
Variable can handle classification with 2 classes.
Definition: MethodBayesClassifier.cxx:74
type
int type
Definition: TGX11.cxx:121
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22