Logo ROOT  
Reference Guide
SeparationBase.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 : SeparationBase *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: An interface to different separation criteria used in various *
11  * training algorithms, as there are: *
12  * Gini-Index, Cross Entropy, Misclassification Error, e.t.c. *
13  * *
14  * There are two things: the Separation Index, and the Separation Gain *
15  * Separation Index: *
16  * Measure of the "purity" of a sample. If all elements (events) in the *
17  * sample belong to the same class (e.g. signal or backgr), than the *
18  * separation index is 0 (meaning 100% purity (or 0% purity as it is *
19  * symmetric. The index becomes maximal, for perfectly mixed samples *
20  * eg. purity=50% , N_signal = N_bkg *
21  * *
22  * Separation Gain: *
23  * the measure of how the quality of separation of the sample increases *
24  * by splitting the sample e.g. into a "left-node" and a "right-node" *
25  * (N * Index_parent) - (N_left * Index_left) - (N_right * Index_right) *
26  * this is then the quality criterion which is optimized for when trying *
27  * to increase the information in the system (making the best selection *
28  * *
29  * *
30  * Authors (alphabetical): *
31  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
32  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
33  * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada *
34  * *
35  * Copyright (c) 2005: *
36  * CERN, Switzerland *
37  * U. of Victoria, Canada *
38  * Heidelberg U., Germany *
39  * *
40  * Redistribution and use in source and binary forms, with or without *
41  * modification, are permitted according to the terms listed in LICENSE *
42  * (http://tmva.sourceforge.net/LICENSE) *
43  **********************************************************************************/
44 
45 #ifndef ROOT_TMVA_SeparationBase
46 #define ROOT_TMVA_SeparationBase
47 
48 //////////////////////////////////////////////////////////////////////////
49 // //
50 // SeparationBase //
51 // //
52 // An interface to calculate the "SeparationGain" for different //
53 // separation criteria used in various training algorithms //
54 // //
55 // There are two things: the Separation Index, and the Separation Gain //
56 // Separation Index: //
57 // Measure of the "purity" of a sample. If all elements (events) in the //
58 // sample belong to the same class (e.g. signal or background), than the//
59 // separation index is 0 (meaning 100% purity (or 0% purity as it is //
60 // symmetric. The index becomes maximal, for perfectly mixed samples //
61 // eg. purity=50% , N_signal = N_bkg //
62 // //
63 // Separation Gain: //
64 // the measure of how the quality of separation of the sample increases //
65 // by splitting the sample e.g. into a "left-node" and a "right-node" //
66 // (N * Index_parent) - (N_left * Index_left) - (N_right * Index_right) //
67 // this is then the quality criterion which is optimized for when trying//
68 // to increase the information in the system (making the best selection //
69 // //
70 //////////////////////////////////////////////////////////////////////////
71 
72 #include "Rtypes.h"
73 
74 #include "TString.h"
75 
76 #include "TMath.h"
77 
78 #include <limits>
79 
80 namespace TMVA {
81 
83 
84  public:
85 
86  // default constructor
88 
89  //copy constructor
91 
92  // destructor
93  virtual ~SeparationBase(){}
94 
95  // Return the gain in separation of the original sample is split in two sub-samples
96  // (N * Index_parent) - (N_left * Index_left) - (N_right * Index_right)
97  virtual Double_t GetSeparationGain( const Double_t nSelS, const Double_t nSelB,
98  const Double_t nTotS, const Double_t nTotB );
99 
100  // Return the separation index (a measure for "purity" of the sample")
101  virtual Double_t GetSeparationIndex( const Double_t s, const Double_t b ) = 0;
102 
103  // Return the name of the concrete Index implementation
104  const TString& GetName() { return fName; }
105 
106  protected:
107 
108  TString fName; // name of the concrete Separation Index implementation
109 
111 
112  ClassDef(SeparationBase,0); // Interface to different separation criteria used in training algorithms
113  };
114 
115 
116 } // namespace TMVA
117 
118 #endif
TMVA::SeparationBase::GetSeparationIndex
virtual Double_t GetSeparationIndex(const Double_t s, const Double_t b)=0
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TMVA::SeparationBase::fPrecisionCut
Double_t fPrecisionCut
Definition: SeparationBase.h:110
TString
Basic string class.
Definition: TString.h:136
b
#define b(i)
Definition: RSha256.hxx:100
TString.h
TMVA::SeparationBase::GetName
const TString & GetName()
Definition: SeparationBase.h:104
TMVA::SeparationBase::fName
TString fName
Definition: SeparationBase.h:108
TMVA::SeparationBase::~SeparationBase
virtual ~SeparationBase()
Definition: SeparationBase.h:93
TMVA::SeparationBase::GetSeparationGain
virtual Double_t GetSeparationGain(const Double_t nSelS, const Double_t nSelB, const Double_t nTotS, const Double_t nTotB)
Separation Gain: the measure of how the quality of separation of the sample increases by splitting th...
Definition: SeparationBase.cxx:101
TMVA::SeparationBase::SeparationBase
SeparationBase()
Constructor.
Definition: SeparationBase.cxx:76
TMVA::SeparationBase
An interface to calculate the "SeparationGain" for different separation criteria used in various trai...
Definition: SeparationBase.h:82
Double_t
double Double_t
Definition: RtypesCore.h:59
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
Rtypes.h
TMath.h
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22