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
SeparationBase.cxx
Go to the documentation of this file.
1
// @(#)root/tmva $Id$
2
// Author: Andreas Hoecker, Joerg Stelzer, Helge Voss
3
4
/**********************************************************************************
5
* Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6
* Package: TMVA *
7
* Class : SeparationBase *
8
* *
9
* *
10
* Description: An interface to different separation criteria used in various *
11
* training algorithms, as there are: *
12
* *
13
* There are two things: the Separation Index, and the Separation Gain *
14
* Separation Index: *
15
* Measure of the "purity" of a sample. If all elements (events) in the *
16
* sample belong to the same class (e.g. signal or backgr), than the *
17
* separation index is 0 (meaning 100% purity (or 0% purity as it is *
18
* symmetric. The index becomes maximal, for perfectly mixed samples *
19
* eg. purity=50% , N_signal = N_bkg *
20
* *
21
* Separation Gain: *
22
* the measure of how the quality of separation of the sample increases *
23
* by splitting the sample e.g. into a "left-node" and a "right-node" *
24
* (N * Index_parent) - (N_left * Index_left) - (N_right * Index_right) *
25
* this is then the quality criterion which is optimized for when trying *
26
* to increase the information in the system (making the best selection *
27
* *
28
* Authors (alphabetical): *
29
* Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
30
* Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
31
* Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada *
32
* *
33
* Copyright (c) 2005: *
34
* CERN, Switzerland *
35
* U. of Victoria, Canada *
36
* Heidelberg U., Germany *
37
* *
38
* Redistribution and use in source and binary forms, with or without *
39
* modification, are permitted according to the terms listed in LICENSE *
40
* (see tmva/doc/LICENSE) *
41
**********************************************************************************/
42
43
/*! \class TMVA::SeparationBase
44
\ingroup TMVA
45
An interface to calculate the "SeparationGain" for different
46
separation criteria used in various training algorithms
47
48
There are two things: the Separation Index, and the Separation Gain
49
Separation Index:
50
Measure of the "purity" of a sample. If all elements (events) in the
51
sample belong to the same class (e.g. signal or background), than the
52
separation index is 0 (meaning 100% purity (or 0% purity as it is
53
symmetric. The index becomes maximal, for perfectly mixed samples
54
eg. purity=50% , N_signal = N_bkg
55
56
Separation Gain:
57
the measure of how the quality of separation of the sample increases
58
by splitting the sample e.g. into a "left-node" and a "right-node"
59
(N * Index_parent) - (N_left * Index_left) - (N_right * Index_right)
60
this is then the quality criterion which is optimized for when trying
61
to increase the information in the system (making the best selection
62
*/
63
#include "
TMVA/SeparationBase.h
"
64
65
#include "
TMath.h
"
66
#include "
TString.h
"
67
68
#include <iostream>
69
#include <limits>
70
71
ClassImp
(
TMVA::SeparationBase
);
72
73
////////////////////////////////////////////////////////////////////////////////
74
/// Constructor.
75
76
TMVA::SeparationBase::SeparationBase
() :
77
fName(
""
),
78
fPrecisionCut(
TMath
::Sqrt(std::numeric_limits<
double
>::epsilon()))
79
{
80
// default constructor
81
}
82
83
////////////////////////////////////////////////////////////////////////////////
84
/// Copy constructor.
85
86
TMVA::SeparationBase::SeparationBase
(
const
SeparationBase
& s ) :
87
fName(s.fName),
88
fPrecisionCut(
TMath
::Sqrt(std::numeric_limits<
double
>::epsilon()))
89
{
90
// copy constructor
91
}
92
93
////////////////////////////////////////////////////////////////////////////////
94
/// Separation Gain:
95
/// the measure of how the quality of separation of the sample increases
96
/// by splitting the sample e.g. into a "left-node" and a "right-node"
97
/// (N * Index_parent) - (N_left * Index_left) - (N_right * Index_right)
98
/// this is then the quality criterion which is optimized for when trying
99
/// to increase the information in the system (making the best selection
100
101
Double_t
TMVA::SeparationBase::GetSeparationGain
(
const
Double_t
nSelS,
const
Double_t
nSelB,
102
const
Double_t
nTotS,
const
Double_t
nTotB)
103
{
104
if
( (nTotS-nSelS)==nSelS && (nTotB-nSelB)==nSelB)
return
0.;
105
106
// Double_t parentIndex = (nTotS+nTotB) *this->GetSeparationIndex(nTotS,nTotB);
107
108
// Double_t leftIndex = ( ((nTotS - nSelS) + (nTotB - nSelB))
109
// * this->GetSeparationIndex(nTotS-nSelS,nTotB-nSelB) );
110
// Double_t rightIndex = (nSelS+nSelB) * this->GetSeparationIndex(nSelS,nSelB);
111
112
113
Double_t
parentIndex
= this->GetSeparationIndex(nTotS,nTotB);
114
115
Double_t
leftIndex
= ( ((nTotS - nSelS) + (nTotB - nSelB))/(nTotS+nTotB)
116
* this->GetSeparationIndex(nTotS-nSelS,nTotB-nSelB) );
117
Double_t
rightIndex
= (nSelS+nSelB)/(nTotS+nTotB) * this->GetSeparationIndex(nSelS,nSelB);
118
119
Double_t
diff
=
parentIndex
-
leftIndex
-
rightIndex
;
120
//Double_t diff = (parentIndex - leftIndex - rightIndex)/(nTotS+nTotB);
121
122
if
(
diff
<fPrecisionCut ) {
123
// std::cout << " Warning value in GetSeparation is below numerical precision "
124
// << diff/parentIndex
125
// << std::endl;
126
return
0;
127
}
128
129
return
diff
;
130
}
131
132
ClassImp
#define ClassImp(name)
Definition
Rtypes.h:377
SeparationBase.h
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
TMath.h
TString.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TMVA::SeparationBase
An interface to calculate the "SeparationGain" for different separation criteria used in various trai...
Definition
SeparationBase.h:82
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
double
TMath
TMath.
Definition
TMathBase.h:35
tmva
tmva
src
SeparationBase.cxx
ROOT v6-32 - Reference Guide Generated on Mon Mar 10 2025 03:58:35 (GVA Time) using Doxygen 1.10.0