Logo ROOT  
Reference Guide
MethodBayesClassifier.cxx
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Marcin ....
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  * Implementation (see header file for description) *
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 /*! \class TMVA::MethodBayesClassifier
29 \ingroup TMVA
30 
31 Description of bayesian classifiers.
32 
33 */
34 
36 
37 #include "TMVA/ClassifierFactory.h"
38 #include "TMVA/IMethod.h"
39 #include "TMVA/MethodBase.h"
40 #include "TMVA/MsgLogger.h"
41 #include "TMVA/Tools.h"
42 #include "TMVA/Types.h"
43 
44 #include <iostream>
45 #include "TString.h"
46 
47 REGISTER_METHOD(BayesClassifier)
48 
50 
51 ////////////////////////////////////////////////////////////////////////////////
52 /// standard constructor
53 
55  const TString& methodTitle,
56  DataSetInfo& theData,
57  const TString& theOption ) :
58  TMVA::MethodBase( jobName, Types::kBayesClassifier, methodTitle, theData, theOption)
59 {
60 }
61 
62 ////////////////////////////////////////////////////////////////////////////////
63 /// constructor from weight file
64 
66  const TString& theWeightFile) :
67  TMVA::MethodBase( Types::kBayesClassifier, theData, theWeightFile)
68 {
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// Variable can handle classification with 2 classes
73 
75 {
76  if( type == Types::kClassification && numberClasses == 2 ) return kTRUE;
77  return kFALSE;
78 }
79 
80 
81 ////////////////////////////////////////////////////////////////////////////////
82 /// default initialisation
83 
85 {
86 }
87 
88 ////////////////////////////////////////////////////////////////////////////////
89 /// define the options (their key words) that can be set in the option string
90 
92 {
93 }
94 
95 ////////////////////////////////////////////////////////////////////////////////
96 /// the option string is decoded, for available options see "DeclareOptions"
97 
99 {
100 }
101 
102 ////////////////////////////////////////////////////////////////////////////////
103 /// destructor
104 
106 {
107 }
108 
109 ////////////////////////////////////////////////////////////////////////////////
110 /// some training
111 
113 {
114 }
115 
116 ////////////////////////////////////////////////////////////////////////////////
117 
118 void TMVA::MethodBayesClassifier::AddWeightsXMLTo( void* /*parent*/ ) const {
119  Log() << kFATAL << "Please implement writing of weights as XML" << Endl;
120 }
121 
122 ////////////////////////////////////////////////////////////////////////////////
123 /// read back the training results from a file (stream)
124 
126 {
127 }
128 
129 ////////////////////////////////////////////////////////////////////////////////
130 /// returns MVA value for given event
131 
133 {
134  Double_t myMVA = 0;
135 
136  // cannot determine error
137  NoErrorCalc(err, errUpper);
138 
139  return myMVA;
140 }
141 
142 ////////////////////////////////////////////////////////////////////////////////
143 /// write specific classifier response
144 
145 void TMVA::MethodBayesClassifier::MakeClassSpecific( std::ostream& fout, const TString& className ) const
146 {
147  fout << " // not implemented for class: \"" << className << "\"" << std::endl;
148  fout << "};" << std::endl;
149 }
150 
151 ////////////////////////////////////////////////////////////////////////////////
152 /// get help message text
153 ///
154 /// typical length of text line:
155 /// "|--------------------------------------------------------------|"
156 
158 {
159  Log() << Endl;
160  Log() << gTools().Color("bold") << "--- Short description:" << gTools().Color("reset") << Endl;
161  Log() << Endl;
162  Log() << "<None>" << Endl;
163  Log() << Endl;
164  Log() << gTools().Color("bold") << "--- Performance optimisation:" << gTools().Color("reset") << Endl;
165  Log() << Endl;
166  Log() << "<None>" << Endl;
167  Log() << Endl;
168  Log() << gTools().Color("bold") << "--- Performance tuning via configuration options:" << gTools().Color("reset") << Endl;
169  Log() << Endl;
170  Log() << "<None>" << Endl;
171 }
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TMVA::MethodBayesClassifier::~MethodBayesClassifier
virtual ~MethodBayesClassifier(void)
destructor
Definition: MethodBayesClassifier.cxx:105
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
IMethod.h
TMath::Log
Double_t Log(Double_t x)
Definition: TMath.h:760
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
TString.h
REGISTER_METHOD
#define REGISTER_METHOD(CLASS)
for example
Definition: ClassifierFactory.h:124
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::ProcessOptions
void ProcessOptions()
the option string is decoded, for available options see "DeclareOptions"
Definition: MethodBayesClassifier.cxx:98
MsgLogger.h
MethodBayesClassifier.h
TMVA::Types::EAnalysisType
EAnalysisType
Definition: Types.h:128
TMVA::MethodBayesClassifier::AddWeightsXMLTo
void AddWeightsXMLTo(void *parent) const
Definition: MethodBayesClassifier.cxx:118
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TMVA::Types::kClassification
@ kClassification
Definition: Types.h:129
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
TMVA::Types
Singleton class for Global types used by TMVA.
Definition: Types.h:73
Types.h
TMVA::MethodBayesClassifier::Train
void Train(void)
some training
Definition: MethodBayesClassifier.cxx:112
TMVA::Endl
MsgLogger & Endl(MsgLogger &ml)
Definition: MsgLogger.h:158
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
TMVA::Tools::Color
const TString & Color(const TString &)
human readable color strings
Definition: Tools.cxx:840
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::kFATAL
@ kFATAL
Definition: Types.h:63
TMVA::MethodBayesClassifier::MakeClassSpecific
void MakeClassSpecific(std::ostream &, const TString &) const
write specific classifier response
Definition: MethodBayesClassifier.cxx:145
TMVA::MethodBayesClassifier::MethodBayesClassifier
MethodBayesClassifier(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
standard constructor
Definition: MethodBayesClassifier.cxx:54
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
Tools.h
ClassifierFactory.h
type
int type
Definition: TGX11.cxx:121
TMVA::gTools
Tools & gTools()
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22