PandaRoot
PndStdKnnClassify Class Reference

#include <PndStdKnnClassify.h>

Inheritance diagram for PndStdKnnClassify:
PndMvaClassifier

Public Member Functions

 PndStdKnnClassify (std::string const &inputFile, std::vector< std::string > const &classNames, std::vector< std::string > const &varNames)
 
virtual ~PndStdKnnClassify ()
 Destructor. More...
 
void GetMvaValues (std::vector< float > eventData, std::map< std::string, float > &result)
 
std::string * Classify (std::vector< float > EvtData)
 
void SetKNN (unsigned int const nNeighbours)
 
unsigned int GetKnn () const
 
void Initialize ()
 
- Public Member Functions inherited from PndMvaClassifier
 PndMvaClassifier (std::string const &InPut, std::vector< std::string > const &ClassNames, std::vector< std::string > const &VarNames)
 Constructor. More...
 
virtual ~PndMvaClassifier ()
 Destructor. More...
 
std::vector< PndMvaClass > const & GetClasses () const
 Get the list of available classes (labels). More...
 
std::vector< PndMvaVariable > const & GetVariables () const
 Get the list of available variables. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PndMvaClassifier
virtual void NormalizeEvent (std::vector< float > &EvtVector) const
 Normalize the given event vector. More...
 
void SetAppType (AppType t)
 
- Protected Attributes inherited from PndMvaClassifier
PndMvaDataSet m_dataSets
 Data set. Holds event Weights. More...
 

Detailed Description

Definition at line 23 of file PndStdKnnClassify.h.

Constructor & Destructor Documentation

◆ PndStdKnnClassify()

PndStdKnnClassify::PndStdKnnClassify ( std::string const &  inputFile,
std::vector< std::string > const &  classNames,
std::vector< std::string > const &  varNames 
)
explicit
Parameters
inputFileThe name of the file that holds the weights
classNamesThe names of classes to which an event might be assigned to.
varNamesVariable names from which the feature vector is built.

◆ ~PndStdKnnClassify()

virtual PndStdKnnClassify::~PndStdKnnClassify ( )
virtual

Destructor.

Member Function Documentation

◆ Classify()

std::string* PndStdKnnClassify::Classify ( std::vector< float >  EvtData)
virtual

Given a feature vector describing the pattern. Classifies the pattern.

Parameters
EvtDataInput vector describing the pattern.
Returns
The name of the class to which the current pattern is assigned.

Implements PndMvaClassifier.

◆ GetKnn()

unsigned int PndStdKnnClassify::GetKnn ( ) const
inline

Get number of neighbors.

Definition at line 79 of file PndStdKnnClassify.h.

80 {
81  return m_Knn;
82 };

◆ GetMvaValues()

void PndStdKnnClassify::GetMvaValues ( std::vector< float >  eventData,
std::map< std::string, float > &  result 
)
virtual

Classification function.

Parameters
EvtDataFeature vector of the current event which we want to classify.
resultHolds the normalized results of classification for every class of events.

Implements PndMvaClassifier.

◆ Initialize()

void PndStdKnnClassify::Initialize ( )
virtual

Initialize classifier.

Reimplemented from PndMvaClassifier.

◆ SetKNN()

void PndStdKnnClassify::SetKNN ( unsigned int const  nNeighbours)
inline
Parameters
NeighboursNumber of Neighbours.

Definition at line 84 of file PndStdKnnClassify.h.

85 {
86  m_Knn = nNeighbours;
87 };

The documentation for this class was generated from the following file: