Belle II Software  release-05-02-19
ReweighterExpert Class Reference

Expert for the Reweighter MVA method. More...

#include <Reweighter.h>

Inheritance diagram for ReweighterExpert:
Collaboration diagram for ReweighterExpert:

Public Member Functions

virtual void load (Weightfile &weightfile) override
 Load the expert from a Weightfile. More...
 
virtual std::vector< float > apply (Dataset &test_data) const override
 Apply this expert onto a dataset. More...
 
virtual std::vector< float > apply (Dataset &test_data, const unsigned int classID) const
 Apply this expert onto a dataset. More...
 

Protected Attributes

GeneralOptions m_general_options
 General options loaded from the weightfile.
 

Private Attributes

ReweighterOptions m_specific_options
 Method specific options.
 
GeneralOptions m_expert_options
 Method general options of the expert.
 
std::unique_ptr< Expertm_expert
 Experts used to reweight.
 
double m_norm = 0.0
 Norm for the weights.
 

Detailed Description

Expert for the Reweighter MVA method.

Definition at line 86 of file Reweighter.h.

Member Function Documentation

◆ apply() [1/2]

std::vector< float > apply ( Dataset test_data) const
overridevirtual

Apply this expert onto a dataset.

Parameters
test_datadataset

Implements Expert.

Definition at line 186 of file Reweighter.cc.

186  {
187  prediction[iEvent] = 1.0;
188  } else {
189  if (prediction[iEvent] > 0.995)
190  prediction[iEvent] = 0.995;
191  if (prediction[iEvent] < 0.005)
192  prediction[iEvent] = 0.005;
193 
194  prediction[iEvent] = (prediction[iEvent]) / (1 - prediction[iEvent]);
195  prediction[iEvent] /= m_norm;
196  }
197  }
198  } else {
199  for (unsigned int iEvent = 0; iEvent < test_data.getNumberOfEvents(); ++iEvent) {
200  if (prediction[iEvent] > 0.995)
201  prediction[iEvent] = 0.995;
202  if (prediction[iEvent] < 0.005)
203  prediction[iEvent] = 0.005;
204 
205  prediction[iEvent] = (prediction[iEvent]) / (1 - prediction[iEvent]);
206  prediction[iEvent] /= m_norm;
207  }
208  }
209 
210  return prediction;
211 
212  }
213  }
215 }

◆ apply() [2/2]

virtual std::vector<float> apply ( Dataset test_data,
const unsigned int  classID 
) const
inlinevirtualinherited

Apply this expert onto a dataset.

Multi-class mode signature. Not pure virtual, since not all derived classes need to re-implement this.

Parameters
test_datadataset
classIDclass identifier.

Reimplemented in TMVAExpertMulticlass.

Definition at line 59 of file Expert.h.

◆ load()

void load ( Weightfile weightfile)
overridevirtual

Load the expert from a Weightfile.

Parameters
weightfilecontaining all information necessary to build the expert

Implements Expert.

Definition at line 164 of file Reweighter.cc.


The documentation for this class was generated from the following files:
Belle2::MVA::ReweighterExpert::m_norm
double m_norm
Norm for the weights.
Definition: Reweighter.h:105