48 fAchievableEff(dsi->GetNClasses()),
49 fAchievablePur(dsi->GetNClasses()),
50 fBestCuts(dsi->GetNClasses(),
std::vector<
Double_t>(dsi->GetNClasses()))
66 if (ievt >= (
Int_t)fMultiClassValues.size()) fMultiClassValues.resize( ievt+1 );
67 fMultiClassValues[ievt] =
value;
86 for(
UInt_t icls = 0; icls<cutvalues.size(); ++icls){
87 if(cutvalues.at(icls)<0. ? -fMultiClassValues[ievt][icls]<cutvalues.at(icls) : fMultiClassValues[ievt][icls]<=cutvalues.at(icls)){
100 Float_t eff = truePositive/sumWeights;
101 Float_t pur = truePositive/(truePositive+falsePositive);
105 if( effTimesPur > 0 )
106 toMinimize = 1./(effTimesPur);
108 fAchievableEff.at(fClassToOptimize) = eff;
109 fAchievablePur.at(fClassToOptimize) = pur;
121 Log() <<
kINFO <<
"Calculating best set of cuts for class "
124 fClassToOptimize = targetClass;
128 const TString opts(
"PopSize=100:Steps=30" );
131 std::vector<Double_t>
result;
134 fBestCuts.at(targetClass) =
result;
137 for( std::vector<Double_t>::iterator it = result.begin(); it<result.end(); it++ ){
150 Log() <<
kINFO <<
"Creating multiclass response histograms..." <<
Endl;
156 std::vector<std::vector<TH1F*> > histos;
160 histos.push_back(std::vector<TH1F*>(0));
165 histos.at(iCls).push_back(
new TH1F(name,name,nbins,xmin,xmax));
174 histos.at(cls).at(jCls)->Fill(fMultiClassValues[ievt][jCls],w);
180 Store(histos.at(iCls).at(jCls));
MsgLogger & Endl(MsgLogger &ml)
Double_t Run(std::vector< Double_t > &pars)
Execute fitting.
UInt_t GetNClasses() const
~ResultsMulticlass()
destructor
Double_t GetWeight() const
return the event weight - depending on whether the flag IgnoreNegWeightsInTraining is or not...
const char * Data() const
std::vector< std::vector< double > > Data
ResultsMulticlass(const DataSetInfo *dsi, TString resultsName)
constructor
TFileCollection * GetDataSet(const char *ds, const char *server="")
GetDataSet wrapper.
void SetValue(std::vector< Float_t > &value, Int_t ievt)
ClassInfo * GetClassInfo(Int_t clNum) const
char * Form(const char *fmt,...)
Double_t EstimatorFunction(std::vector< Double_t > &)
const TString & GetName() const
void CreateMulticlassHistos(TString prefix, Int_t nbins, Int_t nbins_high)
const Event * GetEvent() const
void SetCurrentType(Types::ETreeType type) const
std::vector< Double_t > GetBestMultiClassCuts(UInt_t targetClass)
Long64_t GetNEvents(Types::ETreeType type=Types::kMaxTreeType) const
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)