Logo ROOT   6.14/05
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 definition: //
42 // Gini(Sample M) = 1 - (c(1)/N)^2 - (c(2)/N)^2 .... - (c(k)/N)^2 //
43 // Where: M is a sample 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 Laplace's 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 #include "TMVA/SeparationBase.h"
56 
57 namespace TMVA {
58 
60 
61  public:
62 
63  // construtor for the GiniIndexWithLaplace
64  GiniIndexWithLaplace() { fName="GiniLaplace"; }
65 
66  // copy constructor
68 
69  //destructor
71 
72  // Return the separation index (a measure for "purity" of the sample")
73  virtual Double_t GetSeparationIndex( const Double_t s, const Double_t b );
74 
75  protected:
76 
77  ClassDef(GiniIndexWithLaplace,0); // Implementation of the GiniIndexWithLaplace as separation criterion
78  };
79 
80 } // namespace TMVA
81 
82 #endif
83 
#define g(i)
Definition: RSha256.hxx:105
GiniIndexWithLaplace(const GiniIndexWithLaplace &g)
#define ClassDef(name, id)
Definition: Rtypes.h:320
An interface to calculate the "SeparationGain" for different separation criteria used in various trai...
Implementation of the GiniIndex With Laplace correction as separation criterion.
double Double_t
Definition: RtypesCore.h:55
static constexpr double s
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)