Logo ROOT   6.08/07
Reference Guide
GiniIndexWithLaplace.h
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 : GiniIndexWithLaplace *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: Implementation of the GiniIndex With Laplace correction *
11  * as separation criterion *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
16  * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada *
17  * *
18  * Copyright (c) 2005: *
19  * CERN, Switzerland *
20  * U. of Victoria, Canada *
21  * Heidelberg U., Germany *
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://ttmva.sourceforge.net/LICENSE) *
26  **********************************************************************************/
27 
28 #ifndef ROOT_TMVA_GiniIndexWithLaplace
29 #define ROOT_TMVA_GiniIndexWithLaplace
30 
31 //////////////////////////////////////////////////////////////////////////
32 // //
33 // GiniIndexWithLaplace //
34 // //
35 // Implementation of the GiniIndex With Laplace correction //
36 // as separation criterion //
37 // //
38 // Large Gini Indices (maximum 0.5) mean , that the sample is well //
39 // mixed (same amount of signal and bkg) //
40 // bkg. Small Indices mean, well separated. //
41 // general defniniton: //
42 // Gini(Sample M) = 1 - (c(1)/N)^2 - (c(2)/N)^2 .... - (c(k)/N)^2 //
43 // Where: M is a smaple of whatever N elements (events) //
44 // that belong to K different classes //
45 // c(k) is the number of elements that belong to class k //
46 // for just Signal and Background classes this boils down to: //
47 // the "Lapalace correction to the probability distribution would //
48 // turn the c(1)/N into (c(1)+1)/(N+2) //
49 // using this the simple Gini Index for two classes //
50 // Gini(Sample) = 2s*b/(s+b)^2 //
51 // turns into //
52 // GiniLaplace(Sample) = 2(s*b+s+b+1)/(s+b+2)^2 //
53 //////////////////////////////////////////////////////////////////////////
54 
55 #ifndef ROOT_TMVA_SeparationBase
56 #include "TMVA/SeparationBase.h"
57 #endif
58 
59 namespace TMVA {
60 
62 
63  public:
64 
65  // construtor for the GiniIndexWithLaplace
66  GiniIndexWithLaplace() { fName="GiniLaplace"; }
67 
68  // copy constructor
70 
71  //destructor
73 
74  // Return the separation index (a measure for "purity" of the sample")
75  virtual Double_t GetSeparationIndex( const Double_t &s, const Double_t &b );
76 
77  protected:
78 
79  ClassDef(GiniIndexWithLaplace,0); // Implementation of the GiniIndexWithLaplace as separation criterion
80  };
81 
82 } // namespace TMVA
83 
84 #endif
85 
GiniIndexWithLaplace(const GiniIndexWithLaplace &g)
#define ClassDef(name, id)
Definition: Rtypes.h:254
double Double_t
Definition: RtypesCore.h:55
Abstract ClassifierFactory template that handles arbitrary types.
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
virtual Double_t GetSeparationIndex(const Double_t &s, const Double_t &b)
Gini(Sample M) = 1 - (c(1)/N)^2 - (c(2)/N)^2 ....