FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
PndMvaTrainer Class Referenceabstract

#include <PndMvaTrainer.h>

Inheritance diagram for PndMvaTrainer:
PndKnnTrain PndLVQTrain PndMultiClassBdtTrain PndMultiClassMlpTrain PndPDEFoamTrain

Public Member Functions

 PndMvaTrainer (std::vector< std::pair< std::string, std::vector< float > * > > const &InputEvtsParam, std::vector< std::string > const &ClassNames, std::vector< std::string > const &VarNames, bool trim=true)
 
 PndMvaTrainer (std::string const &InPut, std::vector< std::string > const &ClassNames, std::vector< std::string > const &VarNames, bool trim=true)
 
virtual ~PndMvaTrainer ()
 Destructor. More...
 
virtual void Train ()=0
 Derived classes need to implement this methode. More...
 
virtual void storeWeights ()=0
 
void SetTestSetSize (size_t percent=50)
 
void SetTestSet (std::set< size_t > const &testSet)
 
void NormalizeData (NormType t=NONORM)
 
void PCATransForm ()
 
void SetOutPutFile (std::string const &outFile)
 
void WriteErroVect (std::string const &FileName) const
 
std::vector< StepError > const & GetErrorValues () const
 
virtual void Initialize ()
 
std::set< size_t > const & GetTestEvetIdx () const
 
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...
 
virtual void EvalClassifierError ()
 
size_t GetRndSeed () const
 
void SetRndSeed (size_t const sd)
 

Protected Member Functions

void SetAppType (AppType t)
 
void WriteToWeightFile (std::vector< std::pair< std::string, std::vector< float > * > > const &weights) const
 
void splitTetsSet ()
 

Protected Attributes

std::set< size_t > m_testSet_indices
 Indices of the test set. More...
 
PndMvaDataSet m_dataSets
 Data set. Holds event values. More...
 
std::vector< StepErrorm_StepErro
 Container to keep per step error values. More...
 
std::string m_outFile
 Output filename. More...
 
size_t m_RND_seed
 Random seed. More...
 

Private Member Functions

 PndMvaTrainer (PndMvaTrainer const &other)
 To avoid mistakes. More...
 
PndMvaTraineroperator= (PndMvaTrainer const &other)
 

Private Attributes

bool m_trim
 
size_t m_testSetSize
 

Detailed Description

Definition at line 33 of file PndMvaTrainer.h.

Constructor & Destructor Documentation

PndMvaTrainer::PndMvaTrainer ( std::vector< std::pair< std::string, std::vector< float > * > > const &  InputEvtsParam,
std::vector< std::string > const &  ClassNames,
std::vector< std::string > const &  VarNames,
bool  trim = true 
)
explicit

Constructor.

Parameters
InPutThe input parameters.
ClassNamesNames of available labels(classes).
VarNamesNames of available variables.
PndMvaTrainer::PndMvaTrainer ( std::string const &  InPut,
std::vector< std::string > const &  ClassNames,
std::vector< std::string > const &  VarNames,
bool  trim = true 
)
explicit

Constructor.

Parameters
InPut,Theinput filename.
ClassNamesNames of available classes.
VarNamesNames of available variables.
virtual PndMvaTrainer::~PndMvaTrainer ( )
virtual

Destructor.

PndMvaTrainer::PndMvaTrainer ( PndMvaTrainer const &  other)
private

To avoid mistakes.

Member Function Documentation

virtual void PndMvaTrainer::EvalClassifierError ( )
virtual

Classifier evaluation.

Reimplemented in PndLVQTrain.

std::vector< PndMvaClass > const & PndMvaTrainer::GetClasses ( ) const
inline

Get the list of available classes (labels).

Get the list of available classes (labels). Vector containing available labels.

Definition at line 226 of file PndMvaTrainer.h.

References PndMvaDataSet::GetClasses(), and m_dataSets.

227 {
228  return m_dataSets.GetClasses();
229 };
PndMvaDataSet m_dataSets
Data set. Holds event values.
std::vector< PndMvaClass > const & GetClasses() const
Get the list of available classes (labels).
std::vector< StepError > const & PndMvaTrainer::GetErrorValues ( ) const
inline

Get the list of objects that contain the classifier evaluation results.

Returns
List of evaluation objects.

Definition at line 238 of file PndMvaTrainer.h.

References m_StepErro.

239 {
240  return m_StepErro;
241 };
std::vector< StepError > m_StepErro
Container to keep per step error values.
size_t PndMvaTrainer::GetRndSeed ( ) const
inline

Definition at line 200 of file PndMvaTrainer.h.

References m_RND_seed.

201 {
202  return this->m_RND_seed;
203 };
size_t m_RND_seed
Random seed.
std::set< size_t > const & PndMvaTrainer::GetTestEvetIdx ( ) const
inline

Get the indices of the events selected to be used for testing.

Returns
A set containing the indices of test events.

Definition at line 220 of file PndMvaTrainer.h.

References m_testSet_indices.

221 {
222  return m_testSet_indices;
223 };
std::set< size_t > m_testSet_indices
Indices of the test set.
std::vector< PndMvaVariable > const & PndMvaTrainer::GetVariables ( ) const
inline

Get the list of available variables.

Get the list of available variables. Vector containing available Parameters (features).

Definition at line 232 of file PndMvaTrainer.h.

References PndMvaDataSet::GetVars(), and m_dataSets.

233 {
234  return m_dataSets.GetVars();
235 };
PndMvaDataSet m_dataSets
Data set. Holds event values.
std::vector< PndMvaVariable > const & GetVars() const
Get the list of available variables.
virtual void PndMvaTrainer::Initialize ( )
virtual

Initialize data structures.

Reimplemented in PndMultiClassBdtTrain, and PndMultiClassMlpTrain.

void PndMvaTrainer::NormalizeData ( NormType  t = NONORM)

Select input data normalization scheme.

PndMvaTrainer& PndMvaTrainer::operator= ( PndMvaTrainer const &  other)
private
void PndMvaTrainer::PCATransForm ( )

Parameter decorrelation. Performs PCA (Principal component analysis) on the input dataset.

void PndMvaTrainer::SetAppType ( AppType  t)
inlineprotected

Set application type for the current object

Definition at line 215 of file PndMvaTrainer.h.

References m_dataSets, and PndMvaDataSet::SetAppType().

216 {
218 };
PndMvaDataSet m_dataSets
Data set. Holds event values.
void SetAppType(AppType t)
TTree * t
Definition: bump_analys.C:13
void PndMvaTrainer::SetOutPutFile ( std::string const &  outFile)
inline

Setter to set the weightfile name.

Parameters
outFileOutput filename.

Definition at line 210 of file PndMvaTrainer.h.

References m_outFile, and outFile.

211 {
212  m_outFile = outFile;
213 };
TString outFile
Definition: hit_dirc.C:17
std::string m_outFile
Output filename.
void PndMvaTrainer::SetRndSeed ( size_t const  sd)
inline

Definition at line 205 of file PndMvaTrainer.h.

References m_RND_seed.

206 {
207  this->m_RND_seed = sd;
208 };
size_t m_RND_seed
Random seed.
void PndMvaTrainer::SetTestSet ( std::set< size_t > const &  testSet)

Set the indices of events that are going to be used for testing.

Parameters
testSetSet containing the indices of the test events.
void PndMvaTrainer::SetTestSetSize ( size_t  percent = 50)

Creates test and train data sets.

Parameters
percentPercent of the data set to be used for testing.
void PndMvaTrainer::splitTetsSet ( )
protected
virtual void PndMvaTrainer::storeWeights ( )
pure virtual

Store weights in the output File. If output file name is not specified, then write nothing.

Implemented in PndLVQTrain, PndMultiClassBdtTrain, PndMultiClassMlpTrain, and PndKnnTrain.

virtual void PndMvaTrainer::Train ( )
pure virtual

Derived classes need to implement this methode.

Implemented in PndLVQTrain, PndMultiClassBdtTrain, PndMultiClassMlpTrain, PndKnnTrain, and PndPDEFoamTrain.

void PndMvaTrainer::WriteErroVect ( std::string const &  FileName) const

Writes the train and test errors evaluations to a given file.

Parameters
FileNameOutput file name.
void PndMvaTrainer::WriteToWeightFile ( std::vector< std::pair< std::string, std::vector< float > * > > const &  weights) const
protected

Write the training and normalization data to outFile.

Member Data Documentation

PndMvaDataSet PndMvaTrainer::m_dataSets
protected

Data set. Holds event values.

Definition at line 175 of file PndMvaTrainer.h.

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

std::string PndMvaTrainer::m_outFile
protected

Output filename.

Definition at line 181 of file PndMvaTrainer.h.

Referenced by SetOutPutFile().

size_t PndMvaTrainer::m_RND_seed
protected

Random seed.

Definition at line 184 of file PndMvaTrainer.h.

Referenced by GetRndSeed(), and SetRndSeed().

std::vector<StepError> PndMvaTrainer::m_StepErro
protected

Container to keep per step error values.

Definition at line 178 of file PndMvaTrainer.h.

Referenced by GetErrorValues().

std::set<size_t> PndMvaTrainer::m_testSet_indices
protected

Indices of the test set.

Definition at line 172 of file PndMvaTrainer.h.

Referenced by GetTestEvetIdx().

size_t PndMvaTrainer::m_testSetSize
private

Definition at line 196 of file PndMvaTrainer.h.

bool PndMvaTrainer::m_trim
private

Definition at line 195 of file PndMvaTrainer.h.


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