Logo ROOT   6.07/09
Reference Guide
LDA.h
Go to the documentation of this file.
1 // $Id$
2 /**********************************************************************************
3  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
4  * Package: TMVA *
5  * Class : LDA *
6  * Web : http://tmva.sourceforge.net *
7  * *
8  * Description: *
9  * Local LDA method used by MethodKNN to compute MVA value. *
10  * This is experimental code under development. This class computes *
11  * parameters of signal and background PDFs using Gaussian aproximation. *
12  * *
13  * Author: *
14  * John Alison John.Alison@cern.ch - University of Pennsylvania, USA *
15  * *
16  * Copyright (c) 2007: *
17  * CERN, Switzerland *
18  * MPI-K Heidelberg, Germany *
19  * University of Pennsylvania, USA *
20  * *
21  * Redistribution and use in source and binary forms, with or without *
22  * modification, are permitted according to the terms listed in LICENSE *
23  * (http://tmva.sourceforge.net/LICENSE) *
24  **********************************************************************************/
25 
26 #ifndef ROOT_TMVA_LDA
27 #define ROOT_TMVA_LDA
28 
29 
30 // C/C++
31 #include <map>
32 #include <vector>
33 
34 // ROOT
35 #ifndef ROOT_Rtypes
36 #include "Rtypes.h"
37 #endif
38 #ifndef ROOT_TMatrixFfwd
39 #include "TMatrixFfwd.h"
40 #endif
41 
42 typedef std::vector<std::vector<Float_t> > LDAEvents;
43 
44 namespace TMVA {
45 
46  class MsgLogger;
47 
48  class LDA {
49 
50  public:
51 
52  LDA(Float_t tolerence = 1.0e-5, Bool_t debug = false);
53  ~LDA();
54 
55  // Signal probability with Gaussian approximation
56  Float_t GetProb(const std::vector<Float_t>& x, Int_t k);
57 
58  // Log likelihood function with Gaussian approximation
59  Float_t GetLogLikelihood(const std::vector<Float_t>& x, Int_t k);
60 
61  // Create LDA matrix using local events found by knn method
62  void Initialize(const LDAEvents& inputSignal, const LDAEvents& inputBackground);
63 
64  private:
65 
66  // Probability value using Gaussian approximation
67  Float_t FSub(const std::vector<Float_t>& x, Int_t k);
68 
69  MsgLogger& Log() const { return *fLogger; }
70 
71  private:
72 
73  // data members
74  Float_t fTolerence; // documentation!
75  UInt_t fNumParams; // documentation!
76  std::map<Int_t, std::vector<Float_t> > fMu; // documentation!
77  TMatrixF* fSigma; // documentation!
78  TMatrixF* fSigmaInverse; // documentation!
79  std::map<Int_t, Float_t> fEventFraction; // documentation!
80  Bool_t fDebug; // documentation!
81 
82  mutable MsgLogger *fLogger; // message logging service
83  };
84 }
85 #endif
LDA(Float_t tolerence=1.0e-5, Bool_t debug=false)
constructor
Definition: LDA.cxx:52
Float_t FSub(const std::vector< Float_t > &x, Int_t k)
Probability value using Gaussian approximation.
Definition: LDA.cxx:216
TMatrixF * fSigmaInverse
Definition: LDA.h:78
Definition: LDA.h:48
~LDA()
destructor
Definition: LDA.cxx:65
float Float_t
Definition: RtypesCore.h:53
MsgLogger * fLogger
Definition: LDA.h:82
MsgLogger & Log() const
Definition: LDA.h:69
std::map< Int_t, std::vector< Float_t > > fMu
Definition: LDA.h:76
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Float_t fTolerence
Definition: LDA.h:74
TMatrixT.
Definition: TMatrixDfwd.h:24
Double_t x[n]
Definition: legend1.C:17
Float_t GetProb(const std::vector< Float_t > &x, Int_t k)
Signal probability with Gaussian approximation.
Definition: LDA.cxx:244
std::map< Int_t, Float_t > fEventFraction
Definition: LDA.h:79
Float_t GetLogLikelihood(const std::vector< Float_t > &x, Int_t k)
Log likelihood function with Gaussian approximation.
Definition: LDA.cxx:257
unsigned int UInt_t
Definition: RtypesCore.h:42
UInt_t fNumParams
Definition: LDA.h:75
void Initialize(const LDAEvents &inputSignal, const LDAEvents &inputBackground)
Create LDA matrix using local events found by knn method.
Definition: LDA.cxx:73
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
Bool_t fDebug
Definition: LDA.h:80
Abstract ClassifierFactory template that handles arbitrary types.
std::vector< std::vector< Float_t > > LDAEvents
Definition: LDA.h:42
bool debug
TMatrixF * fSigma
Definition: LDA.h:77