Logo ROOT   6.08/07
Reference Guide
MethodHMatrix.cxx
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 : TMVA::MethodHMatrix *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Implementation (see header file for description) *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Peter Speckmayer <Peter.Speckmayer@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  * *
24  * Redistribution and use in source and binary forms, with or without *
25  * modification, are permitted according to the terms listed in LICENSE *
26  * (http://tmva.sourceforge.net/LICENSE) *
27  **********************************************************************************/
28 
29 #include "TMVA/MethodHMatrix.h"
30 
31 #include "TMVA/ClassifierFactory.h"
32 #include "TMVA/DataSet.h"
33 #include "TMVA/DataSetInfo.h"
34 #include "TMVA/IMethod.h"
35 #include "TMVA/MethodBase.h"
36 #include "TMVA/MsgLogger.h"
37 #include "TMVA/Tools.h"
38 #include "TMVA/Types.h"
39 
40 #include "Riostream.h"
41 #include "TMatrix.h"
42 #include "TVectorT.h"
43 #include "TList.h"
44 
45 #include <algorithm>
46 
47 REGISTER_METHOD(HMatrix)
48 
50 
51 //_______________________________________________________________________
52 //Begin_Html
53 /*
54  H-Matrix method, which is implemented as a simple comparison of
55  chi-squared estimators for signal and background, taking into
56  account the linear correlations between the input variables
57 
58  This MVA approach is used by the D&#216; collaboration (FNAL) for the
59  purpose of electron identification (see, eg.,
60  <a href="http://arxiv.org/abs/hep-ex/9507007">hep-ex/9507007</a>).
61  As it is implemented in TMVA, it is usually equivalent or worse than
62  the Fisher-Mahalanobis discriminant, and it has only been added for
63  the purpose of completeness.
64  Two &chi;<sup>2</sup> estimators are computed for an event, each one
65  for signal and background, using the estimates for the means and
66  covariance matrices obtained from the training sample:<br>
67  <center>
68  <img vspace=6 src="gif/tmva_chi2.gif" align="bottom" >
69  </center>
70  TMVA then uses as normalised analyser for event (<i>i</i>) the ratio:
71  (<i>&chi;<sub>S</sub>(i)<sup>2</sup> &minus; &chi;<sub>B</sub><sup>2</sup>(i)</i>)
72  (<i>&chi;<sub>S</sub><sup>2</sup>(i) + &chi;<sub>B</sub><sup>2</sup>(i)</i>).
73 */
74 //End_Html
75 //_______________________________________________________________________
76 
77 
78 ////////////////////////////////////////////////////////////////////////////////
79 /// standard constructor for the H-Matrix method
80 
82  const TString& methodTitle,
83  DataSetInfo& theData,
84  const TString& theOption )
85  : TMVA::MethodBase( jobName, Types::kHMatrix, methodTitle, theData, theOption)
86  ,fInvHMatrixS(0)
87  ,fInvHMatrixB(0)
88  ,fVecMeanS(0)
89  ,fVecMeanB(0)
90 {
91 }
92 
93 ////////////////////////////////////////////////////////////////////////////////
94 /// constructor from weight file
95 
97  const TString& theWeightFile)
98  : TMVA::MethodBase( Types::kHMatrix, theData, theWeightFile)
99  ,fInvHMatrixS(0)
100  ,fInvHMatrixB(0)
101  ,fVecMeanS(0)
102  ,fVecMeanB(0)
103 {
104 }
105 
106 ////////////////////////////////////////////////////////////////////////////////
107 /// default initialization called by all constructors
108 
110 {
111  //SetNormalised( kFALSE ); obsolete!
112 
113  fInvHMatrixS = new TMatrixD( GetNvar(), GetNvar() );
114  fInvHMatrixB = new TMatrixD( GetNvar(), GetNvar() );
115  fVecMeanS = new TVectorD( GetNvar() );
116  fVecMeanB = new TVectorD( GetNvar() );
117 
118  // the minimum requirement to declare an event signal-like
119  SetSignalReferenceCut( 0.0 );
120 }
121 
122 ////////////////////////////////////////////////////////////////////////////////
123 /// destructor
124 
126 {
127  if (NULL != fInvHMatrixS) delete fInvHMatrixS;
128  if (NULL != fInvHMatrixB) delete fInvHMatrixB;
129  if (NULL != fVecMeanS ) delete fVecMeanS;
130  if (NULL != fVecMeanB ) delete fVecMeanB;
131 }
132 
133 ////////////////////////////////////////////////////////////////////////////////
134 /// FDA can handle classification with 2 classes and regression with one regression-target
135 
137 {
138  if( type == Types::kClassification && numberClasses == 2 ) return kTRUE;
139  return kFALSE;
140 }
141 
142 
143 ////////////////////////////////////////////////////////////////////////////////
144 /// MethodHMatrix options: none (apart from those implemented in MethodBase)
145 
147 {
148 }
149 
150 ////////////////////////////////////////////////////////////////////////////////
151 /// process user options
152 
154 {
155 }
156 
157 ////////////////////////////////////////////////////////////////////////////////
158 /// computes H-matrices for signal and background samples
159 
161 {
162  // covariance matrices for signal and background
165 
166  // sanity checks
167  if (TMath::Abs(fInvHMatrixS->Determinant()) < 10E-24) {
168  Log() << kWARNING << "<Train> H-matrix S is almost singular with deterinant= "
170  << " did you use the variables that are linear combinations or highly correlated ???"
171  << Endl;
172  }
173  if (TMath::Abs(fInvHMatrixB->Determinant()) < 10E-24) {
174  Log() << kWARNING << "<Train> H-matrix B is almost singular with deterinant= "
176  << " did you use the variables that are linear combinations or highly correlated ???"
177  << Endl;
178  }
179 
180  if (TMath::Abs(fInvHMatrixS->Determinant()) < 10E-120) {
181  Log() << kFATAL << "<Train> H-matrix S is singular with deterinant= "
183  << " did you use the variables that are linear combinations ???"
184  << Endl;
185  }
186  if (TMath::Abs(fInvHMatrixB->Determinant()) < 10E-120) {
187  Log() << kFATAL << "<Train> H-matrix B is singular with deterinant= "
189  << " did you use the variables that are linear combinations ???"
190  << Endl;
191  }
192 
193  // invert matrix
194  fInvHMatrixS->Invert();
195  fInvHMatrixB->Invert();
197 }
198 
199 ////////////////////////////////////////////////////////////////////////////////
200 /// compute covariance matrix
201 
203 {
205 
206  const UInt_t nvar = DataInfo().GetNVariables();
207  UInt_t ivar, jvar;
208 
209  // init matrices
210  TVectorD vec(nvar); vec *= 0;
211  TMatrixD mat2(nvar, nvar); mat2 *= 0;
212 
213  // initialize internal sum-of-weights variables
214  Double_t sumOfWeights = 0;
215  Double_t *xval = new Double_t[nvar];
216 
217  // perform event loop
218  for (Int_t i=0, iEnd=Data()->GetNEvents(); i<iEnd; ++i) {
219 
220  // retrieve the original (not transformed) event
221  const Event* origEvt = Data()->GetEvent(i);
222  Double_t weight = origEvt->GetWeight();
223 
224  // in case event with neg weights are to be ignored
225  if (IgnoreEventsWithNegWeightsInTraining() && weight <= 0) continue;
226 
227  if (DataInfo().IsSignal(origEvt) != isSignal) continue;
228 
229  // transform the event
231  const Event* ev = GetTransformationHandler().Transform( origEvt );
232 
233  // event is of good type
234  sumOfWeights += weight;
235 
236  // mean values
237  for (ivar=0; ivar<nvar; ivar++) xval[ivar] = ev->GetValue(ivar);
238 
239  // covariance matrix
240  for (ivar=0; ivar<nvar; ivar++) {
241 
242  vec(ivar) += xval[ivar]*weight;
243  mat2(ivar, ivar) += (xval[ivar]*xval[ivar])*weight;
244 
245  for (jvar=ivar+1; jvar<nvar; jvar++) {
246  mat2(ivar, jvar) += (xval[ivar]*xval[jvar])*weight;
247  mat2(jvar, ivar) = mat2(ivar, jvar); // symmetric matrix
248  }
249  }
250  }
251 
252  // variance-covariance
253  for (ivar=0; ivar<nvar; ivar++) {
254 
255  if (isSignal) (*fVecMeanS)(ivar) = vec(ivar)/sumOfWeights;
256  else (*fVecMeanB)(ivar) = vec(ivar)/sumOfWeights;
257 
258  for (jvar=0; jvar<nvar; jvar++) {
259  (*mat)(ivar, jvar) = mat2(ivar, jvar)/sumOfWeights - vec(ivar)*vec(jvar)/(sumOfWeights*sumOfWeights);
260  }
261  }
262 
263  delete [] xval;
264 }
265 
266 ////////////////////////////////////////////////////////////////////////////////
267 /// returns the H-matrix signal estimator
268 
270 {
273 
274  if (s+b < 0) Log() << kFATAL << "big trouble: s+b: " << s+b << Endl;
275 
276  // cannot determine error
277  NoErrorCalc(err, errUpper);
278 
279  return (b - s)/(s + b);
280 }
281 
282 ////////////////////////////////////////////////////////////////////////////////
283 /// compute chi2-estimator for event according to type (signal/background)
284 
286 {
287  // get original (not transformed) event
288 
289  const Event* origEvt = fTmpEvent ? fTmpEvent:Data()->GetEvent();
290 
291  // loop over variables
292  UInt_t ivar(0), jvar(0), nvar(GetNvar());
293  std::vector<Double_t> val( nvar );
294 
295  // transform the event according to the given type (signal/background)
296  if (type==Types::kSignal)
298  else
300 
301  const Event* ev = GetTransformationHandler().Transform( origEvt );
302 
303  for (ivar=0; ivar<nvar; ivar++) val[ivar] = ev->GetValue( ivar );
304 
305  Double_t chi2 = 0;
306  for (ivar=0; ivar<nvar; ivar++) {
307  for (jvar=0; jvar<nvar; jvar++) {
308  if (type == Types::kSignal)
309  chi2 += ( (val[ivar] - (*fVecMeanS)(ivar))*(val[jvar] - (*fVecMeanS)(jvar))
310  * (*fInvHMatrixS)(ivar,jvar) );
311  else
312  chi2 += ( (val[ivar] - (*fVecMeanB)(ivar))*(val[jvar] - (*fVecMeanB)(jvar))
313  * (*fInvHMatrixB)(ivar,jvar) );
314  }
315  }
316 
317  // sanity check
318  if (chi2 < 0) Log() << kFATAL << "<GetChi2> negative chi2: " << chi2 << Endl;
319 
320  return chi2;
321 }
322 
323 ////////////////////////////////////////////////////////////////////////////////
324 /// create XML description for HMatrix classification
325 
326 void TMVA::MethodHMatrix::AddWeightsXMLTo( void* parent ) const
327 {
328  void* wght = gTools().AddChild(parent, "Weights");
329  gTools().WriteTVectorDToXML( wght, "VecMeanS", fVecMeanS );
330  gTools().WriteTVectorDToXML( wght, "VecMeanB", fVecMeanB );
331  gTools().WriteTMatrixDToXML( wght, "InvHMatS", fInvHMatrixS );
332  gTools().WriteTMatrixDToXML( wght, "InvHMatB", fInvHMatrixB );
333 }
334 
335 ////////////////////////////////////////////////////////////////////////////////
336 /// read weights from XML file
337 
339 {
340  void* descnode = gTools().GetChild(wghtnode);
341  gTools().ReadTVectorDFromXML( descnode, "VecMeanS", fVecMeanS );
342  descnode = gTools().GetNextChild(descnode);
343  gTools().ReadTVectorDFromXML( descnode, "VecMeanB", fVecMeanB );
344  descnode = gTools().GetNextChild(descnode);
345  gTools().ReadTMatrixDFromXML( descnode, "InvHMatS", fInvHMatrixS );
346  descnode = gTools().GetNextChild(descnode);
347  gTools().ReadTMatrixDFromXML( descnode, "InvHMatB", fInvHMatrixB );
348 }
349 
350 ////////////////////////////////////////////////////////////////////////////////
351 /// read variable names and min/max
352 /// NOTE: the latter values are mandatory for the normalisation
353 /// in the reader application !!!
354 
356 {
357  UInt_t ivar,jvar;
358  TString var, dummy;
359  istr >> dummy;
360  //this->SetMethodName(dummy);
361 
362  // mean vectors
363  for (ivar=0; ivar<GetNvar(); ivar++)
364  istr >> (*fVecMeanS)(ivar) >> (*fVecMeanB)(ivar);
365 
366  // inverse covariance matrices (signal)
367  for (ivar=0; ivar<GetNvar(); ivar++)
368  for (jvar=0; jvar<GetNvar(); jvar++)
369  istr >> (*fInvHMatrixS)(ivar,jvar);
370 
371  // inverse covariance matrices (background)
372  for (ivar=0; ivar<GetNvar(); ivar++)
373  for (jvar=0; jvar<GetNvar(); jvar++)
374  istr >> (*fInvHMatrixB)(ivar,jvar);
375 }
376 
377 ////////////////////////////////////////////////////////////////////////////////
378 /// write Fisher-specific classifier response
379 
380 void TMVA::MethodHMatrix::MakeClassSpecific( std::ostream& fout, const TString& className ) const
381 {
382  fout << " // arrays of input evt vs. variable " << std::endl;
383  fout << " double fInvHMatrixS[" << GetNvar() << "][" << GetNvar() << "]; // inverse H-matrix (signal)" << std::endl;
384  fout << " double fInvHMatrixB[" << GetNvar() << "][" << GetNvar() << "]; // inverse H-matrix (background)" << std::endl;
385  fout << " double fVecMeanS[" << GetNvar() << "]; // vector of mean values (signal)" << std::endl;
386  fout << " double fVecMeanB[" << GetNvar() << "]; // vector of mean values (background)" << std::endl;
387  fout << " " << std::endl;
388  fout << " double GetChi2( const std::vector<double>& inputValues, int type ) const;" << std::endl;
389  fout << "};" << std::endl;
390  fout << " " << std::endl;
391  fout << "void " << className << "::Initialize() " << std::endl;
392  fout << "{" << std::endl;
393  fout << " // init vectors with mean values" << std::endl;
394  for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
395  fout << " fVecMeanS[" << ivar << "] = " << (*fVecMeanS)(ivar) << ";" << std::endl;
396  fout << " fVecMeanB[" << ivar << "] = " << (*fVecMeanB)(ivar) << ";" << std::endl;
397  }
398  fout << " " << std::endl;
399  fout << " // init H-matrices" << std::endl;
400  for (UInt_t ivar=0; ivar<GetNvar(); ivar++) {
401  for (UInt_t jvar=0; jvar<GetNvar(); jvar++) {
402  fout << " fInvHMatrixS[" << ivar << "][" << jvar << "] = "
403  << (*fInvHMatrixS)(ivar,jvar) << ";" << std::endl;
404  fout << " fInvHMatrixB[" << ivar << "][" << jvar << "] = "
405  << (*fInvHMatrixB)(ivar,jvar) << ";" << std::endl;
406  }
407  }
408  fout << "}" << std::endl;
409  fout << " " << std::endl;
410  fout << "inline double " << className << "::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
411  fout << "{" << std::endl;
412  fout << " // returns the H-matrix signal estimator" << std::endl;
413  fout << " std::vector<double> inputValuesSig = inputValues;" << std::endl;
414  fout << " std::vector<double> inputValuesBgd = inputValues;" << std::endl;
416 
417  UInt_t signalClass =DataInfo().GetClassInfo("Signal")->GetNumber();
418  UInt_t backgroundClass=DataInfo().GetClassInfo("Background")->GetNumber();
419 
420  fout << " Transform(inputValuesSig," << signalClass << ");" << std::endl;
421  fout << " Transform(inputValuesBgd," << backgroundClass << ");" << std::endl;
422  }
423 
424  // fout << " for(uint i=0; i<GetNvar(); ++i) std::cout << inputValuesSig.at(i) << \" \" << inputValuesBgd.at(i) << std::endl; " << std::endl;
425 
426  fout << " double s = GetChi2( inputValuesSig, " << Types::kSignal << " );" << std::endl;
427  fout << " double b = GetChi2( inputValuesBgd, " << Types::kBackground << " );" << std::endl;
428 
429  // fout << " std::cout << s << \" \" << b << std::endl; " << std::endl;
430 
431  fout << " " << std::endl;
432  fout << " if (s+b <= 0) std::cout << \"Problem in class " << className << "::GetMvaValue__: s+b = \"" << std::endl;
433  fout << " << s+b << \" <= 0 \" << std::endl;" << std::endl;
434  fout << " " << std::endl;
435  fout << " return (b - s)/(s + b);" << std::endl;
436  fout << "}" << std::endl;
437  fout << " " << std::endl;
438  fout << "inline double " << className << "::GetChi2( const std::vector<double>& inputValues, int type ) const" << std::endl;
439  fout << "{" << std::endl;
440  fout << " // compute chi2-estimator for event according to type (signal/background)" << std::endl;
441  fout << " " << std::endl;
442  fout << " size_t ivar,jvar;" << std::endl;
443  fout << " double chi2 = 0;" << std::endl;
444  fout << " for (ivar=0; ivar<GetNvar(); ivar++) {" << std::endl;
445  fout << " for (jvar=0; jvar<GetNvar(); jvar++) {" << std::endl;
446  fout << " if (type == " << Types::kSignal << ") " << std::endl;
447  fout << " chi2 += ( (inputValues[ivar] - fVecMeanS[ivar])*(inputValues[jvar] - fVecMeanS[jvar])" << std::endl;
448  fout << " * fInvHMatrixS[ivar][jvar] );" << std::endl;
449  fout << " else" << std::endl;
450  fout << " chi2 += ( (inputValues[ivar] - fVecMeanB[ivar])*(inputValues[jvar] - fVecMeanB[jvar])" << std::endl;
451  fout << " * fInvHMatrixB[ivar][jvar] );" << std::endl;
452  fout << " }" << std::endl;
453  fout << " } // loop over variables " << std::endl;
454  fout << " " << std::endl;
455  fout << " // sanity check" << std::endl;
456  fout << " if (chi2 < 0) std::cout << \"Problem in class " << className << "::GetChi2: chi2 = \"" << std::endl;
457  fout << " << chi2 << \" < 0 \" << std::endl;" << std::endl;
458  fout << " " << std::endl;
459  fout << " return chi2;" << std::endl;
460  fout << "}" << std::endl;
461  fout << " " << std::endl;
462  fout << "// Clean up" << std::endl;
463  fout << "inline void " << className << "::Clear() " << std::endl;
464  fout << "{" << std::endl;
465  fout << " // nothing to clear" << std::endl;
466  fout << "}" << std::endl;
467 }
468 
469 ////////////////////////////////////////////////////////////////////////////////
470 /// get help message text
471 ///
472 /// typical length of text line:
473 /// "|--------------------------------------------------------------|"
474 
476 {
477  Log() << Endl;
478  Log() << gTools().Color("bold") << "--- Short description:" << gTools().Color("reset") << Endl;
479  Log() << Endl;
480  Log() << "The H-Matrix classifier discriminates one class (signal) of a feature" << Endl;
481  Log() << "vector from another (background). The correlated elements of the" << Endl;
482  Log() << "vector are assumed to be Gaussian distributed, and the inverse of" << Endl;
483  Log() << "the covariance matrix is the H-Matrix. A multivariate chi-squared" << Endl;
484  Log() << "estimator is built that exploits differences in the mean values of" << Endl;
485  Log() << "the vector elements between the two classes for the purpose of" << Endl;
486  Log() << "discrimination." << Endl;
487  Log() << Endl;
488  Log() << gTools().Color("bold") << "--- Performance optimisation:" << gTools().Color("reset") << Endl;
489  Log() << Endl;
490  Log() << "The TMVA implementation of the H-Matrix classifier has been shown" << Endl;
491  Log() << "to underperform in comparison with the corresponding Fisher discriminant," << Endl;
492  Log() << "when using similar assumptions and complexity. Its use is therefore" << Endl;
493  Log() << "depreciated. Only in cases where the background model is strongly" << Endl;
494  Log() << "non-Gaussian, H-Matrix may perform better than Fisher. In such" << Endl;
495  Log() << "occurrences the user is advised to employ non-linear classifiers. " << Endl;
496  Log() << Endl;
497  Log() << gTools().Color("bold") << "--- Performance tuning via configuration options:" << gTools().Color("reset") << Endl;
498  Log() << Endl;
499  Log() << "None" << Endl;
500 }
void ReadWeightsFromXML(void *wghtnode)
read weights from XML file
UInt_t GetNVariables() const
Definition: DataSetInfo.h:128
void Init()
default initialization called by all constructors
MsgLogger & Endl(MsgLogger &ml)
Definition: MsgLogger.h:162
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
returns the H-matrix signal estimator
void ProcessOptions()
process user options
UInt_t GetNvar() const
Definition: MethodBase.h:340
const TList & GetTransformationList() const
MsgLogger & Log() const
Definition: Configurable.h:128
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
FDA can handle classification with 2 classes and regression with one regression-target.
EAnalysisType
Definition: Types.h:129
void MakeClassSpecific(std::ostream &, const TString &) const
write Fisher-specific classifier response
Basic string class.
Definition: TString.h:137
TransformationHandler & GetTransformationHandler(Bool_t takeReroutedIfAvailable=true)
Definition: MethodBase.h:390
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
const Event * Transform(const Event *) const
the transformation
virtual Double_t Determinant() const
Return the matrix determinant.
Definition: TMatrixT.cxx:1361
TMatrixD * fInvHMatrixS
void * AddChild(void *parent, const char *childname, const char *content=0, bool isRootNode=false)
add child node
Definition: Tools.cxx:1134
Short_t Abs(Short_t d)
Definition: TMathBase.h:110
void ReadWeightsFromStream(std::istream &istr)
read variable names and min/max NOTE: the latter values are mandatory for the normalisation in the re...
void ReadTMatrixDFromXML(void *node, const char *name, TMatrixD *mat)
Definition: Tools.cxx:1284
UInt_t fSignalClass
Definition: MethodBase.h:683
virtual ~MethodHMatrix()
destructor
Tools & gTools()
Definition: Tools.cxx:79
void SetTransformationReferenceClass(Int_t cls)
overrides the setting for all classes! (this is put in basically for the likelihood-method) be carefu...
DataSet * Data() const
Definition: MethodBase.h:405
void * GetChild(void *parent, const char *childname=0)
get child node
Definition: Tools.cxx:1158
UInt_t GetClass() const
Definition: Event.h:89
DataSetInfo & DataInfo() const
Definition: MethodBase.h:406
Double_t GetWeight() const
return the event weight - depending on whether the flag IgnoreNegWeightsInTraining is or not...
Definition: Event.cxx:378
TVectorT< Double_t > TVectorD
Definition: TVectorDfwd.h:24
TMatrixT< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant.
Definition: TMatrixT.cxx:1396
void AddWeightsXMLTo(void *parent) const
create XML description for HMatrix classification
UInt_t GetNEvents() const
temporary event when testing on a different DataSet than the own one
Definition: MethodBase.h:413
TMatrixT< Double_t > TMatrixD
Definition: TMatrixDfwd.h:24
ClassInfo * GetClassInfo(Int_t clNum) const
unsigned int UInt_t
Definition: RtypesCore.h:42
Double_t E()
Definition: TMath.h:54
Float_t GetValue(UInt_t ivar) const
return value of i&#39;th variable
Definition: Event.cxx:233
UInt_t fBackgroundClass
Definition: MethodBase.h:684
Bool_t IgnoreEventsWithNegWeightsInTraining() const
Definition: MethodBase.h:680
void Train()
computes H-matrices for signal and background samples
MethodHMatrix(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
standard constructor for the H-Matrix method
#define ClassImp(name)
Definition: Rtypes.h:279
double Double_t
Definition: RtypesCore.h:55
void ComputeCovariance(Bool_t, TMatrixD *)
compute covariance matrix
int type
Definition: TGX11.cxx:120
void WriteTVectorDToXML(void *node, const char *name, TVectorD *vec)
Definition: Tools.cxx:1267
static RooMathCoreReg dummy
void * GetNextChild(void *prevchild, const char *childname=0)
XML helpers.
Definition: Tools.cxx:1170
void SetCurrentType(Types::ETreeType type) const
Definition: DataSet.h:114
UInt_t GetNumber() const
Definition: ClassInfo.h:73
void ExitFromTraining()
Definition: MethodBase.h:458
const TString & Color(const TString &)
human readable color strings
Definition: Tools.cxx:837
void GetHelpMessage() const
get help message text
void WriteTMatrixDToXML(void *node, const char *name, TMatrixD *mat)
XML helpers.
Definition: Tools.cxx:1251
#define REGISTER_METHOD(CLASS)
for example
Abstract ClassifierFactory template that handles arbitrary types.
void DeclareOptions()
MethodHMatrix options: none (apart from those implemented in MethodBase)
const Event * fTmpEvent
Definition: MethodBase.h:408
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
#define NULL
Definition: Rtypes.h:82
TMatrixD * fInvHMatrixB
void ReadTVectorDFromXML(void *node, const char *name, TVectorD *vec)
Definition: Tools.cxx:1275
virtual Int_t GetSize() const
Definition: TCollection.h:95
const Bool_t kTRUE
Definition: Rtypes.h:91
const Event * GetEvent() const
Definition: DataSet.cxx:211
void NoErrorCalc(Double_t *const err, Double_t *const errUpper)
Definition: MethodBase.cxx:819
void SetSignalReferenceCut(Double_t cut)
Definition: MethodBase.h:360
Double_t GetChi2(Types::ESBType)
compute chi2-estimator for event according to type (signal/background)