105 fVRangeMode(kAdaptive),
106 fKernelEstimator(
kBox),
119 fInitializedVolumeEle(0),
134 const TString& theWeightFile) :
137 fVRangeMode(kAdaptive),
138 fKernelEstimator(
kBox),
151 fInitializedVolumeEle(0),
183 fVRangeMode = kAdaptive;
184 fKernelEstimator =
kBox;
189 fMaxVIterations = 150;
190 fInitialScale = 0.99;
194 fkNNMin =
Int_t(fNEventsMin);
195 fkNNMax =
Int_t(fNEventsMax);
197 fInitializedVolumeEle =
kFALSE;
201 SetSignalReferenceCut( 0.0 );
209 if (fDelta)
delete fDelta;
210 if (fShift)
delete fShift;
212 if (NULL != fBinaryTree)
delete fBinaryTree;
253 DeclareOptionRef(fVolumeRange=
"Adaptive",
"VolumeRangeMode",
"Method to determine volume size");
254 AddPreDefVal(
TString(
"Unscaled"));
255 AddPreDefVal(
TString(
"MinMax"));
257 AddPreDefVal(
TString(
"Adaptive"));
260 DeclareOptionRef(fKernelString=
"Box",
"KernelEstimator",
"Kernel estimation function");
262 AddPreDefVal(
TString(
"Sphere"));
263 AddPreDefVal(
TString(
"Teepee"));
264 AddPreDefVal(
TString(
"Gauss"));
265 AddPreDefVal(
TString(
"Sinc3"));
266 AddPreDefVal(
TString(
"Sinc5"));
267 AddPreDefVal(
TString(
"Sinc7"));
268 AddPreDefVal(
TString(
"Sinc9"));
269 AddPreDefVal(
TString(
"Sinc11"));
270 AddPreDefVal(
TString(
"Lanczos2"));
271 AddPreDefVal(
TString(
"Lanczos3"));
272 AddPreDefVal(
TString(
"Lanczos5"));
273 AddPreDefVal(
TString(
"Lanczos8"));
276 DeclareOptionRef(fDeltaFrac ,
"DeltaFrac",
"nEventsMin/Max for minmax and rms volume range");
277 DeclareOptionRef(fNEventsMin ,
"NEventsMin",
"nEventsMin for adaptive volume range");
278 DeclareOptionRef(fNEventsMax ,
"NEventsMax",
"nEventsMax for adaptive volume range");
279 DeclareOptionRef(fMaxVIterations,
"MaxVIterations",
"MaxVIterations for adaptive volume range");
280 DeclareOptionRef(fInitialScale ,
"InitialScale",
"InitialScale for adaptive volume range");
281 DeclareOptionRef(fGaussSigma ,
"GaussSigma",
"Width (wrt volume size) of Gaussian kernel estimator");
282 DeclareOptionRef(fNormTree ,
"NormTree",
"Normalize binary search tree");
290 if (IgnoreEventsWithNegWeightsInTraining()) {
291 Log() << kFATAL <<
"Mechanism to ignore events with negative weights in training not yet available for method: "
292 << GetMethodTypeName()
293 <<
" --> please remove \"IgnoreNegWeightsInTraining\" option from booking string."
297 fGaussSigmaNorm = fGaussSigma;
301 if (fVolumeRange ==
"MinMax" ) fVRangeMode = kMinMax;
302 else if (fVolumeRange ==
"RMS" ) fVRangeMode = kRMS;
303 else if (fVolumeRange ==
"Adaptive" ) fVRangeMode = kAdaptive;
304 else if (fVolumeRange ==
"Unscaled" ) fVRangeMode = kUnscaled;
305 else if (fVolumeRange ==
"kNN" ) fVRangeMode = kkNN;
307 Log() << kFATAL <<
"VolumeRangeMode parameter '" << fVolumeRange <<
"' unknown" <<
Endl;
310 if (fKernelString ==
"Box" ) fKernelEstimator =
kBox;
311 else if (fKernelString ==
"Sphere" ) fKernelEstimator = kSphere;
312 else if (fKernelString ==
"Teepee" ) fKernelEstimator = kTeepee;
313 else if (fKernelString ==
"Gauss" ) fKernelEstimator =
kGauss;
314 else if (fKernelString ==
"Sinc3" ) fKernelEstimator = kSinc3;
315 else if (fKernelString ==
"Sinc5" ) fKernelEstimator = kSinc5;
316 else if (fKernelString ==
"Sinc7" ) fKernelEstimator = kSinc7;
317 else if (fKernelString ==
"Sinc9" ) fKernelEstimator = kSinc9;
318 else if (fKernelString ==
"Sinc11" ) fKernelEstimator = kSinc11;
319 else if (fKernelString ==
"Lanczos2" ) fKernelEstimator = kLanczos2;
320 else if (fKernelString ==
"Lanczos3" ) fKernelEstimator = kLanczos3;
321 else if (fKernelString ==
"Lanczos5" ) fKernelEstimator = kLanczos5;
322 else if (fKernelString ==
"Lanczos8" ) fKernelEstimator = kLanczos8;
323 else if (fKernelString ==
"Trim" ) fKernelEstimator = kTrim;
325 Log() << kFATAL <<
"KernelEstimator parameter '" << fKernelString <<
"' unknown" <<
Endl;
330 Log() << kVERBOSE <<
"interpreted option string: vRangeMethod: '"
331 << (
const char*)((fVRangeMode == kMinMax) ?
"MinMax" :
332 (fVRangeMode == kUnscaled) ?
"Unscaled" :
333 (fVRangeMode == kRMS ) ?
"RMS" :
"Adaptive") <<
"'" <<
Endl;
334 if (fVRangeMode == kMinMax || fVRangeMode == kRMS)
335 Log() << kVERBOSE <<
"deltaFrac: " << fDeltaFrac <<
Endl;
337 Log() << kVERBOSE <<
"nEventsMin/Max, maxVIterations, initialScale: "
338 << fNEventsMin <<
" " << fNEventsMax
339 <<
" " << fMaxVIterations <<
" " << fInitialScale <<
Endl;
340 Log() << kVERBOSE <<
"KernelEstimator = " << fKernelString <<
Endl;
351 if (IsNormalised()) Log() << kFATAL <<
"\"Normalise\" option cannot be used with PDERS; "
352 <<
"please remove the option from the configuration string, or "
353 <<
"use \"!Normalise\""
361 fInitializedVolumeEle =
kTRUE;
370 if (fInitializedVolumeEle ==
kFALSE) {
371 fInitializedVolumeEle =
kTRUE;
374 assert( fBinaryTree );
381 NoErrorCalc(err, errUpper);
383 return this->CRScalc( *GetEvent() );
390 if (fRegressionReturnVal == 0) fRegressionReturnVal =
new std::vector<Float_t>;
391 fRegressionReturnVal->clear();
394 if (fInitializedVolumeEle ==
kFALSE) {
395 fInitializedVolumeEle =
kTRUE;
398 assert( fBinaryTree );
405 const Event* ev = GetEvent();
406 this->RRScalc( *ev, fRegressionReturnVal );
410 for (std::vector<Float_t>::iterator it = fRegressionReturnVal->begin(); it != fRegressionReturnVal->end(); ++it ) {
415 const Event* evT2 = GetTransformationHandler().InverseTransform( evT );
416 fRegressionReturnVal->clear();
419 fRegressionReturnVal->push_back(evT2->
GetTarget(ivar));
425 return (*fRegressionReturnVal);
433 if (fVRangeMode == kAdaptive || fVRangeMode == kRMS || fVRangeMode == kkNN ) {
435 fBinaryTree->CalcStatistics();
437 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) {
438 if (!DoRegression()){
441 fAverageRMS.push_back( (rmsS + rmsB)*0.5 );
443 Float_t rms = fBinaryTree->RMS( ivar );
444 fAverageRMS.push_back( rms );
455 if (NULL != fBinaryTree)
delete fBinaryTree;
458 fBinaryTree->SetNormalize(
kTRUE );
461 fBinaryTree->Fill( GetEventCollection(
type) );
464 fBinaryTree->NormalizeTree();
467 if (!DoRegression()) {
472 Log() << kVERBOSE <<
"Signal and background scales: " << fScaleS <<
" " << fScaleB <<
Endl;
481 Log() << kFATAL <<
"GetNvar() == 0" <<
Endl;
486 fkNNMin =
Int_t(fNEventsMin);
487 fkNNMax =
Int_t(fNEventsMax);
489 if (fDelta)
delete fDelta;
490 if (fShift)
delete fShift;
491 fDelta =
new std::vector<Float_t>( GetNvar() );
492 fShift =
new std::vector<Float_t>( GetNvar() );
494 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) {
495 switch (fVRangeMode) {
501 if (fAverageRMS.size() != GetNvar())
502 Log() << kFATAL <<
"<SetVolumeElement> RMS not computed: " << fAverageRMS.size() <<
Endl;
503 (*fDelta)[ivar] = fAverageRMS[ivar]*fDeltaFrac;
504 Log() << kVERBOSE <<
"delta of var[" << (*fInputVars)[ivar]
505 <<
"\t]: " << fAverageRMS[ivar]
506 <<
"\t | comp with |max - min|: " << (GetXmax( ivar ) - GetXmin( ivar ))
510 (*fDelta)[ivar] = (GetXmax( ivar ) - GetXmin( ivar ))*fDeltaFrac;
513 (*fDelta)[ivar] = fDeltaFrac;
516 Log() << kFATAL <<
"<SetVolumeElement> unknown range-set mode: "
517 << fVRangeMode <<
Endl;
519 (*fShift)[ivar] = 0.5;
529 return ThisPDERS()->GetVolumeContentForRoot( scale );
538 v.ScaleInterval( scale );
540 Double_t count = GetBinaryTree()->SearchVolume( &
v );
547 std::vector<const BinarySearchTreeNode*>& events,
558#ifdef TMVA_MethodPDERS__countByHand__Debug__
561 count = fBinaryTree->SearchVolume( volume );
563 Int_t iS = 0, iB = 0;
565 for (
UInt_t ievt_=0; ievt_<Data()->GetNTrainingEvents(); ievt_++) {
566 const Event * ev = GetTrainingEvent(ievt_);
568 for (
Int_t ivar=0; ivar<nvar; ivar++) {
570 inV = (
x > (*volume->Lower)[ivar] &&
x <= (*volume->Upper)[ivar]);
577 Log() << kVERBOSE <<
"debug: my test: " << in <<
Endl;
578 Log() << kVERBOSE <<
"debug: binTree: " << count <<
Endl <<
Endl;
584 if (fVRangeMode == kRMS || fVRangeMode == kMinMax || fVRangeMode == kUnscaled) {
586 std::vector<Double_t> *lb =
new std::vector<Double_t>( GetNvar() );
587 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) (*lb)[ivar] =
e.GetValue(ivar);
588 std::vector<Double_t> *ub =
new std::vector<Double_t>( *lb );
589 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) {
590 (*lb)[ivar] -= (*fDelta)[ivar]*(1.0 - (*fShift)[ivar]);
591 (*ub)[ivar] += (*fDelta)[ivar]*(*fShift)[ivar];
596 fBinaryTree->SearchVolume( svolume, &events );
598 else if (fVRangeMode == kAdaptive) {
604 if (MethodPDERS_UseFindRoot) {
608 fHelpVolume = volume;
611 RootFinder rootFinder(
this, 0.01, 50, 200, 10 );
612 Double_t scale = rootFinder.
Root( (fNEventsMin + fNEventsMax)/2.0 );
616 fBinaryTree->SearchVolume( volume, &events );
624 count = fBinaryTree->SearchVolume( volume );
629 while (nEventsO < fNEventsMin) {
631 count = fBinaryTree->SearchVolume( volume );
635 if (i_ > 50) Log() << kWARNING <<
"warning in event: " <<
e
636 <<
": adaptive volume pre-adjustment reached "
637 <<
">50 iterations in while loop (" << i_ <<
")" <<
Endl;
640 Float_t nEventsE = 0.5*(fNEventsMin + fNEventsMax);
642 Float_t scaleN = fInitialScale;
645 Float_t nEventsBest = nEventsN;
647 for (
Int_t ic=1; ic<fMaxVIterations; ic++) {
648 if (nEventsN < fNEventsMin || nEventsN > fNEventsMax) {
652 v->ScaleInterval( scale );
653 nEventsN = fBinaryTree->SearchVolume(
v );
656 if (nEventsN > 1 && nEventsN - nEventsO != 0)
657 if (scaleN - scaleO != 0)
658 scale += (scaleN - scaleO)/(nEventsN - nEventsO)*(nEventsE - nEventsN);
669 (nEventsN >= fNEventsMin || nEventsBest < nEventsN)) {
670 nEventsBest = nEventsN;
681 nEventsN = nEventsBest;
683 if (nEventsN < fNEventsMin-1 || nEventsN > fNEventsMax+1)
684 Log() << kWARNING <<
"warning in event " <<
e
685 <<
": adaptive volume adjustment reached "
686 <<
"max. #iterations (" << fMaxVIterations <<
")"
687 <<
"[ nEvents: " << nEventsN <<
" " << fNEventsMin <<
" " << fNEventsMax <<
"]"
691 fBinaryTree->SearchVolume( volume, &events );
696 }
else if (fVRangeMode == kkNN) {
701 Int_t kNNcount = fBinaryTree->SearchVolumeWithMaxLimit( &
v, &events, fkNNMax+1 );
706 while ( !(kNNcount >= fkNNMin && kNNcount <= fkNNMax) ) {
707 if (kNNcount < fkNNMin) {
711 else if (kNNcount > fkNNMax) {
719 kNNcount = fBinaryTree->SearchVolumeWithMaxLimit( &
v, &events, fkNNMax+1 );
723 if (t_times == fMaxVIterations) {
724 Log() << kWARNING <<
"warning in event" <<
e
725 <<
": kNN volume adjustment reached "
726 <<
"max. #iterations (" << fMaxVIterations <<
")"
727 <<
"[ kNN: " << fkNNMin <<
" " << fkNNMax <<
Endl;
734 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) {
735 dim_normalization [ivar] = 1.0 / ((*
v.fUpper)[ivar] - (*
v.fLower)[ivar]);
738 std::vector<const BinarySearchTreeNode*> tempVector;
740 if (kNNcount >= fkNNMin) {
741 std::vector<Double_t> *distances =
new std::vector<Double_t>( kNNcount );
745 (*distances)[j] = GetNormalizedDistance (
e, *events[j], dim_normalization );
748 std::vector<Double_t>::iterator wsk = distances->begin();
749 for (
Int_t j=0;j<fkNNMin-1;++j) ++wsk;
750 std::nth_element( distances->begin(), wsk, distances->end() );
755 Double_t dist = GetNormalizedDistance(
e, *events[j], dim_normalization );
757 if (dist <= (*distances)[fkNNMin-1])
758 tempVector.push_back( events[j] );
760 fMax_distance = (*distances)[fkNNMin-1];
763 delete[] dim_normalization;
769 Log() << kFATAL <<
"<GetSample> unknown RangeMode: " << fVRangeMode <<
Endl;
778 std::vector<const BinarySearchTreeNode*> events;
783 std::vector<Double_t> *lb =
new std::vector<Double_t>( GetNvar() );
784 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) (*lb)[ivar] =
e.GetValue(ivar);
786 std::vector<Double_t> *ub =
new std::vector<Double_t>( *lb );
787 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) {
788 (*lb)[ivar] -= (*fDelta)[ivar]*(1.0 - (*fShift)[ivar]);
789 (*ub)[ivar] += (*fDelta)[ivar]*(*fShift)[ivar];
794 GetSample(
e, events, volume );
795 Double_t count = CKernelEstimate(
e, events, *volume );
807 std::vector<const BinarySearchTreeNode*> events;
812 std::vector<Double_t> *lb =
new std::vector<Double_t>( GetNvar() );
813 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) (*lb)[ivar] =
e.GetValue(ivar);
815 std::vector<Double_t> *ub =
new std::vector<Double_t>( *lb );
816 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) {
817 (*lb)[ivar] -= (*fDelta)[ivar]*(1.0 - (*fShift)[ivar]);
818 (*ub)[ivar] += (*fDelta)[ivar]*(*fShift)[ivar];
822 GetSample(
e, events, volume );
823 RKernelEstimate(
e, events, *volume, count );
833 std::vector<const BinarySearchTreeNode*>& events,
Volume&
v )
836 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++)
837 dim_normalization [ivar] = 2 / ((*
v.fUpper)[ivar] - (*
v.fLower)[ivar]);
843 for (std::vector<const BinarySearchTreeNode*>::iterator iev = events.begin(); iev != events.end(); ++iev) {
846 Double_t normalized_distance = GetNormalizedDistance (
event, *(*iev), dim_normalization);
850 if (normalized_distance > 1 && fKernelEstimator !=
kBox)
continue;
852 if ( (*iev)->GetClass()==fSignalClass )
853 pdfSumS += ApplyKernelFunction (normalized_distance) * (*iev)->GetWeight();
855 pdfSumB += ApplyKernelFunction (normalized_distance) * (*iev)->GetWeight();
857 pdfSumS = KernelNormalization( pdfSumS < 0. ? 0. : pdfSumS );
858 pdfSumB = KernelNormalization( pdfSumB < 0. ? 0. : pdfSumB );
860 delete[] dim_normalization;
862 if (pdfSumS < 1
e-20 && pdfSumB < 1
e-20)
return 0.5;
863 if (pdfSumB < 1
e-20)
return 1.0;
864 if (pdfSumS < 1
e-20)
return 0.0;
866 Float_t r = pdfSumB*fScaleB/(pdfSumS*fScaleS);
867 return 1.0/(
r + 1.0);
874 std::vector<const BinarySearchTreeNode*>& events,
Volume&
v,
875 std::vector<Float_t>* pdfSum )
878 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++)
879 dim_normalization [ivar] = 2 / ((*
v.fUpper)[ivar] - (*
v.fLower)[ivar]);
886 for (
Int_t ivar = 0; ivar < fNRegOut ; ivar++)
887 pdfSum->push_back( 0 );
890 for (std::vector<const BinarySearchTreeNode*>::iterator iev = events.begin(); iev != events.end(); ++iev) {
893 Double_t normalized_distance = GetNormalizedDistance (
event, *(*iev), dim_normalization);
897 if (normalized_distance > 1 && fKernelEstimator !=
kBox)
continue;
899 for (
Int_t ivar = 0; ivar < fNRegOut ; ivar++) {
900 pdfSum->at(ivar) += ApplyKernelFunction (normalized_distance) * (*iev)->GetWeight() * (*iev)->GetTargets()[ivar];
901 pdfDiv += ApplyKernelFunction (normalized_distance) * (*iev)->GetWeight();
905 delete[] dim_normalization;
910 for (
Int_t ivar = 0; ivar < fNRegOut ; ivar++)
911 pdfSum->at(ivar) /= pdfDiv;
922 switch (fKernelEstimator) {
928 return (1 - normalized_distance);
938 Double_t side_crossings = 2 + ((
int) fKernelEstimator) - ((
int) kSinc3);
939 return NormSinc (side_crossings * normalized_distance);
943 return LanczosFilter (2, normalized_distance);
946 return LanczosFilter (3, normalized_distance);
949 return LanczosFilter (5, normalized_distance);
952 return LanczosFilter (8, normalized_distance);
955 Double_t x = normalized_distance / fMax_distance;
961 Log() << kFATAL <<
"Kernel estimation function unsupported. Enumerator is " << fKernelEstimator <<
Endl;
978 if (ret != 0.0)
return ret*pdf;
981 switch (fKernelEstimator) {
1007 Log() << kFATAL <<
"Kernel estimation function unsupported. Enumerator is " << fKernelEstimator <<
Endl;
1025 for (
UInt_t ivar=0; ivar<GetNvar(); ivar++) {
1039 if (x < 10e-10 && x > -10
e-10) {
1060 if (x < 10e-10 && x > -10
e-10) {
1084 if (
d < 1
e-10)
return 1;
1087 Float_t err =
f*countB*countB*sumW2S +
f*countS*countS*sumW2B;
1089 if (err < 1
e-10)
return 1;
1101 fBinaryTree->AddXMLTo(wght);
1103 Log() << kFATAL <<
"Signal and background binary search tree not available" <<
Endl;
1111 if (NULL != fBinaryTree)
delete fBinaryTree;
1115 Log() << kFATAL <<
"Could not create BinarySearchTree from XML" <<
Endl;
1117 Log() << kFATAL <<
"Could not create BinarySearchTree from XML" <<
Endl;
1118 fBinaryTree->SetPeriode( GetNvar() );
1119 fBinaryTree->CalcStatistics();
1120 fBinaryTree->CountNodes();
1127 Log() << kINFO <<
"signal and background scales: " << fScaleS <<
" " << fScaleB <<
Endl;
1130 fInitializedVolumeEle =
kTRUE;
1138 if (NULL != fBinaryTree)
delete fBinaryTree;
1142 istr >> *fBinaryTree;
1144 fBinaryTree->SetPeriode( GetNvar() );
1146 fBinaryTree->CalcStatistics();
1148 fBinaryTree->CountNodes();
1154 Log() << kINFO <<
"signal and background scales: " << fScaleS <<
" " << fScaleB <<
Endl;
1160 fInitializedVolumeEle =
kTRUE;
1182 return GetMethodPDERSThreadLocal();
1189 GetMethodPDERSThreadLocal() =
this;
1197 fout <<
" // not implemented for class: \"" << className <<
"\"" << std::endl;
1198 fout <<
"};" << std::endl;
1212 Log() <<
"PDERS is a generalization of the projective likelihood classifier " <<
Endl;
1213 Log() <<
"to N dimensions, where N is the number of input variables used." <<
Endl;
1214 Log() <<
"In its adaptive form it is mostly equivalent to k-Nearest-Neighbor" <<
Endl;
1215 Log() <<
"(k-NN) methods. If the multidimensional PDF for signal and background" <<
Endl;
1216 Log() <<
"were known, this classifier would exploit the full information" <<
Endl;
1217 Log() <<
"contained in the input variables, and would hence be optimal. In " <<
Endl;
1218 Log() <<
"practice however, huge training samples are necessary to sufficiently " <<
Endl;
1219 Log() <<
"populate the multidimensional phase space. " <<
Endl;
1221 Log() <<
"The simplest implementation of PDERS counts the number of signal" <<
Endl;
1222 Log() <<
"and background events in the vicinity of a test event, and returns" <<
Endl;
1223 Log() <<
"a weight according to the majority species of the neighboring events." <<
Endl;
1224 Log() <<
"A more involved version of PDERS (selected by the option \"KernelEstimator\")" <<
Endl;
1225 Log() <<
"uses Kernel estimation methods to approximate the shape of the PDF." <<
Endl;
1229 Log() <<
"PDERS can be very powerful in case of strongly non-linear problems, " <<
Endl;
1230 Log() <<
"e.g., distinct islands of signal and background regions. Because of " <<
Endl;
1231 Log() <<
"the exponential growth of the phase space, it is important to restrict" <<
Endl;
1232 Log() <<
"the number of input variables (dimension) to the strictly necessary." <<
Endl;
1234 Log() <<
"Note that PDERS is a slowly responding classifier. Moreover, the necessity" <<
Endl;
1235 Log() <<
"to store the entire binary tree in memory, to avoid accessing virtual " <<
Endl;
1236 Log() <<
"memory, limits the number of training events that can effectively be " <<
Endl;
1237 Log() <<
"used to model the multidimensional PDF." <<
Endl;
1241 Log() <<
"If the PDERS response is found too slow when using the adaptive volume " <<
Endl;
1242 Log() <<
"size (option \"VolumeRangeMode=Adaptive\"), it might be found beneficial" <<
Endl;
1243 Log() <<
"to reduce the number of events required in the volume, and/or to enlarge" <<
Endl;
1244 Log() <<
"the allowed range (\"NeventsMin/Max\"). PDERS is relatively insensitive" <<
Endl;
1245 Log() <<
"to the width (\"GaussSigma\") of the Gaussian kernel (if used)." <<
Endl;
#define REGISTER_METHOD(CLASS)
for example
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Node for the BinarySearch or Decision Trees.
const std::vector< Float_t > & GetEventV() const
A simple Binary search tree including a volume search method.
static BinarySearchTree * CreateFromXML(void *node, UInt_t tmva_Version_Code=262657)
re-create a new tree (decision tree or search tree) from XML
Class that contains all the data information.
Float_t GetValue(UInt_t ivar) const
return value of i'th variable
void SetTarget(UInt_t itgt, Float_t value)
set the target value (dimension itgt) to value
UInt_t GetNTargets() const
accessor to the number of targets
Float_t GetTarget(UInt_t itgt) const
Virtual base Class for all MVA method.
This is a generalization of the above Likelihood methods to dimensions, where is the number of inpu...
void ReadWeightsFromXML(void *wghtnode) override
void DeclareOptions() override
define the options (their key words) that can be set in the option string.
void GetHelpMessage() const override
get help message text
void WriteWeightsToStream(TFile &rf) const
write training sample (TTree) to file
void CreateBinarySearchTree(Types::ETreeType type)
create binary search trees for signal and background
BinarySearchTree * fBinaryTree
binary tree
void MakeClassSpecific(std::ostream &, const TString &) const override
write specific classifier response
virtual ~MethodPDERS(void)
destructor
MethodPDERS(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption)
standard constructor for the PDERS method
void GetSample(const Event &e, std::vector< const BinarySearchTreeNode * > &events, Volume *volume)
void ReadWeightsFromStream(std::istream &istr) override
read weight info from file
void ProcessOptions() override
process the options specified by the user
void AddWeightsXMLTo(void *parent) const override
write weights to xml file
Float_t GetError(Float_t countS, Float_t countB, Float_t sumW2S, Float_t sumW2B) const
statistical error estimate for RS estimator
static MethodPDERS * ThisPDERS(void)
static pointer to this object
Double_t GetMvaValue(Double_t *err=nullptr, Double_t *errUpper=nullptr) override
init the size of a volume element using a defined fraction of the volume containing the entire events
void Train(void) override
this is a dummy training: the preparation work to do is the construction of the binary tree as a poin...
Double_t KernelNormalization(Double_t pdf)
Calculating the normalization factor only once (might need a reset at some point.
void RRScalc(const Event &, std::vector< Float_t > *count)
void UpdateThis()
update static this pointer
Double_t CRScalc(const Event &)
void Init(void) override
default initialisation routine called by all constructors
void CalcAverages()
compute also average RMS values required for adaptive Gaussian
void RKernelEstimate(const Event &, std::vector< const BinarySearchTreeNode * > &, Volume &, std::vector< Float_t > *pdfSum)
normalization factors so we can work with radius 1 hyperspheres
Double_t NormSinc(Double_t x)
NormSinc.
void SetVolumeElement(void)
defines volume dimensions
const std::vector< Float_t > & GetRegressionValues() override
Double_t LanczosFilter(Int_t level, Double_t x)
Lanczos Filter.
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override
PDERS can handle classification with 2 classes and regression with one or more regression-targets.
Double_t CKernelEstimate(const Event &, std::vector< const BinarySearchTreeNode * > &, Volume &)
normalization factors so we can work with radius 1 hyperspheres
Double_t ApplyKernelFunction(Double_t normalized_distance)
from the normalized euclidean distance calculate the distance for a certain kernel
Double_t GetNormalizedDistance(const TMVA::Event &base_event, const BinarySearchTreeNode &sample_event, Double_t *dim_normalization)
We use Euclidian metric here. Might not be best or most efficient.
static Double_t IGetVolumeContentForRoot(Double_t)
Interface to RootFinder.
Double_t GetVolumeContentForRoot(Double_t)
count number of events in rescaled volume
Root finding using Brents algorithm (translated from CERNLIB function RZERO)
Double_t Root(Double_t refValue)
Root finding using Brents algorithm; taken from CERNLIB function RZERO.
Singleton class for Global types used by TMVA.
@ kSignal
Never change this number - it is elsewhere assumed to be zero !
Volume for BinarySearchTree.
void ScaleInterval(Double_t f)
"scale" the volume by symmetrically blowing up the interval in each dimension
const Bool_t MethodPDERS_UseFindRoot
create variable transformations
MsgLogger & Endl(MsgLogger &ml)
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Double_t Gamma(Double_t z)
Computation of gamma(z) for all z.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.