123 const TString& theWeightFile) :
210 DeclareOptionRef(
fFrac = 0.001,
"TailCut",
"Fraction of outlier events that are excluded from the foam in each dimension" );
211 DeclareOptionRef(
fVolFrac = 1./15.,
"VolFrac",
"Size of sampling box, used for density calculation during foam build-up (maximum value: 1.0 is equivalent to volume of entire foam)");
254 Log() << kWARNING <<
"TailCut not in [0.,1] ==> using 0.001 instead" <<
Endl;
259 Log() << kWARNING <<
"invalid number of active cells specified: "
267 Log() << kFATAL <<
"Decision tree logic works only for a single foam (SigBgSeparate=F)" <<
Endl;
275 else if (
fDTLogic ==
"MisClassificationError")
277 else if (
fDTLogic ==
"CrossEntropy")
279 else if (
fDTLogic ==
"GiniIndexWithLaplace")
281 else if (
fDTLogic ==
"SdivSqrtSplusB")
284 Log() << kWARNING <<
"Unknown separation type: " <<
fDTLogic
285 <<
", setting to None" <<
Endl;
299 Log() << kWARNING <<
"Warning: number of targets > 1"
300 <<
" and MultiTargetRegression=F was set, this makes no sense!"
301 <<
" --> I'm setting MultiTargetRegression=T" <<
Endl;
335 for (
UInt_t dim=0; dim<kDim; dim++) {
340 Log() << kDEBUG <<
"Number of training events: " <<
Data()->GetNTrainingEvents() <<
Endl;
342 Int_t rangehistbins = 10000;
348 for (
UInt_t dim=0; dim<kDim; dim++) {
370 for (
UInt_t dim=0; dim<kDim; dim++) {
377 for (
UInt_t dim=0; dim<kDim; dim++) {
390 for (
UInt_t dim=0; dim<kDim; dim++) {
391 for (
Int_t i=1; i<(rangehistbins+1); i++) {
392 if (range_h[dim]->Integral(0, i) > nevoutside) {
397 for (
Int_t i=rangehistbins; i>0; i--) {
398 if (range_h[dim]->Integral(i, (rangehistbins+1)) > nevoutside) {
409 for (
UInt_t dim=0; dim<kDim; dim++) {
419 for (
UInt_t dim=0; dim<kDim; dim++)
431 Log() << kVERBOSE <<
"Calculate Xmin and Xmax for every dimension" <<
Endl;
448 if (
DataInfo().GetNormalization() !=
"EQUALNUMEVENTS" ) {
449 Log() << kHEADER <<
"NormMode=" <<
DataInfo().GetNormalization()
450 <<
" chosen. Note that only NormMode=EqualNumEvents"
451 <<
" ensures that Discriminant values correspond to"
452 <<
" signal probabilities." <<
Endl;
455 Log() << kDEBUG <<
"N_sig for training events: " <<
Data()->GetNEvtSigTrain() <<
Endl;
456 Log() << kDEBUG <<
"N_bg for training events: " <<
Data()->GetNEvtBkgdTrain() <<
Endl;
457 Log() << kDEBUG <<
"User normalization: " <<
DataInfo().GetNormalization().Data() <<
Endl;
469 fFoam.at(i)->DeleteBinarySearchTree();
483 foamcaption[0] =
"SignalFoam";
484 foamcaption[1] =
"BgFoam";
486 for(
int i=0; i<2; i++) {
490 Log() << kVERBOSE <<
"Filling binary search tree of " << foamcaption[i]
491 <<
" with events" <<
Endl;
495 if ((i==0 &&
DataInfo().IsSignal(ev)) || (i==1 && !
DataInfo().IsSignal(ev)))
497 fFoam.back()->FillBinarySearchTree(ev);
500 Log() << kINFO <<
"Build up " << foamcaption[i] <<
Endl;
501 fFoam.back()->Create();
503 Log() << kVERBOSE <<
"Filling foam cells with events" <<
Endl;
508 if ((i==0 &&
DataInfo().IsSignal(ev)) || (i==1 && !
DataInfo().IsSignal(ev)))
510 fFoam.back()->FillFoamCells(ev, weight);
523 Log() << kVERBOSE <<
"Filling binary search tree of discriminator foam with events" <<
Endl;
528 fFoam.back()->FillBinarySearchTree(ev);
531 Log() << kINFO <<
"Build up discriminator foam" <<
Endl;
532 fFoam.back()->Create();
534 Log() << kVERBOSE <<
"Filling foam cells with events" <<
Endl;
540 fFoam.back()->FillFoamCells(ev, weight);
543 Log() << kVERBOSE <<
"Calculate cell discriminator"<<
Endl;
545 fFoam.back()->Finalize();
557 for (
UInt_t iClass=0; iClass<
DataInfo().GetNClasses(); ++iClass) {
561 Log() << kVERBOSE <<
"Filling binary search tree of multiclass foam "
562 << iClass <<
" with events" <<
Endl;
567 fFoam.back()->FillBinarySearchTree(ev);
570 Log() << kINFO <<
"Build up multiclass foam " << iClass <<
Endl;
571 fFoam.back()->Create();
573 Log() << kVERBOSE <<
"Filling foam cells with events" <<
Endl;
580 fFoam.back()->FillFoamCells(ev, weight);
583 Log() << kVERBOSE <<
"Calculate cell discriminator"<<
Endl;
585 fFoam.back()->Finalize();
597 Log() << kFATAL <<
"Can't do mono-target regression with "
598 <<
Data()->GetNTargets() <<
" targets!" <<
Endl;
601 Log() << kDEBUG <<
"MethodPDEFoam: number of Targets: " <<
Data()->GetNTargets() <<
Endl;
603 fFoam.push_back(
InitFoam(
"MonoTargetRegressionFoam", kMonoTarget) );
605 Log() << kVERBOSE <<
"Filling binary search tree with events" <<
Endl;
610 fFoam.back()->FillBinarySearchTree(ev);
613 Log() << kINFO <<
"Build mono target regression foam" <<
Endl;
614 fFoam.back()->Create();
616 Log() << kVERBOSE <<
"Filling foam cells with events" <<
Endl;
622 fFoam.back()->FillFoamCells(ev, weight);
625 Log() << kVERBOSE <<
"Calculate average cell targets"<<
Endl;
627 fFoam.back()->Finalize();
637 Log() << kDEBUG <<
"Number of variables: " <<
Data()->GetNVariables() <<
Endl;
638 Log() << kDEBUG <<
"Number of Targets: " <<
Data()->GetNTargets() <<
Endl;
639 Log() << kDEBUG <<
"Dimension of foam: " <<
Data()->GetNVariables()+
Data()->GetNTargets() <<
Endl;
641 Log() << kFATAL <<
"LinNeighbors kernel currently not supported"
642 <<
" for multi target regression" <<
Endl;
644 fFoam.push_back(
InitFoam(
"MultiTargetRegressionFoam", kMultiTarget) );
646 Log() << kVERBOSE <<
"Filling binary search tree of multi target regression foam with events"
653 std::vector<Float_t> targets(ev->
GetTargets());
655 for (
UInt_t i = 0; i < targets.size(); ++i)
656 ev->
SetVal(i+nVariables, targets.at(i));
659 fFoam.back()->FillBinarySearchTree(ev);
665 Log() << kINFO <<
"Build multi target regression foam" <<
Endl;
666 fFoam.back()->Create();
668 Log() << kVERBOSE <<
"Filling foam cells with events" <<
Endl;
674 std::vector<Float_t> targets = ev->
GetTargets();
677 for (
UInt_t i = 0; i < targets.size(); ++i)
678 ev->
SetVal(i+nVariables, targets.at(i));
681 fFoam.back()->FillFoamCells(ev, weight);
714 std::vector<Float_t> xvec = ev->
GetValues();
722 if ( (density_sig+density_bg) > 0 )
723 discr = density_sig/(density_sig+density_bg);
733 if (
err || errUpper) {
735 if (
err != 0) *
err = discr_error;
736 if (errUpper != 0) *errUpper = discr_error;
740 return (discr < 0.5 ? -1 : 1);
760 const std::vector<Float_t>& xvec = ev->
GetValues();
769 if ((neventsS > 1
e-10) || (neventsB > 1
e-10)) {
771 mvaError =
TMath::Sqrt(
Sqr(scaleB * neventsB /
Sqr(neventsS + scaleB * neventsB) * errorS) +
772 Sqr(scaleB * neventsS /
Sqr(neventsS + scaleB * neventsB) * errorB));
791 std::vector<Float_t> xvec = ev->
GetValues();
798 std::vector<Float_t> temp;
800 temp.reserve(nClasses);
801 for (
UInt_t iClass = 0; iClass < nClasses; ++iClass) {
805 for (
UInt_t iClass = 0; iClass < nClasses; ++iClass) {
807 for (
UInt_t j = 0; j < nClasses; ++j) {
809 norm += exp(temp[j] - temp[iClass]);
826 std::vector<Float_t> importance(
GetNvar(), 0);
829 for (
UInt_t ifoam = 0; ifoam <
fFoam.size(); ++ifoam) {
832 std::vector<UInt_t> nCuts(
fFoam.at(ifoam)->GetTotDim(), 0);
838 std::vector<Float_t> tmp_importance;
840 sumOfCuts += nCuts.at(ivar);
841 tmp_importance.push_back( nCuts.at(ivar) );
847 tmp_importance.at(ivar) /= sumOfCuts;
849 tmp_importance.at(ivar) = 0;
853 importance.at(ivar) += tmp_importance.at(ivar) /
fFoam.size();
877 if (cell == NULL || cell->
GetStat() == 1)
894 Log() << kFATAL <<
"Null pointer given!" <<
Endl;
900 num_vars +=
Data()->GetNTargets();
902 for (
UInt_t idim=0; idim<num_vars; idim++) {
903 Log()<< kDEBUG <<
"foam: SetXmin[dim="<<idim<<
"]: " <<
fXmin.at(idim) <<
Endl;
904 Log()<< kDEBUG <<
"foam: SetXmax[dim="<<idim<<
"]: " <<
fXmax.at(idim) <<
Endl;
937 if (ft == kMultiTarget)
939 dim =
Data()->GetNTargets() +
Data()->GetNVariables();
944 std::vector<Double_t>
box;
945 for (
Int_t idim = 0; idim < dim; ++idim) {
973 Log() << kFATAL <<
"Unknown PDEFoam type!" <<
Endl;
986 case kMisClassificationError:
992 case kGiniIndexWithLaplace:
995 case kSdivSqrtSplusB:
1000 <<
" currently not supported" <<
Endl;
1010 Log() << kFATAL <<
"Decision tree cell split algorithm is only"
1011 <<
" available for (multi) classification with a single"
1012 <<
" PDE-Foam (SigBgSeparate=F)" <<
Endl;
1018 else Log() << kFATAL <<
"PDEFoam pointer not set, exiting.." <<
Endl;
1056 std::vector<Float_t> vals = ev->
GetValues();
1059 Log() << kWARNING <<
"<GetRegressionValues> value vector is empty. " <<
Endl;
1064 std::map<Int_t, Float_t> xvec;
1065 for (
UInt_t i=0; i<vals.size(); ++i)
1066 xvec.insert(std::pair<Int_t, Float_t>(i, vals.at(i)));
1068 std::vector<Float_t> targets =
fFoam.at(0)->GetCellValue( xvec, kValue );
1072 Log() << kFATAL <<
"Something wrong with multi-target regression foam: "
1073 <<
"number of targets does not match the DataSet()" <<
Endl;
1074 for(
UInt_t i=0; i<targets.size(); i++)
1083 for (
UInt_t itgt = 0; itgt <
Data()->GetNTargets(); itgt++) {
1088 for (
UInt_t itgt = 0; itgt <
Data()->GetNTargets(); itgt++) {
1111 Log() << kFATAL <<
"Kernel: " <<
fKernel <<
" not supported!" <<
Endl;
1207 TFile *rootFile = 0;
1208 if (
fCompress) rootFile =
new TFile(rfname,
"RECREATE",
"foamfile", 9);
1209 else rootFile =
new TFile(rfname,
"RECREATE");
1213 Log() <<
"writing foam " <<
fFoam.at(i)->GetFoamName().Data()
1214 <<
" to file" <<
Endl;
1215 fFoam.at(i)->Write(
fFoam.at(i)->GetFoamName().Data());
1219 Log() << kINFO <<
"Foams written to file: "
1242 Bool_t CutNmin, CutRMSmin;
1265 kDim +=
Data()->GetNTargets();
1266 fXmin.assign(kDim, 0);
1267 fXmax.assign(kDim, 0);
1270 for (
UInt_t i=0; i<kDim; i++)
1271 istr >>
fXmin.at(i);
1272 for (
UInt_t i=0; i<kDim; i++)
1273 istr >>
fXmax.at(i);
1308 if (
gTools().HasAttr(wghtnode,
"FillFoamWithOrigWeights"))
1310 if (
gTools().HasAttr(wghtnode,
"UseYesNoCell"))
1318 kDim +=
Data()->GetNTargets();
1319 fXmin.assign(kDim, 0);
1320 fXmax.assign(kDim, 0);
1324 for (
UInt_t counter=0; counter<kDim; counter++) {
1328 Log() << kFATAL <<
"dimension index out of range:" << i <<
Endl;
1333 void *xmax_wrap = xmin_wrap;
1334 for (
UInt_t counter=0; counter<kDim; counter++) {
1338 Log() << kFATAL <<
"dimension index out of range:" << i <<
Endl;
1376 Log() << kWARNING <<
"<ReadClonedFoamFromFile>: NULL pointer given" <<
Endl;
1388 Log() << kWARNING <<
"<ReadClonedFoamFromFile>: " << foamname
1389 <<
" could not be cloned!" <<
Endl;
1409 Log() << kINFO <<
"Read foams from file: " <<
gTools().
Color(
"lightblue")
1411 TFile *rootFile =
new TFile( rfname,
"READ" );
1412 if (rootFile->
IsZombie())
Log() << kFATAL <<
"Cannot open file \"" << rfname <<
"\"" <<
Endl;
1428 fFoam.push_back(foam);
1431 for (
UInt_t iClass=0; iClass<
DataInfo().GetNClasses(); ++iClass) {
1445 Log() << kFATAL <<
"Could not load foam!" <<
Endl;
1455 case 0:
return kNone;
1456 case 1:
return kGaus;
1457 case 2:
return kLinN;
1459 Log() << kWARNING <<
"<UIntToKernel>: unknown kernel number: " << iker <<
Endl;
1471 case 0:
return kMean;
1472 case 1:
return kMpv;
1474 Log() << kWARNING <<
"<UIntToTargetSelection>: unknown method TargetSelection: " << its <<
Endl;
1485 for (
UInt_t ifoam=0; ifoam<
fFoam.size(); ifoam++) {
1486 for (
Int_t idim=0; idim<
fFoam.at(ifoam)->GetTotDim(); idim++) {
1490 fFoam.at(ifoam)->AddVariableName(
DataInfo().GetVariableInfo(idim).GetExpression().
Data());
1511 Log() <<
"PDE-Foam is a variation of the PDE-RS method using a self-adapting" <<
Endl;
1512 Log() <<
"binning method to divide the multi-dimensional variable space into a" <<
Endl;
1513 Log() <<
"finite number of hyper-rectangles (cells). The binning algorithm " <<
Endl;
1514 Log() <<
"adjusts the size and position of a predefined number of cells such" <<
Endl;
1515 Log() <<
"that the variance of the signal and background densities inside the " <<
Endl;
1516 Log() <<
"cells reaches a minimum" <<
Endl;
1520 Log() <<
"The PDEFoam classifier supports two different algorithms: " <<
Endl;
1522 Log() <<
" (1) Create one foam, which stores the signal over background" <<
Endl;
1523 Log() <<
" probability density. During foam buildup the variance of the" <<
Endl;
1524 Log() <<
" discriminant inside the cells is minimised." <<
Endl;
1526 Log() <<
" Booking option: SigBgSeparated=F" <<
Endl;
1528 Log() <<
" (2) Create two separate foams, one for the signal events and one for" <<
Endl;
1529 Log() <<
" background events. During foam buildup the variance of the" <<
Endl;
1530 Log() <<
" event density inside the cells is minimised separately for" <<
Endl;
1531 Log() <<
" signal and background." <<
Endl;
1533 Log() <<
" Booking option: SigBgSeparated=T" <<
Endl;
1535 Log() <<
"The following options can be set (the listed values are found to be a" <<
Endl;
1536 Log() <<
"good starting point for most applications):" <<
Endl;
1538 Log() <<
" SigBgSeparate False Separate Signal and Background" <<
Endl;
1539 Log() <<
" TailCut 0.001 Fraction of outlier events that excluded" <<
Endl;
1540 Log() <<
" from the foam in each dimension " <<
Endl;
1541 Log() <<
" VolFrac 0.0666 Volume fraction (used for density calculation" <<
Endl;
1542 Log() <<
" during foam build-up) " <<
Endl;
1543 Log() <<
" nActiveCells 500 Maximal number of active cells in final foam " <<
Endl;
1544 Log() <<
" nSampl 2000 Number of MC events per cell in foam build-up " <<
Endl;
1545 Log() <<
" nBin 5 Number of bins used in foam build-up " <<
Endl;
1546 Log() <<
" Nmin 100 Number of events in cell required to split cell" <<
Endl;
1547 Log() <<
" Kernel None Kernel type used (possible values are: None," <<
Endl;
1549 Log() <<
" Compress True Compress foam output file " <<
Endl;
1551 Log() <<
" Additional regression options:" <<
Endl;
1553 Log() <<
"MultiTargetRegression False Do regression with multiple targets " <<
Endl;
1554 Log() <<
" TargetSelection Mean Target selection method (possible values are: " <<
Endl;
1555 Log() <<
" Mean, Mpv)" <<
Endl;
1559 Log() <<
"The performance of the two implementations was found to be similar for" <<
Endl;
1560 Log() <<
"most examples studied. For the same number of cells per foam, the two-" <<
Endl;
1561 Log() <<
"foam option approximately doubles the amount of computer memory needed" <<
Endl;
1562 Log() <<
"during classification. For special cases where the event-density" <<
Endl;
1563 Log() <<
"distribution of signal and background events is very different, the" <<
Endl;
1564 Log() <<
"two-foam option was found to perform significantly better than the" <<
Endl;
1565 Log() <<
"option with only one foam." <<
Endl;
1567 Log() <<
"In order to gain better classification performance we recommend to set" <<
Endl;
1568 Log() <<
"the parameter \"nActiveCells\" to a high value." <<
Endl;
1570 Log() <<
"The parameter \"VolFrac\" specifies the size of the sampling volume" <<
Endl;
1571 Log() <<
"during foam buildup and should be tuned in order to achieve optimal" <<
Endl;
1572 Log() <<
"performance. A larger box leads to a reduced statistical uncertainty" <<
Endl;
1573 Log() <<
"for small training samples and to smoother sampling. A smaller box on" <<
Endl;
1574 Log() <<
"the other hand increases the sensitivity to statistical fluctuations" <<
Endl;
1575 Log() <<
"in the training samples, but for sufficiently large training samples" <<
Endl;
1576 Log() <<
"it will result in a more precise local estimate of the sampled" <<
Endl;
1577 Log() <<
"density. In general, higher dimensional problems require larger box" <<
Endl;
1578 Log() <<
"sizes, due to the reduced average number of events per box volume. The" <<
Endl;
1579 Log() <<
"default value of 0.0666 was optimised for an example with 5" <<
Endl;
1580 Log() <<
"observables and training samples of the order of 50000 signal and" <<
Endl;
1581 Log() <<
"background events each." <<
Endl;
1583 Log() <<
"Furthermore kernel weighting can be activated, which will lead to an" <<
Endl;
1584 Log() <<
"additional performance improvement. Note that Gauss weighting will" <<
Endl;
1585 Log() <<
"significantly increase the response time of the method. LinNeighbors" <<
Endl;
1586 Log() <<
"weighting performs a linear interpolation with direct neighbor cells" <<
Endl;
1587 Log() <<
"for each dimension and is much faster than Gauss weighting." <<
Endl;
1589 Log() <<
"The classification results were found to be rather insensitive to the" <<
Endl;
1590 Log() <<
"values of the parameters \"nSamples\" and \"nBin\"." <<
Endl;
#define REGISTER_METHOD(CLASS)
for example
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
float Float_t
Float 4 bytes (float).
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
void Close(Option_t *option="") override
Close a file.
1-D histogram with a float per channel (see TH1 documentation)
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return bin lower edge for 1D histogram.
OptionBase * DeclareOptionRef(T &ref, const TString &name, const TString &desc="")
void AddPreDefVal(const T &)
Implementation of the CrossEntropy as separation criterion.
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
std::vector< Float_t > & GetTargets()
Double_t GetOriginalWeight() const
Double_t GetWeight() const
return the event weight - depending on whether the flag IgnoreNegWeightsInTraining is or not.
void SetVal(UInt_t ivar, Float_t val)
set variable ivar to val
std::vector< Float_t > & GetValues()
Float_t GetTarget(UInt_t itgt) const
Implementation of the GiniIndex With Laplace correction as separation criterion.
Implementation of the GiniIndex as separation criterion.
MethodBase(const TString &jobName, Types::EMVA methodType, const TString &methodTitle, DataSetInfo &dsi, const TString &theOption="")
standard constructor
const char * GetName() const override
virtual void DeclareCompatibilityOptions()
options that are used ONLY for the READER to ensure backward compatibility they are hence without any...
Bool_t DoMulticlass() const
Bool_t IgnoreEventsWithNegWeightsInTraining() const
UInt_t GetNTargets() const
virtual void SetAnalysisType(Types::EAnalysisType type)
UInt_t GetNEvents() const
Bool_t DoRegression() const
std::vector< Float_t > * fRegressionReturnVal
std::vector< Float_t > * fMulticlassReturnVal
const Event * GetEvent() const
DataSetInfo & DataInfo() const
TString GetWeightFileName() const
retrieve weight file name
UInt_t GetNVariables() const
TransformationHandler & GetTransformationHandler(Bool_t takeReroutedIfAvailable=true)
void SetSignalReferenceCut(Double_t cut)
const TString & GetInputLabel(Int_t i) const
Bool_t fSigBgSeparated
Separate Sig and Bg, or not.
UInt_t fNmin
minimal number of events in cell necessary to split cell"
Double_t CalculateMVAError()
Calculate the error on the Mva value.
void PrintCoefficients(void)
void DeclareCompatibilityOptions() override
options that are used ONLY for the READER to ensure backward compatibility
void TrainMultiClassification()
Create one unified foam (see TrainUnifiedClassification()) for each class, where the cells of foam i ...
std::vector< PDEFoam * > fFoam
grown PDEFoams
void TrainMultiTargetRegression(void)
Training one (multi target regression) foam, whose cells contain the average event density.
void Train(void) override
Train PDE-Foam depending on the set options.
void DeleteFoams()
Deletes all trained foams.
Bool_t fFillFoamWithOrigWeights
fill the foam with boost weights
Int_t fnCells
Number of Cells (1000).
virtual ~MethodPDEFoam(void)
destructor
void Init(void) override
default initialization called by all constructors
PDEFoam * InitFoam(TString, EFoamType, UInt_t cls=0)
Create a new PDEFoam, set the PDEFoam options (nCells, nBin, Xmin, Xmax, etc.) and initialize the PDE...
EKernel fKernel
Kernel for GetMvaValue().
Int_t fnBin
Number of bins in build-up (100).
Bool_t fCompress
compress foam output file
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override
PDEFoam can handle classification with multiple classes and regression with one or more regression-ta...
void GetHelpMessage() const override
provide help message
void FillVariableNamesToFoam() const
store the variable names in all foams
void TrainMonoTargetRegression(void)
Training one (mono target regression) foam, whose cells contain the average 0th target.
void TrainUnifiedClassification(void)
Create only one unified foam (fFoam[0]) whose cells contain the average discriminator (N_sig)/(N_sig ...
void ReadFoamsFromFile()
read foams from file
Bool_t fMultiTargetRegression
do regression on multiple targets
void ProcessOptions() override
process user options
EKernel UIntToKernel(UInt_t iker)
convert UInt_t to EKernel (used for reading weight files)
PDEFoamKernelBase * CreatePDEFoamKernel()
create a pdefoam kernel estimator, depending on the current value of fKernel
void ReadWeightsFromStream(std::istream &i) override
read options and internal parameters
const std::vector< Float_t > & GetMulticlassValues() override
Get the multiclass MVA response for the PDEFoam classifier.
void Reset() override
reset MethodPDEFoam:
Int_t fEvPerBin
Maximum events (equiv.) per bin in build-up (1000).
TString fTargetSelectionStr
method of selecting the target (only mulit target regr.)
void MakeClassSpecific(std::ostream &, const TString &) const override
write PDEFoam-specific classifier response NOT IMPLEMENTED YET!
void AddWeightsXMLTo(void *parent) const override
create XML output of PDEFoam method variables
Float_t fDiscrErrCut
cut on discriminant error
void CalcXminXmax()
Determine foam range [fXmin, fXmax] for all dimensions, such that a fraction of 'fFrac' events lie ou...
Bool_t fCutNmin
Keep for bw compatibility: Grabbing cell with maximal RMS to split next (TFoam default).
Float_t fFrac
Fraction used for calc of Xmin, Xmax.
void GetNCuts(PDEFoamCell *cell, std::vector< UInt_t > &nCuts)
Fill in 'nCuts' the number of cuts made in every foam dimension, starting at the root cell 'cell'.
TString fDTLogic
use DT algorithm to split cells
Bool_t fPeekMax
BACKWARDS COMPATIBILITY: peek up cell with max. driver integral for split.
UInt_t fMaxDepth
maximum depth of cell tree
PDEFoam * ReadClonedFoamFromFile(TFile *, const TString &)
Reads a foam with name 'foamname' from file, and returns a clone of the foam.
const std::vector< Float_t > & GetRegressionValues() override
Return regression values for both multi- and mono-target regression.
MethodPDEFoam(const TString &jobName, const TString &methodTitle, DataSetInfo &dsi, const TString &theOption="PDEFoam")
init PDEFoam objects
ETargetSelection UIntToTargetSelection(UInt_t its)
convert UInt_t to ETargetSelection (used for reading weight files)
void DeclareOptions() override
Declare MethodPDEFoam options.
Int_t fnSampl
Number of MC events per cell in build-up (1000).
UInt_t KernelToUInt(EKernel ker) const
PDEFoamKernelBase * fKernelEstimator
Kernel estimator.
Bool_t fUseYesNoCell
return -1 or 1 for bg or signal like event
TString fKernelStr
Kernel for GetMvaValue() (option string).
Float_t fVolFrac
volume fraction (used for density calculation during buildup)
void ReadWeightsFromXML(void *wghtnode) override
read PDEFoam variables from xml weight file
void TrainSeparatedClassification(void)
Creation of 2 separated foams: one for signal events, one for background events.
EDTSeparation fDTSeparation
enum which specifies the separation to use for the DT logic
void SetXminXmax(TMVA::PDEFoam *)
Set Xmin, Xmax for every dimension in the given pdefoam object.
void WriteFoamsToFile() const
Write PDEFoams to file.
Double_t GetMvaValue(Double_t *err=nullptr, Double_t *errUpper=nullptr) override
Return Mva-Value.
std::vector< Float_t > fXmin
std::vector< Float_t > fXmax
range for histograms and foams
const Ranking * CreateRanking() override
Compute ranking of input variables from the number of cuts made in each PDEFoam dimension.
ETargetSelection fTargetSelection
method of selecting the target (only mulit target regr.)
Int_t fnActiveCells
Number of active cells.
UInt_t TargetSelectionToUInt(ETargetSelection ts) const
Implementation of the MisClassificationError as separation criterion.
void SetMinType(EMsgType minType)
PDEFoamCell * GetDau1() const
PDEFoamCell * GetDau0() const
This is a concrete implementation of PDEFoam.
This PDEFoam variant acts like a decision tree and stores in every cell the discriminant.
This is an abstract class, which provides an interface for a PDEFoam density estimator.
This is a concrete implementation of PDEFoam.
This PDEFoam variant stores in every cell the discriminant.
This is a concrete implementation of PDEFoam.
This PDEFoam variant stores in every cell the sum of event weights and the sum of the squared event w...
This class is the abstract kernel interface for PDEFoam.
This PDEFoam kernel estimates a cell value for a given event by weighting all cell values with a gaus...
This PDEFoam kernel estimates a cell value for a given event by weighting with cell values of the nea...
This class is a trivial PDEFoam kernel estimator.
This PDEFoam variant is used to estimate multiple targets by creating an event density foam (PDEFoamE...
This is a concrete implementation of PDEFoam.
This PDEFoam variant stores in every cell the average target fTarget (see the Constructor) as well as...
Implementation of PDEFoam.
void SetMaxDepth(UInt_t maxdepth)
void SetDensity(PDEFoamDensityBase *dens)
void SetXmax(Int_t idim, Double_t wmax)
set upper foam bound in dimension idim
void SetEvPerBin(Int_t EvPerBin)
void SetXmin(Int_t idim, Double_t wmin)
set lower foam bound in dimension idim
void SetnCells(Long_t nCells)
void SetnSampl(Long_t nSampl)
void SetDim(Int_t kDim)
Sets dimension of cubical space.
Ranking for variables in method (implementation).
Implementation of the SdivSqrtSplusB as separation criterion.
An interface to calculate the "SeparationGain" for different separation criteria used in various trai...
Singleton class for Global types used by TMVA.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
create variable transformations
MsgLogger & Endl(MsgLogger &ml)
Double_t Sqrt(Double_t x)
Returns the square root of x.