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" );
677 Log() << kDEBUG <<
"Reading signal and background PDF for variable: " << GetInputVar(
ivar ) <<
Endl;
678 if ((*fPDFSig)[
ivar] !=0)
delete (*fPDFSig)[
ivar];
679 if ((*fPDFBgd)[
ivar] !=0)
delete (*fPDFBgd)[
ivar];
680 (*fPDFSig)[
ivar] =
new PDF( GetInputVar(
ivar ) +
" PDF Sig" );
681 (*fPDFBgd)[
ivar] =
new PDF( GetInputVar(
ivar ) +
" PDF Bkg" );
682 (*fPDFSig)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
683 (*fPDFBgd)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
701 Log() << kDEBUG <<
"Reading signal and background PDF for variable: " << GetInputVar(
ivar ) <<
Endl;
702 if ((*fPDFSig)[
ivar] !=0)
delete (*fPDFSig)[
ivar];
703 if ((*fPDFBgd)[
ivar] !=0)
delete (*fPDFBgd)[
ivar];
704 (*fPDFSig)[
ivar] =
new PDF(GetInputVar(
ivar ) +
" PDF Sig" );
705 (*fPDFBgd)[
ivar] =
new PDF(GetInputVar(
ivar ) +
" PDF Bkg");
706 (*fPDFSig)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
707 (*fPDFBgd)[
ivar]->SetReadingVersion( GetTrainingTMVAVersionCode() );
731 Log() << kINFO <<
"Write monitoring histograms to file: " << BaseDir()->GetPath() <<
Endl;
736 (*fHistBgd)[
ivar]->Write();
737 if ((*fHistSig_smooth)[
ivar] != 0) (*fHistSig_smooth)[
ivar]->Write();
738 if ((*fHistBgd_smooth)[
ivar] != 0) (*fHistBgd_smooth)[
ivar]->Write();
739 (*fPDFSig)[
ivar]->GetPDFHist()->Write();
740 (*fPDFBgd)[
ivar]->GetPDFHist()->Write();
742 if ((*fPDFSig)[
ivar]->GetNSmoothHist() != 0) (*fPDFSig)[
ivar]->GetNSmoothHist()->Write();
743 if ((*fPDFBgd)[
ivar]->GetNSmoothHist() != 0) (*fPDFBgd)[
ivar]->GetNSmoothHist()->Write();
748 TH1F* mm =
new TH1F( (*fInputVars)[
ivar]+
"_additional_check",
749 (*fInputVars)[
ivar]+
"_additional_check", 15000,
xmin,
xmax );
751 for (
Int_t bin=0; bin < 15000; bin++) {
759 for (
UInt_t i=0; i<2; i++) {
763 if (
hclone->GetNbinsX() > 100) {
779 fout <<
"#include <cmath>" << std::endl;
780 fout <<
"#include <cstdlib>" << std::endl;
789 fout <<
" double fEpsilon;" << std::endl;
799 fout <<
" static float fRefS[][" <<
nbinMax <<
"]; "
800 <<
"// signal reference vector [nvars][max_nbins]" << std::endl;
801 fout <<
" static float fRefB[][" <<
nbinMax <<
"]; "
802 <<
"// backgr reference vector [nvars][max_nbins]" << std::endl << std::endl;
803 fout <<
"// if a variable has its PDF encoded as a spline0 --> treat it like an Integer valued one" <<std::endl;
804 fout <<
" bool fHasDiscretPDF[" << GetNvar() <<
"]; "<< std::endl;
805 fout <<
" int fNbin[" << GetNvar() <<
"]; "
806 <<
"// number of bins (discrete variables may have less bins)" << std::endl;
807 fout <<
" double fHistMin[" << GetNvar() <<
"]; " << std::endl;
808 fout <<
" double fHistMax[" << GetNvar() <<
"]; " << std::endl;
810 fout <<
" double TransformLikelihoodOutput( double, double ) const;" << std::endl;
811 fout <<
"};" << std::endl;
812 fout <<
"" << std::endl;
813 fout <<
"inline void " << className <<
"::Initialize() " << std::endl;
814 fout <<
"{" << std::endl;
815 fout <<
" fEpsilon = " << fEpsilon <<
";" << std::endl;
817 fout <<
" fNbin[" <<
ivar <<
"] = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() <<
";" << std::endl;
818 fout <<
" fHistMin[" <<
ivar <<
"] = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetXaxis()->GetXmin() <<
";" << std::endl;
819 fout <<
" fHistMax[" <<
ivar <<
"] = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetXaxis()->GetXmax() <<
";" << std::endl;
821 if ((((*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() !=
nbin[
ivar] ||
822 (*fPDFBgd)[
ivar]->GetPDFHist()->GetNbinsX() !=
nbin[
ivar])
824 (*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() != (*fPDFBgd)[
ivar]->GetPDFHist()->GetNbinsX()) {
825 Log() << kFATAL <<
"<MakeClassSpecific> Mismatch in binning of variable "
826 <<
"\"" << GetOriginalVarName(
ivar) <<
"\" of type: \'" << DataInfo().GetVariableInfo(
ivar).GetVarType()
828 <<
"nxS = " << (*fPDFSig)[
ivar]->GetPDFHist()->GetNbinsX() <<
", "
829 <<
"nxB = " << (*fPDFBgd)[
ivar]->GetPDFHist()->GetNbinsX()
830 <<
" while we expect " <<
nbin[
ivar]
836 fout <<
" fHasDiscretPDF[" <<
ivar <<
"] = true; " << std::endl;
838 fout <<
" fHasDiscretPDF[" <<
ivar <<
"] = false; " << std::endl;
841 fout <<
"}" << std::endl << std::endl;
843 fout <<
"inline double " << className
844 <<
"::GetMvaValue__( const std::vector<double>& inputValues ) const" << std::endl;
845 fout <<
"{" << std::endl;
846 fout <<
" double ps(1), pb(1);" << std::endl;
847 fout <<
" std::vector<double> inputValuesSig = inputValues;" << std::endl;
848 fout <<
" std::vector<double> inputValuesBgd = inputValues;" << std::endl;
849 if (GetTransformationHandler().GetTransformationList().GetSize() != 0) {
850 fout <<
" Transform(inputValuesSig,0);" << std::endl;
851 fout <<
" Transform(inputValuesBgd,1);" << std::endl;
853 fout <<
" for (size_t ivar = 0; ivar < GetNvar(); ivar++) {" << std::endl;
855 fout <<
" // dummy at present... will be used for variable transforms" << std::endl;
856 fout <<
" double x[2] = { inputValuesSig[ivar], inputValuesBgd[ivar] };" << std::endl;
858 fout <<
" for (int itype=0; itype < 2; itype++) {" << std::endl;
860 fout <<
" // interpolate linearly between adjacent bins" << std::endl;
861 fout <<
" // this is not useful for discrete variables (or forced Spline0)" << std::endl;
862 fout <<
" int bin = int((x[itype] - fHistMin[ivar])/(fHistMax[ivar] - fHistMin[ivar])*fNbin[ivar]) + 0;" << std::endl;
864 fout <<
" // since the test data sample is in general different from the training sample" << std::endl;
865 fout <<
" // it can happen that the min/max of the training sample are trespassed --> correct this" << std::endl;
866 fout <<
" if (bin < 0) {" << std::endl;
867 fout <<
" bin = 0;" << std::endl;
868 fout <<
" x[itype] = fHistMin[ivar];" << std::endl;
869 fout <<
" }" << std::endl;
870 fout <<
" else if (bin >= fNbin[ivar]) {" << std::endl;
871 fout <<
" bin = fNbin[ivar]-1;" << std::endl;
872 fout <<
" x[itype] = fHistMax[ivar];" << std::endl;
873 fout <<
" }" << std::endl;
875 fout <<
" // find corresponding histogram from cached indices" << std::endl;
876 fout <<
" float ref = (itype == 0) ? fRefS[ivar][bin] : fRefB[ivar][bin];" << std::endl;
878 fout <<
" // sanity check" << std::endl;
879 fout <<
" if (ref < 0) {" << std::endl;
880 fout <<
" std::cout << \"Fatal error in " << className
881 <<
": bin entry < 0 ==> abort\" << std::endl;" << std::endl;
882 fout <<
" std::exit(1);" << std::endl;
883 fout <<
" }" << std::endl;
885 fout <<
" double p = ref;" << std::endl;
887 fout <<
" if (GetType(ivar) != 'I' && !fHasDiscretPDF[ivar]) {" << std::endl;
888 fout <<
" float bincenter = (bin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
889 fout <<
" int nextbin = bin;" << std::endl;
890 fout <<
" if ((x[itype] > bincenter && bin != fNbin[ivar]-1) || bin == 0) " << std::endl;
891 fout <<
" nextbin++;" << std::endl;
892 fout <<
" else" << std::endl;
893 fout <<
" nextbin--; " << std::endl;
895 fout <<
" double refnext = (itype == 0) ? fRefS[ivar][nextbin] : fRefB[ivar][nextbin];" << std::endl;
896 fout <<
" float nextbincenter = (nextbin + 0.5)/fNbin[ivar]*(fHistMax[ivar] - fHistMin[ivar]) + fHistMin[ivar];" << std::endl;
898 fout <<
" double dx = bincenter - nextbincenter;" << std::endl;
899 fout <<
" double dy = ref - refnext;" << std::endl;
900 fout <<
" p += (x[itype] - bincenter) * dy/dx;" << std::endl;
901 fout <<
" }" << std::endl;
903 fout <<
" if (p < fEpsilon) p = fEpsilon; // avoid zero response" << std::endl;
905 fout <<
" if (itype == 0) ps *= p;" << std::endl;
906 fout <<
" else pb *= p;" << std::endl;
907 fout <<
" } " << std::endl;
908 fout <<
" } " << std::endl;
910 fout <<
" // the likelihood ratio (transform it ?)" << std::endl;
911 fout <<
" return TransformLikelihoodOutput( ps, pb ); " << std::endl;
912 fout <<
"}" << std::endl << std::endl;
914 fout <<
"inline double " << className <<
"::TransformLikelihoodOutput( double ps, double pb ) const" << std::endl;
915 fout <<
"{" << std::endl;
916 fout <<
" // returns transformed or non-transformed output" << std::endl;
917 fout <<
" if (ps < fEpsilon) ps = fEpsilon;" << std::endl;
918 fout <<
" if (pb < fEpsilon) pb = fEpsilon;" << std::endl;
919 fout <<
" double r = ps/(ps + pb);" << std::endl;
920 fout <<
" if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
922 fout <<
" if (" << (fTransformLikelihoodOutput ?
"true" :
"false") <<
") {" << std::endl;
923 fout <<
" // inverse Fermi function" << std::endl;
925 fout <<
" // sanity check" << std::endl;
926 fout <<
" if (r <= 0.0) r = fEpsilon;" << std::endl;
927 fout <<
" else if (r >= 1.0) r = 1. - 1.e-15;" << std::endl;
929 fout <<
" double tau = 15.0;" << std::endl;
930 fout <<
" r = - log(1.0/r - 1.0)/tau;" << std::endl;
931 fout <<
" }" << std::endl;
933 fout <<
" return r;" << std::endl;
934 fout <<
"}" << std::endl;
937 fout <<
"// Clean up" << std::endl;
938 fout <<
"inline void " << className <<
"::Clear() " << std::endl;
939 fout <<
"{" << std::endl;
940 fout <<
" // nothing to clear" << std::endl;
941 fout <<
"}" << std::endl << std::endl;
943 fout <<
"// signal map" << std::endl;
944 fout <<
"float " << className <<
"::fRefS[][" <<
nbinMax <<
"] = " << std::endl;
945 fout <<
"{ " << std::endl;
950 fout << (*fPDFSig)[
ivar]->GetPDFHist()->GetBinContent(
ibin);
956 fout <<
" }, " << std::endl;
958 fout <<
"}; " << std::endl;
961 fout <<
"// background map" << std::endl;
962 fout <<
"float " << className <<
"::fRefB[][" <<
nbinMax <<
"] = " << std::endl;
963 fout <<
"{ " << std::endl;
966 fout << std::setprecision(8);
969 fout << (*fPDFBgd)[
ivar]->GetPDFHist()->GetBinContent(
ibin);
975 fout <<
" }, " << std::endl;
977 fout <<
"}; " << std::endl;
979 fout << std::setprecision(
dp);
995 Log() <<
"The maximum-likelihood classifier models the data with probability " <<
Endl;
996 Log() <<
"density functions (PDF) reproducing the signal and background" <<
Endl;
997 Log() <<
"distributions of the input variables. Correlations among the " <<
Endl;
998 Log() <<
"variables are ignored." <<
Endl;
1002 Log() <<
"Required for good performance are decorrelated input variables" <<
Endl;
1003 Log() <<
"(PCA transformation via the option \"VarTransform=Decorrelate\"" <<
Endl;
1004 Log() <<
"may be tried). Irreducible non-linear correlations may be reduced" <<
Endl;
1005 Log() <<
"by precombining strongly correlated input variables, or by simply" <<
Endl;
1006 Log() <<
"removing one of the variables." <<
Endl;
1010 Log() <<
"High fidelity PDF estimates are mandatory, i.e., sufficient training " <<
Endl;
1011 Log() <<
"statistics is required to populate the tails of the distributions" <<
Endl;
1012 Log() <<
"It would be a surprise if the default Spline or KDE kernel parameters" <<
Endl;
1013 Log() <<
"provide a satisfying fit to the data. The user is advised to properly" <<
Endl;
1014 Log() <<
"tune the events per bin and smooth options in the spline cases" <<
Endl;
1015 Log() <<
"individually per variable. If the KDE kernel is used, the adaptive" <<
Endl;
1016 Log() <<
"Gaussian kernel may lead to artefacts, so please always also try" <<
Endl;
1017 Log() <<
"the non-adaptive one." <<
Endl;
1018 Log() <<
"" <<
Endl;
1019 Log() <<
"All tuning parameters must be adjusted individually for each input" <<
Endl;
1020 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 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.
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.