Logo ROOT   6.07/09
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 critiera useded 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 crition 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 critiera 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 backgr), 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 crition which is optimized for when trying //
68 // to increase the information in the system (making the best selection //
69 // //
70 //////////////////////////////////////////////////////////////////////////
71 
72 #ifndef ROOT_Rtypes
73 #include "Rtypes.h"
74 #endif
75 
76 #ifndef ROOT_TString
77 #include "TString.h"
78 #endif
79 
80 #ifndef ROOT_TMath
81 #include "TMath.h"
82 #endif
83 
84 #include <limits>
85 
86 namespace TMVA {
87 
89 
90  public:
91 
92  // default constructor
94 
95  //copy constructor
96  SeparationBase( const SeparationBase& s );
97 
98  // destructor
99  virtual ~SeparationBase(){}
100 
101  // Return the gain in separation of the original sample is splitted in two sub-samples
102  // (N * Index_parent) - (N_left * Index_left) - (N_right * Index_right)
103  virtual Double_t GetSeparationGain( const Double_t& nSelS, const Double_t& nSelB,
104  const Double_t& nTotS, const Double_t& nTotB );
105 
106  // Return the separation index (a measure for "purity" of the sample")
107  virtual Double_t GetSeparationIndex( const Double_t &s, const Double_t &b ) = 0;
108 
109  // Return the name of the concrete Index implementation
110  const TString& GetName() { return fName; }
111 
112  protected:
113 
114  TString fName; // name of the concrete Separation Index impementation
115 
117 
118  ClassDef(SeparationBase,0); // Interface to different separation critiera used in training algorithms
119  };
120 
121 
122 } // namespace TMVA
123 
124 #endif
Basic string class.
Definition: TString.h:137
#define ClassDef(name, id)
Definition: Rtypes.h:254
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...
double Double_t
Definition: RtypesCore.h:55
Abstract ClassifierFactory template that handles arbitrary types.
virtual Double_t GetSeparationIndex(const Double_t &s, const Double_t &b)=0
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()