FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
PndMultiClassBdtTrain Class Reference

#include <PndMultiClassBdtTrain.h>

Inheritance diagram for PndMultiClassBdtTrain:
PndMvaTrainer

Public Member Functions

 PndMultiClassBdtTrain (std::string const &InPut, std::vector< std::string > const &ClassNames, std::vector< std::string > const &VarNames, bool trim=true)
 
virtual ~PndMultiClassBdtTrain ()
 
void Train ()
 
void storeWeights ()
 
void Initialize ()
 
void SetJobName (std::string const &name)
 
void SetTransformation (std::string const &tran)
 
void SetBdtOptions (std::string const &opts)
 
void SetEvalFileName (std::string const &fname)
 
void SetWeightsOutDir (std::string const &dirName)
 
void SetEvaluation (bool evaluate)
 
std::string const & GetJobName () const
 
std::string const & GetTransformation () const
 
std::string const & GetBdtOptions () const
 
std::string const & GetEvalFileName () const
 
std::string const & GetWeightsOutDir () const
 
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
 
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

 PndMultiClassBdtTrain (PndMultiClassBdtTrain const &oth)
 
PndMultiClassBdtTrainoperator= (PndMultiClassBdtTrain const &oth)
 
void InitBdt ()
 
void AddVariables ()
 

Private Attributes

TMVA::Factory * m_factory
 
TFile * EvalFile
 
std::string m_JName
 
std::string m_transform
 
std::string m_BdtOptions
 
std::string m_evalFileName
 
std::string m_weightDirName
 
bool m_Evaluate
 

Detailed Description

Definition at line 29 of file PndMultiClassBdtTrain.h.

Constructor & Destructor Documentation

PndMultiClassBdtTrain::PndMultiClassBdtTrain ( std::string const &  InPut,
std::vector< std::string > const &  ClassNames,
std::vector< std::string > const &  VarNames,
bool  trim = true 
)
explicit

Constructor.

Parameters
InPutThe file containig the event data.
ClassNamesLabels of the classes to be used.
VarNamesThe name of the involved variables(features).
trimIf the data set needs to be trimmed.
virtual PndMultiClassBdtTrain::~PndMultiClassBdtTrain ( )
virtual

Destructor.

PndMultiClassBdtTrain::PndMultiClassBdtTrain ( PndMultiClassBdtTrain const &  oth)
private

Member Function Documentation

void PndMultiClassBdtTrain::AddVariables ( )
private
virtual void PndMvaTrainer::EvalClassifierError ( )
virtualinherited

Classifier evaluation.

Reimplemented in PndLVQTrain.

std::string const & PndMultiClassBdtTrain::GetBdtOptions ( ) const
inline

Definition at line 154 of file PndMultiClassBdtTrain.h.

References m_BdtOptions.

155 {
156  return m_BdtOptions;
157 };
std::vector< PndMvaClass > const & PndMvaTrainer::GetClasses ( ) const
inlineinherited

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 PndMvaTrainer::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
inlineinherited

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 PndMvaTrainer::m_StepErro.

239 {
240  return m_StepErro;
241 };
std::vector< StepError > m_StepErro
Container to keep per step error values.
std::string const & PndMultiClassBdtTrain::GetEvalFileName ( ) const
inline

Definition at line 164 of file PndMultiClassBdtTrain.h.

References m_evalFileName.

165 {
166  return m_evalFileName;
167 };
std::string const & PndMultiClassBdtTrain::GetJobName ( ) const
inline

Definition at line 144 of file PndMultiClassBdtTrain.h.

References m_JName.

145 {
146  return m_JName;
147 };
size_t PndMvaTrainer::GetRndSeed ( ) const
inlineinherited

Definition at line 200 of file PndMvaTrainer.h.

References PndMvaTrainer::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
inlineinherited

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 PndMvaTrainer::m_testSet_indices.

221 {
222  return m_testSet_indices;
223 };
std::set< size_t > m_testSet_indices
Indices of the test set.
std::string const & PndMultiClassBdtTrain::GetTransformation ( ) const
inline

Definition at line 149 of file PndMultiClassBdtTrain.h.

References m_transform.

150 {
151  return m_transform;
152 };
std::vector< PndMvaVariable > const & PndMvaTrainer::GetVariables ( ) const
inlineinherited

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 PndMvaTrainer::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.
std::string const & PndMultiClassBdtTrain::GetWeightsOutDir ( ) const
inline

Definition at line 174 of file PndMultiClassBdtTrain.h.

References m_weightDirName.

175 {
176  return m_weightDirName;
177 };
void PndMultiClassBdtTrain::InitBdt ( )
private
void PndMultiClassBdtTrain::Initialize ( )
virtual

Initialize Classifier and data structures.

Reimplemented from PndMvaTrainer.

void PndMvaTrainer::NormalizeData ( NormType  t = NONORM)
inherited

Select input data normalization scheme.

PndMultiClassBdtTrain& PndMultiClassBdtTrain::operator= ( PndMultiClassBdtTrain const &  oth)
private
void PndMvaTrainer::PCATransForm ( )
inherited

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

void PndMvaTrainer::SetAppType ( AppType  t)
inlineprotectedinherited

Set application type for the current object

Definition at line 215 of file PndMvaTrainer.h.

References PndMvaTrainer::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 PndMultiClassBdtTrain::SetBdtOptions ( std::string const &  opts)
inline

Definition at line 139 of file PndMultiClassBdtTrain.h.

References m_BdtOptions.

140 {
141  this->m_BdtOptions = opt;
142 };
void PndMultiClassBdtTrain::SetEvalFileName ( std::string const &  fname)
inline

Definition at line 159 of file PndMultiClassBdtTrain.h.

References m_evalFileName.

160 {
161  this->m_evalFileName = fname;
162 };
void PndMultiClassBdtTrain::SetEvaluation ( bool  evaluate)
inline

Definition at line 179 of file PndMultiClassBdtTrain.h.

References m_Evaluate.

180 {
181  this->m_Evaluate = evaluate;
182 };
void PndMultiClassBdtTrain::SetJobName ( std::string const &  name)
inline

Definition at line 129 of file PndMultiClassBdtTrain.h.

References m_JName, and name.

130 {
131  this->m_JName = name;
132 };
TString name
void PndMvaTrainer::SetOutPutFile ( std::string const &  outFile)
inlineinherited

Setter to set the weightfile name.

Parameters
outFileOutput filename.

Definition at line 210 of file PndMvaTrainer.h.

References PndMvaTrainer::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)
inlineinherited

Definition at line 205 of file PndMvaTrainer.h.

References PndMvaTrainer::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)
inherited

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)
inherited

Creates test and train data sets.

Parameters
percentPercent of the data set to be used for testing.
void PndMultiClassBdtTrain::SetTransformation ( std::string const &  tran)
inline

Definition at line 134 of file PndMultiClassBdtTrain.h.

References m_transform, and tr.

135 {
136  this->m_transform = tr;
137 };
void PndMultiClassBdtTrain::SetWeightsOutDir ( std::string const &  dirName)
inline

Definition at line 169 of file PndMultiClassBdtTrain.h.

References m_weightDirName.

170 {
171  this->m_weightDirName = dirName;
172 };
void PndMvaTrainer::splitTetsSet ( )
protectedinherited
void PndMultiClassBdtTrain::storeWeights ( )
virtual

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

Implements PndMvaTrainer.

void PndMultiClassBdtTrain::Train ( )
virtual

Train the classifier.

Implements PndMvaTrainer.

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

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
protectedinherited

Write the training and normalization data to outFile.

Member Data Documentation

TFile* PndMultiClassBdtTrain::EvalFile
private

Definition at line 119 of file PndMultiClassBdtTrain.h.

std::string PndMultiClassBdtTrain::m_BdtOptions
private

Definition at line 122 of file PndMultiClassBdtTrain.h.

Referenced by GetBdtOptions(), and SetBdtOptions().

PndMvaDataSet PndMvaTrainer::m_dataSets
protectedinherited

Data set. Holds event values.

Definition at line 175 of file PndMvaTrainer.h.

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

std::string PndMultiClassBdtTrain::m_evalFileName
private

Definition at line 123 of file PndMultiClassBdtTrain.h.

Referenced by GetEvalFileName(), and SetEvalFileName().

bool PndMultiClassBdtTrain::m_Evaluate
private

Definition at line 125 of file PndMultiClassBdtTrain.h.

Referenced by SetEvaluation().

TMVA::Factory* PndMultiClassBdtTrain::m_factory
private

Definition at line 118 of file PndMultiClassBdtTrain.h.

std::string PndMultiClassBdtTrain::m_JName
private

Definition at line 120 of file PndMultiClassBdtTrain.h.

Referenced by GetJobName(), and SetJobName().

std::string PndMvaTrainer::m_outFile
protectedinherited

Output filename.

Definition at line 181 of file PndMvaTrainer.h.

Referenced by PndMvaTrainer::SetOutPutFile().

size_t PndMvaTrainer::m_RND_seed
protectedinherited

Random seed.

Definition at line 184 of file PndMvaTrainer.h.

Referenced by PndMvaTrainer::GetRndSeed(), and PndMvaTrainer::SetRndSeed().

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

Container to keep per step error values.

Definition at line 178 of file PndMvaTrainer.h.

Referenced by PndMvaTrainer::GetErrorValues().

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

Indices of the test set.

Definition at line 172 of file PndMvaTrainer.h.

Referenced by PndMvaTrainer::GetTestEvetIdx().

std::string PndMultiClassBdtTrain::m_transform
private

Definition at line 121 of file PndMultiClassBdtTrain.h.

Referenced by GetTransformation(), and SetTransformation().

std::string PndMultiClassBdtTrain::m_weightDirName
private

Definition at line 124 of file PndMultiClassBdtTrain.h.

Referenced by GetWeightsOutDir(), and SetWeightsOutDir().


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