Logo ROOT   6.12/07
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
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...
SeparationBase()
Constructor.
Basic string class.
Definition: TString.h:125
#define ClassDef(name, id)
Definition: Rtypes.h:320
An interface to calculate the "SeparationGain" for different separation criteria used in various trai...
virtual Double_t GetSeparationIndex(const Double_t s, const Double_t b)=0
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
const TString & GetName()