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