ROOT
Version v6.32
master
v6.34
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
v6.04
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
►
Functional Parts
►
Namespaces
►
All Classes
▼
Files
▼
File List
►
bindings
►
core
►
documentation
►
geom
►
graf2d
►
graf3d
►
gui
►
hist
►
html
►
io
►
main
►
math
►
montecarlo
►
net
►
proof
►
roofit
►
sql
▼
tmva
doc
►
pymva
►
rmva
►
sofie
►
sofie_parsers
▼
tmva
►
inc
▼
src
►
DNN
BDTEventWrapper.cxx
BinarySearchTree.cxx
BinarySearchTreeNode.cxx
BinaryTree.cxx
CCPruner.cxx
CCTreeWrapper.cxx
►
Classification.cxx
ClassifierFactory.cxx
ClassInfo.cxx
Config.cxx
Configurable.cxx
ConvergenceTest.cxx
CostComplexityPruneTool.cxx
CrossEntropy.cxx
CrossValidation.cxx
CvSplit.cxx
DataInputHandler.cxx
DataLoader.cxx
DataSet.cxx
►
DataSetFactory.cxx
DataSetInfo.cxx
DataSetManager.cxx
►
DecisionTree.cxx
DecisionTreeNode.cxx
Envelope.cxx
Event.cxx
ExpectedErrorPruneTool.cxx
►
Factory.cxx
FitterBase.cxx
GeneticAlgorithm.cxx
GeneticFitter.cxx
GeneticGenes.cxx
GeneticPopulation.cxx
GeneticRange.cxx
GiniIndex.cxx
GiniIndexWithLaplace.cxx
HyperParameterOptimisation.cxx
IFitterTarget.cxx
IMethod.cxx
Interval.cxx
►
KDEKernel.cxx
LDA.cxx
LogInterval.cxx
LossFunction.cxx
MCFitter.cxx
MethodANNBase.cxx
►
MethodBase.cxx
MethodBayesClassifier.cxx
MethodBDT.cxx
MethodBoost.cxx
MethodCategory.cxx
MethodCFMlpANN.cxx
►
MethodCFMlpANN_Utils.cxx
MethodCompositeBase.cxx
MethodCrossValidation.cxx
MethodCuts.cxx
►
MethodDL.cxx
►
MethodDNN.cxx
MethodDT.cxx
MethodFDA.cxx
MethodFisher.cxx
MethodHMatrix.cxx
MethodKNN.cxx
MethodLD.cxx
MethodLikelihood.cxx
MethodMLP.cxx
MethodPDEFoam.cxx
MethodPDERS.cxx
MethodPlugins.cxx
MethodRuleFit.cxx
MethodSVM.cxx
►
MethodTMlpANN.cxx
MinuitFitter.cxx
MinuitWrapper.cxx
MisClassificationError.cxx
ModulekNN.cxx
►
MsgLogger.cxx
►
NeuralNet.cxx
Node.cxx
OptimizeConfigParameters.cxx
Option.cxx
OptionMap.cxx
►
PDEFoam.cxx
PDEFoamCell.cxx
PDEFoamDecisionTree.cxx
PDEFoamDecisionTreeDensity.cxx
PDEFoamDensityBase.cxx
PDEFoamDiscriminant.cxx
PDEFoamDiscriminantDensity.cxx
PDEFoamEvent.cxx
PDEFoamEventDensity.cxx
PDEFoamKernelBase.cxx
PDEFoamKernelGauss.cxx
PDEFoamKernelLinN.cxx
PDEFoamKernelTrivial.cxx
PDEFoamMultiTarget.cxx
PDEFoamTarget.cxx
PDEFoamTargetDensity.cxx
PDEFoamVect.cxx
PDF.cxx
QuickMVAProbEstimator.cxx
Ranking.cxx
RBDT.cxx
Reader.cxx
RegressionVariance.cxx
Results.cxx
ResultsClassification.cxx
ResultsMulticlass.cxx
ResultsRegression.cxx
ROCCalc.cxx
►
ROCCurve.cxx
RootFinder.cxx
Rule.cxx
RuleCut.cxx
RuleEnsemble.cxx
RuleFit.cxx
RuleFitAPI.cxx
►
RuleFitParams.cxx
SdivSqrtSplusB.cxx
SeparationBase.cxx
SimulatedAnnealing.cxx
SimulatedAnnealingFitter.cxx
SVEvent.cxx
SVKernelFunction.cxx
SVKernelMatrix.cxx
SVWorkingSet.cxx
TActivation.cxx
TActivationChooser.cxx
TActivationIdentity.cxx
TActivationRadial.cxx
TActivationReLU.cxx
TActivationSigmoid.cxx
TActivationTanh.cxx
Timer.cxx
►
TNeuron.cxx
TNeuronInput.cxx
TNeuronInputAbs.cxx
TNeuronInputChooser.cxx
TNeuronInputSqSum.cxx
TNeuronInputSum.cxx
Tools.cxx
TrainingHistory.cxx
TransformationHandler.cxx
TSpline1.cxx
TSpline2.cxx
►
TSynapse.cxx
►
Types.cxx
VariableDecorrTransform.cxx
VariableGaussTransform.cxx
VariableIdentityTransform.cxx
►
VariableImportance.cxx
VariableInfo.cxx
VariableNormalizeTransform.cxx
VariablePCATransform.cxx
VariableRearrangeTransform.cxx
►
VariableTransform.cxx
►
VariableTransformBase.cxx
VarTransformHandler.cxx
Volume.cxx
►
tmvagui
►
tree
►
tutorials
►
v6-32-00-patches
►
File Members
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
GiniIndex.cxx
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 : TMVA::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
* Authors (alphabetical): *
23
* Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
24
* Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
25
* Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada *
26
* *
27
* Copyright (c) 2005: *
28
* CERN, Switzerland *
29
* U. of Victoria, Canada *
30
* Heidelberg U., Germany *
31
* *
32
* Redistribution and use in source and binary forms, with or without *
33
* modification, are permitted according to the terms listed in LICENSE *
34
* (see tmva/doc/LICENSE) *
35
**********************************************************************************/
36
37
/*! \class TMVA::GiniIndex
38
\ingroup TMVA
39
40
Implementation of the GiniIndex as separation criterion.
41
42
Large Gini Indices (maximum 0.5) mean , that the sample is well mixed (same
43
amount of signal and bkg) bkg.
44
45
Small Indices mean, well separated.
46
47
#### General definition:
48
49
\f[
50
Gini(Sample M) = 1 - (\frac{c(1)}{N})^2 - (\frac{c(2)}{N})^2 .... - (\frac{c(k)}{N})^2
51
\f]
52
53
Where:
54
55
\f$ M \f$ is a sample of whatever \f$ N \f$ elements (events) that belong
56
to \f$ K \f$ different classes.
57
58
\f$ c(k) \f$ is the number of elements that belong to class \f$ k \f$ for just
59
Signal and Background classes this boils down to:
60
61
\f[
62
Gini(Sample) = \frac{2sb}{(s+b)^2}
63
\f]
64
*/
65
66
#include "
TMVA/GiniIndex.h
"
67
68
#include "
Rtypes.h
"
69
70
ClassImp
(
TMVA::GiniIndex
);
71
72
////////////////////////////////////////////////////////////////////////////////
73
/// what we use here is 2*Gini.. as for the later use the factor
74
/// 2 is irrelevant and hence I'd like to save this calculation
75
76
Double_t
TMVA::GiniIndex::GetSeparationIndex
(
const
Double_t
s,
const
Double_t
b
)
77
{
78
if
(s+
b
<= 0)
return
0;
79
if
(s<=0 ||
b
<=0)
return
0;
80
// else return s*b/(s+b)/(s+b);
81
else
return
2*s*
b
/(s+
b
)/(s+
b
);
82
}
83
84
GiniIndex.h
b
#define b(i)
Definition
RSha256.hxx:100
Rtypes.h
ClassImp
#define ClassImp(name)
Definition
Rtypes.h:377
TMVA::GiniIndex
Implementation of the GiniIndex as separation criterion.
Definition
GiniIndex.h:63
TMVA::GiniIndex::GetSeparationIndex
virtual Double_t GetSeparationIndex(const Double_t s, const Double_t b)
what we use here is 2*Gini.
Definition
GiniIndex.cxx:76
double
tmva
tmva
src
GiniIndex.cxx
ROOT v6-32 - Reference Guide Generated on Wed Feb 19 2025 14:19:03 (GVA Time) using Doxygen 1.10.0