FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
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 ()
 
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...
 

Protected Member Functions

virtual void NormalizeEvent (std::vector< float > &EvtVector) const
 Normalize the given event vector. More...
 
void SetAppType (AppType t)
 

Protected Attributes

PndMvaDataSet m_dataSets
 Data set. Holds event Weights. More...
 

Private Member Functions

 PndStdKnnClassify (const PndStdKnnClassify &other)
 To avoid mistakes. More...
 
PndStdKnnClassifyoperator= (const PndStdKnnClassify &other)
 

Private Attributes

unsigned int m_Knn
 Number of Neighbours. More...
 
std::vector< PndMvaDistObjm_distances
 Container to hold the distances to current pattern. More...
 

Detailed Description

Definition at line 23 of file PndStdKnnClassify.h.

Constructor & Destructor Documentation

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.
virtual PndStdKnnClassify::~PndStdKnnClassify ( )
virtual

Destructor.

PndStdKnnClassify::PndStdKnnClassify ( const PndStdKnnClassify other)
private

To avoid mistakes.

Member Function Documentation

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.

std::vector< PndMvaClass > const & PndMvaClassifier::GetClasses ( ) const
inlineinherited

Get the list of available classes (labels).

Definition at line 90 of file PndMvaClassifier.h.

References PndMvaDataSet::GetClasses(), and PndMvaClassifier::m_dataSets.

91 {
92  return m_dataSets.GetClasses();
93 };
PndMvaDataSet m_dataSets
Data set. Holds event Weights.
std::vector< PndMvaClass > const & GetClasses() const
Get the list of available classes (labels).
unsigned int PndStdKnnClassify::GetKnn ( ) const
inline

Get number of neighbors.

Definition at line 83 of file PndStdKnnClassify.h.

References m_Knn.

84 {
85  return m_Knn;
86 };
unsigned int m_Knn
Number of Neighbours.
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.

std::vector< PndMvaVariable > const & PndMvaClassifier::GetVariables ( ) const
inlineinherited

Get the list of available variables.

Definition at line 96 of file PndMvaClassifier.h.

References PndMvaDataSet::GetVars(), and PndMvaClassifier::m_dataSets.

97 {
98  return m_dataSets.GetVars();
99 };
PndMvaDataSet m_dataSets
Data set. Holds event Weights.
std::vector< PndMvaVariable > const & GetVars() const
Get the list of available variables.
void PndStdKnnClassify::Initialize ( )
virtual

Initialize classifier.

Reimplemented from PndMvaClassifier.

virtual void PndMvaClassifier::NormalizeEvent ( std::vector< float > &  EvtVector) const
protectedvirtualinherited

Normalize the given event vector.

PndStdKnnClassify& PndStdKnnClassify::operator= ( const PndStdKnnClassify other)
private
void PndMvaClassifier::SetAppType ( AppType  t)
inlineprotectedinherited

Definition at line 83 of file PndMvaClassifier.h.

References PndMvaClassifier::m_dataSets, and PndMvaDataSet::SetAppType().

84 {
86 };
void SetAppType(AppType t)
PndMvaDataSet m_dataSets
Data set. Holds event Weights.
TTree * t
Definition: bump_analys.C:13
void PndStdKnnClassify::SetKNN ( unsigned int const  nNeighbours)
inline
Parameters
NeighboursNumber of Neighbours.

Definition at line 88 of file PndStdKnnClassify.h.

References m_Knn.

89 {
90  m_Knn = nNeighbours;
91 };
unsigned int m_Knn
Number of Neighbours.

Member Data Documentation

PndMvaDataSet PndMvaClassifier::m_dataSets
protectedinherited

Data set. Holds event Weights.

Definition at line 75 of file PndMvaClassifier.h.

Referenced by PndMvaClassifier::GetClasses(), PndMvaClassifier::GetVariables(), and PndMvaClassifier::SetAppType().

std::vector<PndMvaDistObj> PndStdKnnClassify::m_distances
private

Container to hold the distances to current pattern.

Definition at line 80 of file PndStdKnnClassify.h.

unsigned int PndStdKnnClassify::m_Knn
private

Number of Neighbours.

Definition at line 77 of file PndStdKnnClassify.h.

Referenced by GetKnn(), and SetKNN().


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