147 fTransformLikelihoodOutput(
kFALSE ),
151 fHistSig_smooth( 0 ),
152 fHistBgd_smooth( 0 ),
153 fDefaultPDFLik ( 0 ),
159 fAverageEvtPerBin( 0 ),
160 fAverageEvtPerBinVarS (0),
161 fAverageEvtPerBinVarB (0),
162 fKDEfineFactor ( 0 ),
163 fInterpolateString(0)
174 fTransformLikelihoodOutput(
kFALSE ),
178 fHistSig_smooth( 0 ),
179 fHistBgd_smooth( 0 ),
180 fDefaultPDFLik ( 0 ),
186 fAverageEvtPerBin( 0 ),
187 fAverageEvtPerBinVarS (0),
188 fAverageEvtPerBinVarB (0),
189 fKDEfineFactor ( 0 ),
190 fInterpolateString(0)
199 if (
NULL != fDefaultPDFLik)
delete fDefaultPDFLik;
200 if (
NULL != fHistSig)
delete fHistSig;
201 if (
NULL != fHistBgd)
delete fHistBgd;
202 if (
NULL != fHistSig_smooth)
delete fHistSig_smooth;
203 if (
NULL != fHistBgd_smooth)
delete fHistBgd_smooth;
205 if ((*fPDFSig)[
ivar] !=0)
delete (*fPDFSig)[
ivar];
206 if ((*fPDFBgd)[
ivar] !=0)
delete (*fPDFBgd)[
ivar];
208 if (
NULL != fPDFSig)
delete fPDFSig;
209 if (
NULL != fPDFBgd)
delete fPDFBgd;
229 fHistSig =
new std::vector<TH1*> ( GetNvar(), (
TH1*)0 );
230 fHistBgd =
new std::vector<TH1*> ( GetNvar(), (
TH1*)0 );
231 fHistSig_smooth =
new std::vector<TH1*> ( GetNvar(), (
TH1*)0 );
232 fHistBgd_smooth =
new std::vector<TH1*> ( GetNvar(), (
TH1*)0 );
233 fPDFSig =
new std::vector<TMVA::PDF*>( GetNvar(), (
TMVA::PDF*)0 );
234 fPDFBgd =
new std::vector<TMVA::PDF*>( GetNvar(), (
TMVA::PDF*)0 );
244 DeclareOptionRef( fTransformLikelihoodOutput =
kFALSE,
"TransformOutput",
245 "Transform likelihood output by inverse sigmoid function" );
252 fDefaultPDFLik->DeclareOptions();
253 fDefaultPDFLik->ParseOptions();
258 (*fPDFSig)[
ivar]->DeclareOptions();
259 (*fPDFSig)[
ivar]->ParseOptions();
263 (*fPDFBgd)[
ivar]->DeclareOptions();
264 (*fPDFBgd)[
ivar]->ParseOptions();
278 DeclareOptionRef( fNsmooth = 1,
"NSmooth",
279 "Number of smoothing iterations for the input histograms");
280 DeclareOptionRef( fAverageEvtPerBin = 50,
"NAvEvtPerBin",
281 "Average number of events per PDF bin");
282 DeclareOptionRef( fKDEfineFactor =1. ,
"KDEFineFactor",
283 "Fine tuning factor for Adaptive KDE: Factor to multiply the width of the kernel");
284 DeclareOptionRef( fBorderMethodString =
"None",
"KDEborder",
285 "Border effects treatment (1=no treatment , 2=kernel renormalization, 3=sample mirroring)" );
286 DeclareOptionRef( fKDEiterString =
"Nonadaptive",
"KDEiter",
287 "Number of iterations (1=non-adaptive, 2=adaptive)" );
288 DeclareOptionRef( fKDEtypeString =
"Gauss",
"KDEtype",
289 "KDE kernel type (1=Gauss)" );
290 fAverageEvtPerBinVarS =
new Int_t[GetNvar()];
291 fAverageEvtPerBinVarB =
new Int_t[GetNvar()];
292 fNsmoothVarS =
new Int_t[GetNvar()];
293 fNsmoothVarB =
new Int_t[GetNvar()];
294 fInterpolateString =
new TString[GetNvar()];
295 for(
UInt_t i=0; i<GetNvar(); ++i) {
296 fAverageEvtPerBinVarS[i] = fAverageEvtPerBinVarB[i] = 0;
297 fNsmoothVarS[i] = fNsmoothVarB[i] = 0;
298 fInterpolateString[i] =
"";
300 DeclareOptionRef( fAverageEvtPerBinVarS, GetNvar(),
"NAvEvtPerBinSig",
301 "Average num of events per PDF bin and variable (signal)");
302 DeclareOptionRef( fAverageEvtPerBinVarB, GetNvar(),
"NAvEvtPerBinBkg",
303 "Average num of events per PDF bin and variable (background)");
304 DeclareOptionRef(fNsmoothVarS, GetNvar(),
"NSmoothSig",
305 "Number of smoothing iterations for the input histograms");
306 DeclareOptionRef(fNsmoothVarB, GetNvar(),
"NSmoothBkg",
307 "Number of smoothing iterations for the input histograms");
308 DeclareOptionRef(fInterpolateString, GetNvar(),
"PDFInterpol",
"Method of interpolating reference histograms (e.g. Spline2 or KDE)");
317 SetSignalReferenceCut( TransformLikelihoodOutput( 0.5, 0.5 ) );
319 fDefaultPDFLik->ProcessOptions();
321 (*fPDFBgd)[
ivar]->ProcessOptions();
322 (*fPDFSig)[
ivar]->ProcessOptions();
337 std::vector<Double_t>
xmin(nvar),
xmax(nvar);
345 if (IgnoreEventsWithNegWeightsInTraining() &&
origEv->GetWeight()<=0)
continue;
348 GetTransformationHandler().SetTransformationReferenceClass(
cls);
349 const Event*
ev = GetTransformationHandler().Transform(
origEv );
368 if (DataInfo().GetVariableInfo(
ivar).GetVarType() ==
'I') {
374 (*fHistSig)[
ivar] =
new TH1F(GetMethodName()+
"_"+var +
"_sig", var +
" signal training", nbins,
ixmin,
ixmax );
375 (*fHistBgd)[
ivar] =
new TH1F(GetMethodName()+
"_"+var +
"_bgd", var +
" background training", nbins,
ixmin,
ixmax );
383 TString::Format(
"%s_%s_%s signal training",DataInfo().GetName(),GetMethodName().Data(),var.
Data()),
386 TString::Format(
"%s_%s_%s background training",DataInfo().GetName(),GetMethodName().Data(),var.
Data()),
392 Log() << kINFO <<
"Filling reference histograms" <<
Endl;
400 if (IgnoreEventsWithNegWeightsInTraining() &&
origEv->GetWeight()<=0)
continue;
401 GetTransformationHandler().SetTransformationReferenceClass(
origEv->GetClass() );
402 const Event*
ev = GetTransformationHandler().Transform(
origEv );
414 if (
value >=(*fHistSig)[
ivar]->GetXaxis()->GetXmax() ||
415 value <(*fHistSig)[
ivar]->GetXaxis()->GetXmin()){
417 <<
"error in filling likelihood reference histograms var="
418 <<(*fInputVars)[
ivar]
419 <<
", xmin="<<(*fHistSig)[
ivar]->GetXaxis()->GetXmin()
421 <<
", xmax="<<(*fHistSig)[
ivar]->GetXaxis()->GetXmax()
424 if (DataInfo().IsSignal(
ev)) (*fHistSig)[
ivar]->Fill(
value, weight );
425 else (*fHistBgd)[
ivar]->Fill(
value, weight );
430 Log() << kINFO <<
"Building PDF out of reference histograms" <<
Endl;
435 (*fPDFSig)[
ivar]->BuildPDF( (*fHistSig)[
ivar] );
436 (*fPDFBgd)[
ivar]->BuildPDF( (*fHistBgd)[
ivar] );
438 (*fPDFSig)[
ivar]->ValidatePDF( (*fHistSig)[
ivar] );
439 (*fPDFBgd)[
ivar]->ValidatePDF( (*fHistBgd)[
ivar] );
442 if ((*fPDFSig)[
ivar]->GetSmoothedHist() != 0) (*fHistSig_smooth)[
ivar] = (*fPDFSig)[
ivar]->GetSmoothedHist();
443 if ((*fPDFBgd)[
ivar]->GetSmoothedHist() != 0) (*fHistBgd_smooth)[
ivar] = (*fPDFBgd)[
ivar]->GetSmoothedHist();
466 GetTransformationHandler().SetTransformationReferenceClass( fSignalClass );
472 GetTransformationHandler().SetTransformationReferenceClass( fBackgroundClass );
483 if ((
Int_t)
ivar == fDropVariable)
continue;
495 if (pdf == 0) Log() << kFATAL <<
"<GetMvaValue> Reference histograms don't exist" <<
Endl;
505 DataInfo().GetVariableInfo(
ivar).GetVarType() ==
'N') {
528 return TransformLikelihoodOutput( ps,
pb );
536 if (ps < fEpsilon) ps = fEpsilon;
537 if (
pb < fEpsilon)
pb = fEpsilon;
539 if (
r >= 1.0)
r = 1. - 1.e-15;
541 if (fTransformLikelihoodOutput) {
545 if (
r <= 0.0)
r = fEpsilon;
546 else if (
r >= 1.0)
r = 1. - 1.e-15;
563 if (fDefaultPDFLik != 0) {
564 o << prefix << std::endl << prefix <<
"#Default Likelihood PDF Options:" << std::endl << prefix << std::endl;
565 fDefaultPDFLik->WriteOptionsToStream( o, prefix );
568 if ((*fPDFSig)[
ivar] != 0) {
569 o << prefix << std::endl << prefix <<
TString::Format(
"#Signal[%d] Likelihood PDF Options:",
ivar) << std::endl << prefix << std::endl;
570 (*fPDFSig)[
ivar]->WriteOptionsToStream( o, prefix );
572 if ((*fPDFBgd)[
ivar] != 0) {
573 o << prefix << std::endl << prefix <<
"#Background[%d] Likelihood PDF Options:" << std::endl << prefix << std::endl;
574 (*fPDFBgd)[
ivar]->WriteOptionsToStream( o, prefix );
589 if ( (*fPDFSig)[
ivar]==0 || (*fPDFBgd)[
ivar]==0 )
590 Log() << kFATAL <<
"Reference histograms for variable " <<
ivar
591 <<
" don't exist, can't write it to weight file" <<
Endl;
609 if (fRanking)
delete fRanking;
610 fRanking =
new Ranking( GetName(),
"Delta Separation" );
616 fDropVariable =
ivar;
627 GetTransformationHandler().SetTransformationReferenceClass(
origEv->GetClass() );
628 const Event*
ev = GetTransformationHandler().Transform(Data()->GetEvent(
ievt));
632 if (DataInfo().IsSignal(
ev))
rS->Fill(
lk,
w );
633 else rB->Fill(
lk,
w );
645 if (
ivar >= 0) fRanking->AddRank(
Rank( DataInfo().GetVariableInfo(
ivar).GetInternalName(), sep ) );
660 (*fPDFSig)[
ivar]->Write(
pname + GetInputVar(
ivar ) +
"_S" );
661 (*fPDFBgd)[
ivar]->Write(
pname + GetInputVar(
ivar ) +
"_B" );
678 Log() << kDEBUG <<
"Reading signal and background PDF for variable: " << GetInputVar(
ivar ) <<
Endl;
679 if ((*fPDFSig)[
ivar] !=0)
delete (*fPDFSig)[
ivar];
680 if ((*fPDFBgd)[
ivar] !=0)
delete (*fPDFBgd)[
ivar];
681 (*fPDFSig)[
ivar] =
new PDF( GetInputVar(
ivar ) +
" PDF Sig" );
682 (*fPDFBgd)[
ivar] =
new PDF( GetInputVar(
ivar ) +
" PDF Bkg" );
683 (*fPDFSig)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
684 (*fPDFBgd)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
704 Log() << kDEBUG <<
"Reading signal and background PDF for variable: " << GetInputVar(
ivar ) <<
Endl;
705 if ((*fPDFSig)[
ivar] !=0)
delete (*fPDFSig)[
ivar];
706 if ((*fPDFBgd)[
ivar] !=0)
delete (*fPDFBgd)[
ivar];
707 (*fPDFSig)[
ivar] =
new PDF(GetInputVar(
ivar ) +
" PDF Sig" );
708 (*fPDFBgd)[
ivar] =
new PDF(GetInputVar(
ivar ) +
" PDF Bkg");
709 (*fPDFSig)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
710 (*fPDFBgd)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
737 Log() << kINFO <<
"Write monitoring histograms to file: " << BaseDir()->GetPath() <<
Endl;
742 (*fHistBgd)[
ivar]->Write();
743 if ((*fHistSig_smooth)[
ivar] != 0) (*fHistSig_smooth)[
ivar]->Write();
744 if ((*fHistBgd_smooth)[
ivar] != 0) (*fHistBgd_smooth)[
ivar]->Write();
745 (*fPDFSig)[
ivar]->GetPDFHist()->Write();
746 (*fPDFBgd)[
ivar]->GetPDFHist()->Write();
748 if ((*fPDFSig)[
ivar]->GetNSmoothHist() != 0) (*fPDFSig)[
ivar]->GetNSmoothHist()->Write();
749 if ((*fPDFBgd)[
ivar]->GetNSmoothHist() != 0) (*fPDFBgd)[
ivar]->GetNSmoothHist()->Write();
754 TH1F* mm =
new TH1F( (*fInputVars)[
ivar]+
"_additional_check",
755 (*fInputVars)[
ivar]+
"_additional_check", 15000,
xmin,
xmax );
757 for (
Int_t bin=0; bin < 15000; bin++) {
765 for (
UInt_t i=0; i<2; i++) {
769 if (
hclone->GetNbinsX() > 100) {
785 fout <<
"#include <cmath>" << std::endl;
786 fout <<
"#include <cstdlib>" << std::endl;
795 fout <<
" double fEpsilon;" << std::endl;
805 fout <<
" static float fRefS[][" <<
nbinMax <<
"]; "
806 <<
"// signal reference vector [nvars][max_nbins]" << std::endl;
807 fout <<
" static float fRefB[][" <<
nbinMax <<
"]; "
808 <<
"// backgr reference vector [nvars][max_nbins]" << std::endl << std::endl;
809 fout <<
"// if a variable has its PDF encoded as a spline0 --> treat it like an Integer valued one" <<std::endl;
810 fout <<
" bool fHasDiscretPDF[" << GetNvar() <<
"]; "<< std::endl;
811 fout <<
" int fNbin[" << GetNvar() <<
"]; "
812 <<
"// number of bins (discrete variables may have less bins)" << std::endl;
813 fout <<
" double fHistMin[" << GetNvar() <<
"]; " << std::endl;
814 fout <<
" double fHistMax[" << GetNvar() <<
"]; " << std::endl;
816 fout <<
" double TransformLikelihoodOutput( double, double ) const;" << std::endl;
817 fout <<
"};" << std::endl;
818 fout <<
"" << std::endl;
819 fout <<
"inline void " << className <<
"::Initialize() " << std::endl;
820 fout <<
"{" << std::endl;
821 fout <<
" fEpsilon = " << fEpsilon <<
";" << std::endl;
823 fout <<
" fNbin[" <<
ivar <<
"] = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() <<
";" << std::endl;
824 fout <<
" fHistMin[" <<
ivar <<
"] = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetXaxis()->GetXmin() <<
";" << std::endl;
825 fout <<
" fHistMax[" <<
ivar <<
"] = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetXaxis()->GetXmax() <<
";" << std::endl;
827 if ((((*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() !=
nbin[
ivar] ||
828 (*fPDFBgd)[
ivar]->GetPDFHist()->GetNbinsX() !=
nbin[
ivar])
830 (*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() != (*fPDFBgd)[
ivar]->GetPDFHist()->GetNbinsX()) {
831 Log() << kFATAL <<
"<MakeClassSpecific> Mismatch in binning of variable "
832 <<
"\"" << GetOriginalVarName(
ivar) <<
"\" of type: \'" << DataInfo().GetVariableInfo(
ivar).GetVarType()
834 <<
"nxS = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() <<
", "
835 <<
"nxB = " << (*fPDFBgd)[
ivar]->GetPDFHist()->GetNbinsX()
836 <<
" while we expect " <<
nbin[
ivar]
842 fout <<
" fHasDiscretPDF[" <<
ivar <<
"] = true; " << std::endl;
844 fout <<
" fHasDiscretPDF[" <<
ivar <<
"] = false; " << std::endl;
847 fout <<
"}" << std::endl << std::endl;
849 fout <<
"inline double " << className
850 <<
"::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
851 fout <<
"{" << std::endl;
852 fout <<
" double ps(1), pb(1);" << std::endl;
853 fout <<
" std::vector<double> inputValuesSig = inputValues;" << std::endl;
854 fout <<
" std::vector<double> inputValuesBgd = inputValues;" << std::endl;
855 if (GetTransformationHandler().GetTransformationList().GetSize() != 0) {
856 fout <<
" Transform(inputValuesSig,0);" << std::endl;
857 fout <<
" Transform(inputValuesBgd,1);" << std::endl;
859 fout <<
" for (size_t ivar = 0; ivar < GetNvar(); ivar++) {" << std::endl;
861 fout <<
" // dummy at present... will be used for variable transforms" << std::endl;
862 fout <<
" double x[2] = { inputValuesSig[ivar], inputValuesBgd[ivar] };" << std::endl;
864 fout <<
" for (int itype=0; itype < 2; itype++) {" << std::endl;
866 fout <<
" // interpolate linearly between adjacent bins" << std::endl;
867 fout <<
" // this is not useful for discrete variables (or forced Spline0)" << std::endl;
868 fout <<
" int bin = int((x[itype] - fHistMin[ivar])/(fHistMax[ivar] - fHistMin[ivar])*fNbin[ivar]) + 0;" << std::endl;
870 fout <<
" // since the test data sample is in general different from the training sample" << std::endl;
871 fout <<
" // it can happen that the min/max of the training sample are trespassed --> correct this" << std::endl;
872 fout <<
" if (bin < 0) {" << std::endl;
873 fout <<
" bin = 0;" << std::endl;
874 fout <<
" x[itype] = fHistMin[ivar];" << std::endl;
875 fout <<
" }" << std::endl;
876 fout <<
" else if (bin >= fNbin[ivar]) {" << std::endl;
877 fout <<
" bin = fNbin[ivar]-1;" << std::endl;
878 fout <<
" x[itype] = fHistMax[ivar];" << std::endl;
879 fout <<
" }" << std::endl;
881 fout <<
" // find corresponding histogram from cached indices" << std::endl;
882 fout <<
" float ref = (itype == 0) ? fRefS[ivar][bin] : fRefB[ivar][bin];" << std::endl;
884 fout <<
" // sanity check" << std::endl;
885 fout <<
" if (ref < 0) {" << std::endl;
886 fout <<
" std::cout << \"Fatal error in " << className
887 <<
": bin entry < 0 ==> abort\" << std::endl;" << std::endl;
888 fout <<
" std::exit(1);" << std::endl;
889 fout <<
" }" << std::endl;
891 fout <<
" double p = ref;" << std::endl;
893 fout <<
" if (GetType(ivar) != 'I' && !fHasDiscretPDF[ivar]) {" << std::endl;
894 fout <<
" float bincenter = (bin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
895 fout <<
" int nextbin = bin;" << std::endl;
896 fout <<
" if ((x[itype] > bincenter && bin != fNbin[ivar]-1) || bin == 0) " << std::endl;
897 fout <<
" nextbin++;" << std::endl;
898 fout <<
" else" << std::endl;
899 fout <<
" nextbin--; " << std::endl;
901 fout <<
" double refnext = (itype == 0) ? fRefS[ivar][nextbin] : fRefB[ivar][nextbin];" << std::endl;
902 fout <<
" float nextbincenter = (nextbin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
904 fout <<
" double dx = bincenter - nextbincenter;" << std::endl;
905 fout <<
" double dy = ref - refnext;" << std::endl;
906 fout <<
" p += (x[itype] - bincenter) * dy/dx;" << std::endl;
907 fout <<
" }" << std::endl;
909 fout <<
" if (p < fEpsilon) p = fEpsilon; // avoid zero response" << std::endl;
911 fout <<
" if (itype == 0) ps *= p;" << std::endl;
912 fout <<
" else pb *= p;" << std::endl;
913 fout <<
" } " << std::endl;
914 fout <<
" } " << std::endl;
916 fout <<
" // the likelihood ratio (transform it ?)" << std::endl;
917 fout <<
" return TransformLikelihoodOutput( ps, pb ); " << std::endl;
918 fout <<
"}" << std::endl << std::endl;
920 fout <<
"inline double " << className <<
"::TransformLikelihoodOutput( double ps, double pb ) const" << std::endl;
921 fout <<
"{" << std::endl;
922 fout <<
" // returns transformed or non-transformed output" << std::endl;
923 fout <<
" if (ps < fEpsilon) ps = fEpsilon;" << std::endl;
924 fout <<
" if (pb < fEpsilon) pb = fEpsilon;" << std::endl;
925 fout <<
" double r = ps/(ps + pb);" << std::endl;
926 fout <<
" if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
928 fout <<
" if (" << (fTransformLikelihoodOutput ?
"true" :
"false") <<
") {" << std::endl;
929 fout <<
" // inverse Fermi function" << std::endl;
931 fout <<
" // sanity check" << std::endl;
932 fout <<
" if (r <= 0.0) r = fEpsilon;" << std::endl;
933 fout <<
" else if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
935 fout <<
" double tau = 15.0;" << std::endl;
936 fout <<
" r = - log(1.0/r - 1.0)/tau;" << std::endl;
937 fout <<
" }" << std::endl;
939 fout <<
" return r;" << std::endl;
940 fout <<
"}" << std::endl;
943 fout <<
"// Clean up" << std::endl;
944 fout <<
"inline void " << className <<
"::Clear() " << std::endl;
945 fout <<
"{" << std::endl;
946 fout <<
" // nothing to clear" << std::endl;
947 fout <<
"}" << std::endl << std::endl;
949 fout <<
"// signal map" << std::endl;
950 fout <<
"float " << className <<
"::fRefS[][" <<
nbinMax <<
"] = " << std::endl;
951 fout <<
"{ " << std::endl;
956 fout << (*fPDFSig)[
ivar]->GetPDFHist()->GetBinContent(
ibin);
962 fout <<
" }, " << std::endl;
964 fout <<
"}; " << std::endl;
967 fout <<
"// background map" << std::endl;
968 fout <<
"float " << className <<
"::fRefB[][" <<
nbinMax <<
"] = " << std::endl;
969 fout <<
"{ " << std::endl;
972 fout << std::setprecision(8);
975 fout << (*fPDFBgd)[
ivar]->GetPDFHist()->GetBinContent(
ibin);
981 fout <<
" }, " << std::endl;
983 fout <<
"}; " << std::endl;
985 fout << std::setprecision(
dp);
1001 Log() <<
"The maximum-likelihood classifier models the data with probability " <<
Endl;
1002 Log() <<
"density functions (PDF) reproducing the signal and background" <<
Endl;
1003 Log() <<
"distributions of the input variables. Correlations among the " <<
Endl;
1004 Log() <<
"variables are ignored." <<
Endl;
1008 Log() <<
"Required for good performance are decorrelated input variables" <<
Endl;
1009 Log() <<
"(PCA transformation via the option \"VarTransform=Decorrelate\"" <<
Endl;
1010 Log() <<
"may be tried). Irreducible non-linear correlations may be reduced" <<
Endl;
1011 Log() <<
"by precombining strongly correlated input variables, or by simply" <<
Endl;
1012 Log() <<
"removing one of the variables." <<
Endl;
1016 Log() <<
"High fidelity PDF estimates are mandatory, i.e., sufficient training " <<
Endl;
1017 Log() <<
"statistics is required to populate the tails of the distributions" <<
Endl;
1018 Log() <<
"It would be a surprise if the default Spline or KDE kernel parameters" <<
Endl;
1019 Log() <<
"provide a satisfying fit to the data. The user is advised to properly" <<
Endl;
1020 Log() <<
"tune the events per bin and smooth options in the spline cases" <<
Endl;
1021 Log() <<
"individually per variable. If the KDE kernel is used, the adaptive" <<
Endl;
1022 Log() <<
"Gaussian kernel may lead to artefacts, so please always also try" <<
Endl;
1023 Log() <<
"the non-adaptive one." <<
Endl;
1024 Log() <<
"" <<
Endl;
1025 Log() <<
"All tuning parameters must be adjusted individually for each input" <<
Endl;
1026 Log() <<
"variable!" <<
Endl;
#define REGISTER_METHOD(CLASS)
for example
int Int_t
Signed integer 4 bytes (int)
float Float_t
Float 4 bytes (float)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
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 value
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...
1-D histogram with a float per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
virtual Int_t GetNbinsX() const
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
static Bool_t AddDirectoryStatus()
Static function: cannot be inlined on Windows/NT.
void WriteOptionsToStream(std::ostream &o, const TString &prefix) const
write options to output stream (e.g. in writing the MVA weight files
Class that contains all the data information.
Virtual base Class for all MVA method.
virtual void DeclareCompatibilityOptions()
options that are used ONLY for the READER to ensure backward compatibility they are hence without any...
Likelihood analysis ("non-parametric approach")
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets) override
FDA can handle classification with 2 classes.
void ProcessOptions() override
process user options reference cut value to distinguish signal-like from background-like events
virtual void WriteOptionsToStream(std::ostream &o, const TString &prefix) const
write options to stream
void MakeClassSpecific(std::ostream &, const TString &) const override
write specific classifier response
const Ranking * CreateRanking() override
computes ranking of input variables
void ReadWeightsFromStream(std::istream &istr) override
read weight info from file nothing to do for this method
void Train() override
create reference distributions (PDFs) from signal and background events: fill histograms and smooth t...
void GetHelpMessage() const override
get help message text
virtual ~MethodLikelihood()
destructor
void DeclareOptions() override
define the options (their key words) that can be set in the option string
void ReadWeightsFromXML(void *wghtnode) override
read weights from XML
MethodLikelihood(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption="")
standard constructor
void WriteMonitoringHistosToFile() const override
write histograms and PDFs to file for monitoring purposes
void Init() override
default initialisation called by all constructors
void DeclareCompatibilityOptions() override
options that are used ONLY for the READER to ensure backward compatibility they are hence without any...
void AddWeightsXMLTo(void *parent) const override
write weights to XML
Double_t TransformLikelihoodOutput(Double_t ps, Double_t pb) const
returns transformed or non-transformed output
Double_t GetMvaValue(Double_t *err=nullptr, Double_t *errUpper=nullptr) override
returns the likelihood estimator for signal fill a new Likelihood branch into the testTree
void WriteWeightsToStream(TFile &rf) const
write reference PDFs to ROOT file
void MakeClassSpecificHeader(std::ostream &, const TString &="") const override
write specific header of the classifier (mostly include files)
PDF wrapper for histograms; uses user-defined spline interpolation.
Ranking for variables in method (implementation)
Singleton class for Global types used by TMVA.
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
create variable transformations
MsgLogger & Endl(MsgLogger &ml)
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.