Belle II Software  release-05-01-25
FastBDTExpert Class Reference

Expert for the FastBDT MVA method. More...

#include <FastBDT.h>

Inheritance diagram for FastBDTExpert:
Collaboration diagram for FastBDTExpert:

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

FastBDTOptions m_specific_options
 Method specific options.
 
FastBDT::Forest m_expert_forest
 Forest Expert.
 
std::vector< FastBDT::FeatureBinning< float > > m_expert_feature_binning
 Forest feature binning.
 

Detailed Description

Expert for the FastBDT MVA method.

Definition at line 124 of file FastBDT.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 414 of file FastBDT.cc.

415  {
416 
417  std::vector<float> probabilities(test_data.getNumberOfEvents());
418  for (unsigned int iEvent = 0; iEvent < test_data.getNumberOfEvents(); ++iEvent) {
419  test_data.loadEvent(iEvent);
420 #if FastBDT_VERSION_MAJOR >= 3
421 #if FastBDT_VERSION_MAJOR >= 5
422  if (m_use_simplified_interface)
423  probabilities[iEvent] = m_classifier.predict(test_data.m_input);
424  else
425  probabilities[iEvent] = m_expert_forest.Analyse(test_data.m_input);
426 #else
427  probabilities[iEvent] = m_expert_forest.Analyse(test_data.m_input);
428 #endif
429 #else
430  std::vector<unsigned int> bins(m_expert_feature_binning.size());
431  for (unsigned int iFeature = 0; iFeature < m_expert_feature_binning.size(); ++iFeature) {
432  bins[iFeature] = m_expert_feature_binning[iFeature].ValueToBin(test_data.m_input[iFeature]);
433  }
434  probabilities[iEvent] = m_expert_forest.Analyse(bins);
435 #endif
436  }
437 
438  return probabilities;
439 
440  }

◆ 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 321 of file FastBDT.cc.


The documentation for this class was generated from the following files:
Belle2::MVA::FastBDTExpert::m_expert_forest
FastBDT::Forest m_expert_forest
Forest Expert.
Definition: FastBDT.h:148
Belle2::MVA::FastBDTExpert::m_expert_feature_binning
std::vector< FastBDT::FeatureBinning< float > > m_expert_feature_binning
Forest feature binning.
Definition: FastBDT.h:149