Interface definition for LVQ trainers.
More...
#include <PndLVQTrain.h>
|
| PndLVQTrain (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=false) |
|
| PndLVQTrain (std::string const &InPut, std::vector< std::string > const &ClassNames, std::vector< std::string > const &VarNames, bool trim=true) |
|
virtual | ~PndLVQTrain () |
|
void | storeWeights () |
|
void | Train () |
|
void | Train21 () |
|
void | setProtoInitType (ProtoInitType iniTypeVal=RAND_FROM_DATA) |
|
void | SetInitProtoFileName (std::string const &fileName) |
|
void | SetLearnPrameters (double const initConst, double const etZ, double const etF, unsigned int const Nswp) |
|
void | SetNumberOfProto (size_t const numProto) |
|
void | SetNumberOfProto (std::map< std::string, size_t > const &labelMap) |
|
void | SetErrorStepSize (unsigned int const val=1000) |
|
void | SetLVQ2_1WindowSize (float const Wsize=0.3) |
|
void | EvalClassifierError () |
|
void | SetPerEpochEval (bool val) |
|
bool | GetPerEpochEval () const |
|
| 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...
|
|
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...
|
|
size_t | GetRndSeed () const |
|
void | SetRndSeed (size_t const sd) |
|
Interface definition for LVQ trainers.
Definition at line 33 of file PndLVQTrain.h.
◆ PndLVQTrain() [1/2]
PndLVQTrain::PndLVQTrain |
( |
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 = false |
|
) |
| |
|
explicit |
Constructor:
- Parameters
-
InputEvtsParam | Input events vector. |
ClassNames | class names. |
VarNames | variable names of the features. |
◆ PndLVQTrain() [2/2]
PndLVQTrain::PndLVQTrain |
( |
std::string const & |
InPut, |
|
|
std::vector< std::string > const & |
ClassNames, |
|
|
std::vector< std::string > const & |
VarNames, |
|
|
bool |
trim = true |
|
) |
| |
|
explicit |
Constructor:
- Parameters
-
InPut | Input file name. |
ClassNames | class names. |
VarNames | variable names of the features. |
◆ ~PndLVQTrain()
virtual PndLVQTrain::~PndLVQTrain |
( |
| ) |
|
|
virtual |
◆ EvalClassifierError()
void PndLVQTrain::EvalClassifierError |
( |
| ) |
|
|
virtual |
◆ GetPerEpochEval()
bool PndLVQTrain::GetPerEpochEval |
( |
| ) |
const |
|
inline |
Getter for evaluation scheme.
- Returns
- Per epoch or per step.
Definition at line 298 of file PndLVQTrain.h.
◆ SetErrorStepSize()
void PndLVQTrain::SetErrorStepSize |
( |
unsigned int const |
val = 1000 | ) |
|
|
inline |
Set how often the classifier has to be evaluated.
- Parameters
-
val | Evaluate after #val steps. If (Val == 0) then the classifier is evaluated once at the end of the training prodecure. |
Definition at line 283 of file PndLVQTrain.h.
◆ SetInitProtoFileName()
void PndLVQTrain::SetInitProtoFileName |
( |
std::string const & |
fileName | ) |
|
|
inline |
Set the file name which holds the pre-initialized code books.
- Parameters
-
val | The name of the file which containes the pre initialized code books. |
Definition at line 270 of file PndLVQTrain.h.
272 m_initProtoFile = fileName;
◆ SetLearnPrameters()
void PndLVQTrain::SetLearnPrameters |
( |
double const |
initConst, |
|
|
double const |
etZ, |
|
|
double const |
etF, |
|
|
unsigned int const |
Nswp |
|
) |
| |
|
inline |
Sets the learning parameters.
- Parameters
-
initConst | Initialization constant, used to initialize LVQ prototypes. |
etZ | EthaZero, start value for the learning rate. |
etF | Final value for Etha (learning rate) |
Nswp | Number of sweeps through the examples collection set. |
Definition at line 275 of file PndLVQTrain.h.
277 m_initConst = initConst;
◆ SetLVQ2_1WindowSize()
void PndLVQTrain::SetLVQ2_1WindowSize |
( |
float const |
Wsize = 0.3 | ) |
|
|
inline |
Set the window size for LVQ2.1 alg. A value between 0.2 & 0.3 is recommended.
Definition at line 288 of file PndLVQTrain.h.
290 m_WindowSize = Wsize;
◆ SetNumberOfProto() [1/2]
void PndLVQTrain::SetNumberOfProto |
( |
size_t const |
numProto | ) |
|
Set the number of protoTypes to be used for training. The same number of prototypes are initialized for all available labels(classes).
- Parameters
-
numProto | Number of prototypes. |
◆ SetNumberOfProto() [2/2]
void PndLVQTrain::SetNumberOfProto |
( |
std::map< std::string, size_t > const & |
labelMap | ) |
|
Set the number of protoTypes to be used for training.
- Parameters
-
labelMap | Map containing number of prototypes for each class (label). |
◆ SetPerEpochEval()
void PndLVQTrain::SetPerEpochEval |
( |
bool |
val | ) |
|
|
inline |
Select if we want to follow the training evaluation per epoch (sweeps) or per step. The number of steps = Sweeps * (#examples).
- Parameters
-
val | true = evaluate per epoch, false per step. Default is false. |
Definition at line 293 of file PndLVQTrain.h.
◆ setProtoInitType()
Set CodeBook init type.
- Parameters
-
iniTypeVal | Initialization type. |
Definition at line 265 of file PndLVQTrain.h.
267 m_proto_init = iniTypeVal;
◆ storeWeights()
void PndLVQTrain::storeWeights |
( |
| ) |
|
|
virtual |
Store weights in the output File. If output file name is not specified, then write nothing.
Implements PndMvaTrainer.
◆ Train()
void PndLVQTrain::Train |
( |
| ) |
|
|
virtual |
Train the classifier accourding to LVQ1 algorithm.
Implements PndMvaTrainer.
◆ Train21()
void PndLVQTrain::Train21 |
( |
| ) |
|
Train the classifier accourding to LVQ2.1 algorithm.
The documentation for this class was generated from the following file: