KSquare Utilities
ModelParamUsfCasCor.h
Go to the documentation of this file.
1 #if !defined(_MODELPARAMUSFCASCOR_)
2 #define _MODELPARAMUSFCASCOR_
3 
4 #include "RunLog.h"
5 #include "KKStr.h"
6 
7 #include "ModelParam.h"
8 
9 
10 namespace KKMLL
11 {
12  /**
13  *@brief This class encapsulates are the information necessary to build a UsfCasCor class.
14  */
16  {
17  public:
19 
21 
22  ModelParamUsfCasCor (int _in_limit,
23  int _out_limit,
24  int _number_of_rounds,
25  int _number_of_trials,
26  kkint64 _random_seed,
27  bool _useCache
28  );
29 
30  virtual ~ModelParamUsfCasCor ();
31 
32  virtual ModelParamUsfCasCorPtr Duplicate () const;
33 
35 
36 
37  // Member access methods
38  int In_limit () const {return in_limit;}
39  int Out_limit () const {return out_limit;}
40  int Number_of_rounds () const {return number_of_rounds;}
41  int Number_of_trials () const {return number_of_trials;}
42  kkint64 Random_seed () const {return random_seed;}
43  bool UseCache () const {return useCache;}
44 
45 
46  // Member update method s
47  void In_limit (int _in_limit) {in_limit = _in_limit;}
48  void Out_limit (int _out_limit) {out_limit = _out_limit;}
49  void Number_of_rounds (int _number_of_rounds) {number_of_rounds = _number_of_rounds;}
50  void Number_of_trials (int _number_of_trials) {number_of_trials = _number_of_trials;}
51  void Random_seed (kkint64 _random_seed) {random_seed = _random_seed;}
52  void UseCache (bool _useCache) {useCache = _useCache;}
53 
54 
55  /**
56  *@brief Creates a Command Line String that represents these parameters.
57  *@details All derived classes should implement this method. They should first call this method and
58  * then append there own parameters that are specific to their implementation.
59  */
60  virtual KKStr ToCmdLineStr () const;
61 
62 
63  virtual void ReadXML (XmlStream& s,
64  XmlTagConstPtr tag,
65  VolConstBool& cancelFlag,
66  RunLog& log
67  );
68 
69 
70  virtual void WriteXML (const KKStr& varName,
71  ostream& o
72  ) const;
73 
74  private:
75  virtual void ParseCmdLinePost (); /**< Will get called after the entire parameter string has been processed. */
76 
77  virtual void ParseCmdLineParameter (const KKStr& parameter,
78  const KKStr& value,
79  bool& parameterUsed,
80  RunLog& log
81  );
82 
83  int in_limit;
84  int out_limit;
85  int number_of_rounds;
86  int number_of_trials;
87  kkint64 random_seed;
88  bool useCache;
89  }; /* ModelParamUsfCasCor */
90 
92 
95 } /* namespace KKMLL */
96 
97 
98 
99 #endif
ModelParam derived classes will implement their "XmlElement" helper class via this template...
Definition: ModelParam.h:260
void Random_seed(kkint64 _random_seed)
void Out_limit(int _out_limit)
void Number_of_rounds(int _number_of_rounds)
ModelParamUsfCasCor * ModelParamUsfCasCorPtr
__int64 kkint64
Definition: KKBaseTypes.h:90
XmlTag const * XmlTagConstPtr
Definition: KKStr.h:45
Manages the reading and writing of objects in a simple XML format. For a class to be supported by Xml...
Definition: XmlStream.h:46
This class encapsulates are the information necessary to build a UsfCasCor class. ...
void In_limit(int _in_limit)
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of &#39;std::string&#39; strings.
Definition: KKStr.cpp:1082
XmlElementModelParamUsfCasCor * XmlElementModelParamUsfCasCorPtr
ModelParamUsfCasCor(int _in_limit, int _out_limit, int _number_of_rounds, int _number_of_trials, kkint64 _random_seed, bool _useCache)
virtual ModelParamUsfCasCorPtr Duplicate() const
void Number_of_trials(int _number_of_trials)
virtual void ReadXML(XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log)
virtual KKStr ToCmdLineStr() const
Creates a Command Line String that represents these parameters.
ModelParamUsfCasCor * ModelParamUsfCasCorPtr
XmlElementModelParamTemplate< ModelParamUsfCasCor > XmlElementModelParamUsfCasCor
Used for logging messages.
Definition: RunLog.h:49
void EncodeProblem(const struct svm_paramater &param, struct svm_problem &prob_in, struct svm_problem &prob_out)
virtual void WriteXML(const KKStr &varName, ostream &o) const
virtual ModelParamTypes ModelParamType() const
void UseCache(bool _useCache)
Abstract Base class for Machine Learning parameters.
Definition: ModelParam.h:35
volatile const bool VolConstBool
Definition: KKBaseTypes.h:163