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

Expert for the Combination MVA method. More...

#include <Combination.h>

Inheritance diagram for CombinationExpert:
Collaboration diagram for CombinationExpert:

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

CombinationOptions m_specific_options
 Method specific options.
 
std::vector< std::unique_ptr< Expert > > m_experts
 Experts of the methods to combine.
 
std::vector< std::vector< std::string > > m_expert_variables
 Results of the experts to combine.
 

Detailed Description

Expert for the Combination MVA method.

Definition at line 85 of file Combination.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 115 of file Combination.cc.

115  {}, test_data);
116  expert_probabilities.push_back(m_experts[iExpert]->apply(sub_dataset));
117  }
118 
119  for (unsigned int iEvent = 0; iEvent < test_data.getNumberOfEvents(); ++iEvent) {
120  double a = 1.0;
121  double b = 1.0;
122  for (unsigned int iExpert = 0; iExpert < m_experts.size(); ++iExpert) {
123  a *= expert_probabilities[iExpert][iEvent];
124  b *= (1.0 - expert_probabilities[iExpert][iEvent]);
125  }
126  probabilities[iEvent] = a / (a + b);
127  }
128  return probabilities;
129  }
130 
131  }
133 }

◆ 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.

60  {
61 
62  (void) test_data;
63  (void) classID;
64 
65  return std::vector<float>();
66  };

◆ 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 87 of file Combination.cc.


The documentation for this class was generated from the following files:
Belle2::MVA::CombinationExpert::m_experts
std::vector< std::unique_ptr< Expert > > m_experts
Experts of the methods to combine.
Definition: Combination.h:102
Belle2::MVA::CombinationExpert::apply
virtual std::vector< float > apply(Dataset &test_data) const override
Apply this expert onto a dataset.
Definition: Combination.cc:115