35#ifndef ROOT_TMVA_MethodPDEFoam
36#define ROOT_TMVA_MethodPDEFoam
79 const TString& theOption =
"PDEFoam");
89 void Train(
void )
override;
120 void Reset()
override;
175 template<
typename T> T
Sqr(T
x)
const {
return x*
x; }
210 void Init(
void )
override;
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.
float Float_t
Float 4 bytes (float).
#define ClassDefOverride(name, id)
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Class that contains all the data information.
MethodBase(const TString &jobName, Types::EMVA methodType, const TString &methodTitle, DataSetInfo &dsi, const TString &theOption="")
standard constructor
void ReadWeightsFromStream(std::istream &) override=0
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
This class is the abstract kernel interface for PDEFoam.
Implementation of PDEFoam.
Ranking for variables in method (implementation).
create variable transformations