ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
GiniIndex.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 : GiniIndex *
8
* *
9
* *
10
* Description: Implementation of the GiniIndex as separation criterion *
11
* Large Gini Indices (maximum 0.5) mean , that the sample is well *
12
* mixed (same amount of signal and bkg) *
13
* bkg. Small Indices mean, well separated. *
14
* general definition: *
15
* Gini(Sample M) = 1 - (c(1)/N)^2 - (c(2)/N)^2 .... - (c(k)/N)^2 *
16
* Where: M is a sample of whatever N elements (events) *
17
* that belong to K different classes *
18
* c(k) is the number of elements that belong to class k *
19
* for just Signal and Background classes this boils down to: *
20
* Gini(Sample) = 2s*b/(s+b)^2 *
21
* *
22
* *
23
* Authors (alphabetical): *
24
* Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
25
* Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
26
* Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada *
27
* *
28
* Copyright (c) 2005: *
29
* CERN, Switzerland *
30
* U. of Victoria, Canada *
31
* Heidelberg U., Germany *
32
* *
33
* Redistribution and use in source and binary forms, with or without *
34
* modification, are permitted according to the terms listed in LICENSE *
35
* (http://ttmva.sourceforge.net/LICENSE) *
36
**********************************************************************************/
37
38
#ifndef ROOT_TMVA_GiniIndex
39
#define ROOT_TMVA_GiniIndex
40
41
//////////////////////////////////////////////////////////////////////////
42
// //
43
// GiniIndex //
44
// //
45
// Implementation of the GiniIndex as separation criterion //
46
// //
47
// Large Gini Indices (maximum 0.5) mean , that the sample is well //
48
// mixed (same amount of signal and bkg) //
49
// bkg. Small Indices mean, well separated. //
50
// general definition: //
51
// Gini(Sample M) = 1 - (c(1)/N)^2 - (c(2)/N)^2 .... - (c(k)/N)^2 //
52
// Where: M is a sample of whatever N elements (events) //
53
// that belong to K different classes //
54
// c(k) is the number of elements that belong to class k //
55
// for just Signal and Background classes this boils down to: //
56
// Gini(Sample) = 2s*b/(s+b)^2 //
57
//////////////////////////////////////////////////////////////////////////
58
59
#include "
TMVA/SeparationBase.h
"
60
61
namespace
TMVA
{
62
63
class
GiniIndex
:
public
SeparationBase
{
64
65
public
:
66
67
// construtor for the GiniIndex
68
GiniIndex
() {
fName
=
"Gini"
; }
69
70
// copy constructor
71
GiniIndex
(
const
GiniIndex
&
g
):
SeparationBase
(
g
) {}
72
73
//destructor
74
virtual
~GiniIndex
(){}
75
76
// Return the separation index (a measure for "purity" of the sample")
77
Double_t
GetSeparationIndex
(
const
Double_t
s,
const
Double_t
b
)
override
;
78
79
protected
:
80
81
ClassDefOverride
(
GiniIndex
,0);
// Implementation of the GiniIndex as separation criterion
82
};
83
84
}
// namespace TMVA
85
86
#endif
87
b
#define b(i)
Definition
RSha256.hxx:100
g
#define g(i)
Definition
RSha256.hxx:105
Double_t
double Double_t
Double 8 bytes.
Definition
RtypesCore.h:73
ClassDefOverride
#define ClassDefOverride(name, id)
Definition
Rtypes.h:348
SeparationBase.h
TMVA::GiniIndex::GiniIndex
GiniIndex()
Definition
GiniIndex.h:68
TMVA::GiniIndex::GetSeparationIndex
Double_t GetSeparationIndex(const Double_t s, const Double_t b) override
what we use here is 2*Gini.
Definition
GiniIndex.cxx:75
TMVA::GiniIndex::GiniIndex
GiniIndex(const GiniIndex &g)
Definition
GiniIndex.h:71
TMVA::GiniIndex::~GiniIndex
virtual ~GiniIndex()
Definition
GiniIndex.h:74
TMVA::SeparationBase::fName
TString fName
Definition
SeparationBase.h:108
TMVA::SeparationBase::SeparationBase
SeparationBase()
Constructor.
Definition
SeparationBase.cxx:75
TMVA
create variable transformations
Definition
GeneticMinimizer.h:22
tmva
tmva
inc
TMVA
GiniIndex.h
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1