35#ifndef ROOT_TMVA_MethodPDEFoam
36#define ROOT_TMVA_MethodPDEFoam
79 const TString& theOption =
"PDEFoam");
120 virtual void Reset();
175 template<
typename T> T
Sqr(T
x)
const {
return x*
x; }
#define ClassDef(name, id)
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 ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Class that contains all the data information.
Virtual base Class for all MVA method.
virtual void ReadWeightsFromStream(std::istream &)=0
The PDEFoam method is an extension of the PDERS method, which divides the multi-dimensional phase spa...
const Ranking * CreateRanking()
Compute ranking of input variables from the number of cuts made in each PDEFoam dimension.
void Init(void)
default initialization called by all constructors
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
PDEFoam can handle classification with multiple classes and regression with one or more regression-ta...
Bool_t fSigBgSeparated
Separate Sig and Bg, or not.
UInt_t fNmin
minimal number of events in cell necessary to split cell"
void Train(void)
Train PDE-Foam depending on the set options.
const std::vector< Float_t > & GetMulticlassValues()
Get the multiclass MVA response for the PDEFoam classifier.
Double_t CalculateMVAError()
Calculate the error on the Mva value.
void PrintCoefficients(void)
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 ReadWeightsFromXML(void *wghtnode)
read PDEFoam variables from xml weight file
void DeleteFoams()
Deletes all trained foams.
Bool_t fFillFoamWithOrigWeights
fill the foam with boost weights
void ReadWeightsFromStream(std::istream &i)
read options and internal parameters
Int_t fnCells
Number of Cells (1000)
Double_t GetMvaValue(Double_t *err=nullptr, Double_t *errUpper=nullptr)
Return Mva-Value.
virtual ~MethodPDEFoam(void)
destructor
void DeclareOptions()
Declare MethodPDEFoam options.
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
virtual const std::vector< Float_t > & GetRegressionValues()
Return regression values for both multi- and mono-target regression.
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
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
Int_t fEvPerBin
Maximum events (equiv.) per bin in build-up (1000)
TString fTargetSelectionStr
method of selecting the target (only mulit target regr.)
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 MakeClassSpecific(std::ostream &, const TString &) const
write PDEFoam-specific classifier response NOT IMPLEMENTED YET!
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.
ETargetSelection UIntToTargetSelection(UInt_t its)
convert UInt_t to ETargetSelection (used for reading weight files)
void DeclareCompatibilityOptions()
options that are used ONLY for the READER to ensure backward compatibility
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 GetHelpMessage() const
provide help message
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.
virtual void Reset()
reset MethodPDEFoam:
void WriteFoamsToFile() const
Write PDEFoams to file.
std::vector< Float_t > fXmin
std::vector< Float_t > fXmax
range for histograms and foams
ETargetSelection fTargetSelection
method of selecting the target (only mulit target regr.)
Int_t fnActiveCells
Number of active cells.
UInt_t TargetSelectionToUInt(ETargetSelection ts) const
void AddWeightsXMLTo(void *parent) const
create XML output of PDEFoam method variables
void ProcessOptions()
process user options
This class is the abstract kernel interface for PDEFoam.
Implementation of PDEFoam.
Ranking for variables in method (implementation)
create variable transformations