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();
465 GetTransformationHandler().SetTransformationReferenceClass( fSignalClass );
471 GetTransformationHandler().SetTransformationReferenceClass( fBackgroundClass );
482 if ((
Int_t)
ivar == fDropVariable)
continue;
494 if (pdf == 0) Log() << kFATAL <<
"<GetMvaValue> Reference histograms don't exist" <<
Endl;
504 DataInfo().GetVariableInfo(
ivar).GetVarType() ==
'N') {
527 return TransformLikelihoodOutput( ps,
pb );
535 if (ps < fEpsilon) ps = fEpsilon;
536 if (
pb < fEpsilon)
pb = fEpsilon;
538 if (
r >= 1.0)
r = 1. - 1.e-15;
540 if (fTransformLikelihoodOutput) {
544 if (
r <= 0.0)
r = fEpsilon;
545 else if (
r >= 1.0)
r = 1. - 1.e-15;
562 if (fDefaultPDFLik != 0) {
563 o << prefix << std::endl << prefix <<
"#Default Likelihood PDF Options:" << std::endl << prefix << std::endl;
564 fDefaultPDFLik->WriteOptionsToStream( o, prefix );
567 if ((*fPDFSig)[
ivar] != 0) {
568 o << prefix << std::endl << prefix <<
TString::Format(
"#Signal[%d] Likelihood PDF Options:",
ivar) << std::endl << prefix << std::endl;
569 (*fPDFSig)[
ivar]->WriteOptionsToStream( o, prefix );
571 if ((*fPDFBgd)[
ivar] != 0) {
572 o << prefix << std::endl << prefix <<
"#Background[%d] Likelihood PDF Options:" << std::endl << prefix << std::endl;
573 (*fPDFBgd)[
ivar]->WriteOptionsToStream( o, prefix );
588 if ( (*fPDFSig)[
ivar]==0 || (*fPDFBgd)[
ivar]==0 )
589 Log() << kFATAL <<
"Reference histograms for variable " <<
ivar
590 <<
" don't exist, can't write it to weight file" <<
Endl;
608 if (fRanking)
delete fRanking;
609 fRanking =
new Ranking( GetName(),
"Delta Separation" );
615 fDropVariable =
ivar;
626 GetTransformationHandler().SetTransformationReferenceClass(
origEv->GetClass() );
627 const Event*
ev = GetTransformationHandler().Transform(Data()->GetEvent(
ievt));
631 if (DataInfo().IsSignal(
ev))
rS->Fill(
lk,
w );
632 else rB->Fill(
lk,
w );
644 if (
ivar >= 0) fRanking->AddRank(
Rank( DataInfo().GetVariableInfo(
ivar).GetInternalName(), sep ) );
659 (*fPDFSig)[
ivar]->Write(
pname + GetInputVar(
ivar ) +
"_S" );
660 (*fPDFBgd)[
ivar]->Write(
pname + GetInputVar(
ivar ) +
"_B" );
676 Log() << kDEBUG <<
"Reading signal and background PDF for variable: " << GetInputVar(
ivar ) <<
Endl;
677 if ((*fPDFSig)[
ivar] !=0)
delete (*fPDFSig)[
ivar];
678 if ((*fPDFBgd)[
ivar] !=0)
delete (*fPDFBgd)[
ivar];
679 (*fPDFSig)[
ivar] =
new PDF( GetInputVar(
ivar ) +
" PDF Sig" );
680 (*fPDFBgd)[
ivar] =
new PDF( GetInputVar(
ivar ) +
" PDF Bkg" );
681 (*fPDFSig)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
682 (*fPDFBgd)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
700 Log() << kDEBUG <<
"Reading signal and background PDF for variable: " << GetInputVar(
ivar ) <<
Endl;
701 if ((*fPDFSig)[
ivar] !=0)
delete (*fPDFSig)[
ivar];
702 if ((*fPDFBgd)[
ivar] !=0)
delete (*fPDFBgd)[
ivar];
703 (*fPDFSig)[
ivar] =
new PDF(GetInputVar(
ivar ) +
" PDF Sig" );
704 (*fPDFBgd)[
ivar] =
new PDF(GetInputVar(
ivar ) +
" PDF Bkg");
705 (*fPDFSig)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
706 (*fPDFBgd)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
730 Log() << kINFO <<
"Write monitoring histograms to file: " << BaseDir()->GetPath() <<
Endl;
735 (*fHistBgd)[
ivar]->Write();
736 if ((*fHistSig_smooth)[
ivar] != 0) (*fHistSig_smooth)[
ivar]->Write();
737 if ((*fHistBgd_smooth)[
ivar] != 0) (*fHistBgd_smooth)[
ivar]->Write();
738 (*fPDFSig)[
ivar]->GetPDFHist()->Write();
739 (*fPDFBgd)[
ivar]->GetPDFHist()->Write();
741 if ((*fPDFSig)[
ivar]->GetNSmoothHist() != 0) (*fPDFSig)[
ivar]->GetNSmoothHist()->Write();
742 if ((*fPDFBgd)[
ivar]->GetNSmoothHist() != 0) (*fPDFBgd)[
ivar]->GetNSmoothHist()->Write();
747 TH1F* mm =
new TH1F( (*fInputVars)[
ivar]+
"_additional_check",
748 (*fInputVars)[
ivar]+
"_additional_check", 15000,
xmin,
xmax );
758 for (
UInt_t i=0; i<2; i++) {
762 if (
hclone->GetNbinsX() > 100) {
778 fout <<
"#include <cmath>" << std::endl;
779 fout <<
"#include <cstdlib>" << std::endl;
788 fout <<
" double fEpsilon;" << std::endl;
798 fout <<
" static float fRefS[][" <<
nbinMax <<
"]; "
799 <<
"// signal reference vector [nvars][max_nbins]" << std::endl;
800 fout <<
" static float fRefB[][" <<
nbinMax <<
"]; "
801 <<
"// backgr reference vector [nvars][max_nbins]" << std::endl << std::endl;
802 fout <<
"// if a variable has its PDF encoded as a spline0 --> treat it like an Integer valued one" <<std::endl;
803 fout <<
" bool fHasDiscretPDF[" << GetNvar() <<
"]; "<< std::endl;
804 fout <<
" int fNbin[" << GetNvar() <<
"]; "
805 <<
"// number of bins (discrete variables may have less bins)" << std::endl;
806 fout <<
" double fHistMin[" << GetNvar() <<
"]; " << std::endl;
807 fout <<
" double fHistMax[" << GetNvar() <<
"]; " << std::endl;
809 fout <<
" double TransformLikelihoodOutput( double, double ) const;" << std::endl;
810 fout <<
"};" << std::endl;
811 fout <<
"" << std::endl;
812 fout <<
"inline void " << className <<
"::Initialize() " << std::endl;
813 fout <<
"{" << std::endl;
814 fout <<
" fEpsilon = " << fEpsilon <<
";" << std::endl;
816 fout <<
" fNbin[" <<
ivar <<
"] = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() <<
";" << std::endl;
817 fout <<
" fHistMin[" <<
ivar <<
"] = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetXaxis()->GetXmin() <<
";" << std::endl;
818 fout <<
" fHistMax[" <<
ivar <<
"] = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetXaxis()->GetXmax() <<
";" << std::endl;
820 if ((((*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() !=
nbin[
ivar] ||
821 (*fPDFBgd)[
ivar]->GetPDFHist()->GetNbinsX() !=
nbin[
ivar])
823 (*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() != (*fPDFBgd)[
ivar]->GetPDFHist()->GetNbinsX()) {
824 Log() << kFATAL <<
"<MakeClassSpecific> Mismatch in binning of variable "
825 <<
"\"" << GetOriginalVarName(
ivar) <<
"\" of type: \'" << DataInfo().GetVariableInfo(
ivar).GetVarType()
827 <<
"nxS = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() <<
", "
828 <<
"nxB = " << (*fPDFBgd)[
ivar]->GetPDFHist()->GetNbinsX()
829 <<
" while we expect " <<
nbin[
ivar]
835 fout <<
" fHasDiscretPDF[" <<
ivar <<
"] = true; " << std::endl;
837 fout <<
" fHasDiscretPDF[" <<
ivar <<
"] = false; " << std::endl;
840 fout <<
"}" << std::endl << std::endl;
842 fout <<
"inline double " << className
843 <<
"::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
844 fout <<
"{" << std::endl;
845 fout <<
" double ps(1), pb(1);" << std::endl;
846 fout <<
" std::vector<double> inputValuesSig = inputValues;" << std::endl;
847 fout <<
" std::vector<double> inputValuesBgd = inputValues;" << std::endl;
848 if (GetTransformationHandler().GetTransformationList().GetSize() != 0) {
849 fout <<
" Transform(inputValuesSig,0);" << std::endl;
850 fout <<
" Transform(inputValuesBgd,1);" << std::endl;
852 fout <<
" for (size_t ivar = 0; ivar < GetNvar(); ivar++) {" << std::endl;
854 fout <<
" // dummy at present... will be used for variable transforms" << std::endl;
855 fout <<
" double x[2] = { inputValuesSig[ivar], inputValuesBgd[ivar] };" << std::endl;
857 fout <<
" for (int itype=0; itype < 2; itype++) {" << std::endl;
859 fout <<
" // interpolate linearly between adjacent bins" << std::endl;
860 fout <<
" // this is not useful for discrete variables (or forced Spline0)" << std::endl;
861 fout <<
" int bin = int((x[itype] - fHistMin[ivar])/(fHistMax[ivar] - fHistMin[ivar])*fNbin[ivar]) + 0;" << std::endl;
863 fout <<
" // since the test data sample is in general different from the training sample" << std::endl;
864 fout <<
" // it can happen that the min/max of the training sample are trespassed --> correct this" << std::endl;
865 fout <<
" if (bin < 0) {" << std::endl;
866 fout <<
" bin = 0;" << std::endl;
867 fout <<
" x[itype] = fHistMin[ivar];" << std::endl;
868 fout <<
" }" << std::endl;
869 fout <<
" else if (bin >= fNbin[ivar]) {" << std::endl;
870 fout <<
" bin = fNbin[ivar]-1;" << std::endl;
871 fout <<
" x[itype] = fHistMax[ivar];" << std::endl;
872 fout <<
" }" << std::endl;
874 fout <<
" // find corresponding histogram from cached indices" << std::endl;
875 fout <<
" float ref = (itype == 0) ? fRefS[ivar][bin] : fRefB[ivar][bin];" << std::endl;
877 fout <<
" // sanity check" << std::endl;
878 fout <<
" if (ref < 0) {" << std::endl;
879 fout <<
" std::cout << \"Fatal error in " << className
880 <<
": bin entry < 0 ==> abort\" << std::endl;" << std::endl;
881 fout <<
" std::exit(1);" << std::endl;
882 fout <<
" }" << std::endl;
884 fout <<
" double p = ref;" << std::endl;
886 fout <<
" if (GetType(ivar) != 'I' && !fHasDiscretPDF[ivar]) {" << std::endl;
887 fout <<
" float bincenter = (bin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
888 fout <<
" int nextbin = bin;" << std::endl;
889 fout <<
" if ((x[itype] > bincenter && bin != fNbin[ivar]-1) || bin == 0) " << std::endl;
890 fout <<
" nextbin++;" << std::endl;
891 fout <<
" else" << std::endl;
892 fout <<
" nextbin--; " << std::endl;
894 fout <<
" double refnext = (itype == 0) ? fRefS[ivar][nextbin] : fRefB[ivar][nextbin];" << std::endl;
895 fout <<
" float nextbincenter = (nextbin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
897 fout <<
" double dx = bincenter - nextbincenter;" << std::endl;
898 fout <<
" double dy = ref - refnext;" << std::endl;
899 fout <<
" p += (x[itype] - bincenter) * dy/dx;" << std::endl;
900 fout <<
" }" << std::endl;
902 fout <<
" if (p < fEpsilon) p = fEpsilon; // avoid zero response" << std::endl;
904 fout <<
" if (itype == 0) ps *= p;" << std::endl;
905 fout <<
" else pb *= p;" << std::endl;
906 fout <<
" } " << std::endl;
907 fout <<
" } " << std::endl;
909 fout <<
" // the likelihood ratio (transform it ?)" << std::endl;
910 fout <<
" return TransformLikelihoodOutput( ps, pb ); " << std::endl;
911 fout <<
"}" << std::endl << std::endl;
913 fout <<
"inline double " << className <<
"::TransformLikelihoodOutput( double ps, double pb ) const" << std::endl;
914 fout <<
"{" << std::endl;
915 fout <<
" // returns transformed or non-transformed output" << std::endl;
916 fout <<
" if (ps < fEpsilon) ps = fEpsilon;" << std::endl;
917 fout <<
" if (pb < fEpsilon) pb = fEpsilon;" << std::endl;
918 fout <<
" double r = ps/(ps + pb);" << std::endl;
919 fout <<
" if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
921 fout <<
" if (" << (fTransformLikelihoodOutput ?
"true" :
"false") <<
") {" << std::endl;
922 fout <<
" // inverse Fermi function" << std::endl;
924 fout <<
" // sanity check" << std::endl;
925 fout <<
" if (r <= 0.0) r = fEpsilon;" << std::endl;
926 fout <<
" else if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
928 fout <<
" double tau = 15.0;" << std::endl;
929 fout <<
" r = - log(1.0/r - 1.0)/tau;" << std::endl;
930 fout <<
" }" << std::endl;
932 fout <<
" return r;" << std::endl;
933 fout <<
"}" << std::endl;
936 fout <<
"// Clean up" << std::endl;
937 fout <<
"inline void " << className <<
"::Clear() " << std::endl;
938 fout <<
"{" << std::endl;
939 fout <<
" // nothing to clear" << std::endl;
940 fout <<
"}" << std::endl << std::endl;
942 fout <<
"// signal map" << std::endl;
943 fout <<
"float " << className <<
"::fRefS[][" <<
nbinMax <<
"] = " << std::endl;
944 fout <<
"{ " << std::endl;
949 fout << (*fPDFSig)[
ivar]->GetPDFHist()->GetBinContent(
ibin);
955 fout <<
" }, " << std::endl;
957 fout <<
"}; " << std::endl;
960 fout <<
"// background map" << std::endl;
961 fout <<
"float " << className <<
"::fRefB[][" <<
nbinMax <<
"] = " << std::endl;
962 fout <<
"{ " << std::endl;
965 fout << std::setprecision(8);
968 fout << (*fPDFBgd)[
ivar]->GetPDFHist()->GetBinContent(
ibin);
974 fout <<
" }, " << std::endl;
976 fout <<
"}; " << std::endl;
978 fout << std::setprecision(
dp);
994 Log() <<
"The maximum-likelihood classifier models the data with probability " <<
Endl;
995 Log() <<
"density functions (PDF) reproducing the signal and background" <<
Endl;
996 Log() <<
"distributions of the input variables. Correlations among the " <<
Endl;
997 Log() <<
"variables are ignored." <<
Endl;
1001 Log() <<
"Required for good performance are decorrelated input variables" <<
Endl;
1002 Log() <<
"(PCA transformation via the option \"VarTransform=Decorrelate\"" <<
Endl;
1003 Log() <<
"may be tried). Irreducible non-linear correlations may be reduced" <<
Endl;
1004 Log() <<
"by precombining strongly correlated input variables, or by simply" <<
Endl;
1005 Log() <<
"removing one of the variables." <<
Endl;
1009 Log() <<
"High fidelity PDF estimates are mandatory, i.e., sufficient training " <<
Endl;
1010 Log() <<
"statistics is required to populate the tails of the distributions" <<
Endl;
1011 Log() <<
"It would be a surprise if the default Spline or KDE kernel parameters" <<
Endl;
1012 Log() <<
"provide a satisfying fit to the data. The user is advised to properly" <<
Endl;
1013 Log() <<
"tune the events per bin and smooth options in the spline cases" <<
Endl;
1014 Log() <<
"individually per variable. If the KDE kernel is used, the adaptive" <<
Endl;
1015 Log() <<
"Gaussian kernel may lead to artefacts, so please always also try" <<
Endl;
1016 Log() <<
"the non-adaptive one." <<
Endl;
1017 Log() <<
"" <<
Endl;
1018 Log() <<
"All tuning parameters must be adjusted individually for each input" <<
Endl;
1019 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
TDirectory::TContext keeps track and restore the current directory.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
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.
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.
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.