KSquare Utilities
ModelParamKnn.h
Go to the documentation of this file.
1 #ifndef _MODELPARAMKNN_
2 #define _MODELPARAMKNN_
3 
4 #include "ModelParam.h"
5 
6 namespace KKMLL
7 {
8  class ModelParamKnn: public ModelParam
9  {
10  public:
12 
13  ModelParamKnn ();
14 
15 
16  ModelParamKnn (const ModelParamKnn& _param);
17 
18 
19  virtual
20  ~ModelParamKnn ();
21 
22 
23  virtual
24  ModelParamKnnPtr Duplicate () const;
25 
27 
28  /*!
29  @brief Creates a Command Line String that represents these parameters.
30  */
31  virtual
32  KKStr ToCmdLineStr (RunLog& log) const;
33 
34 
35  virtual void ReadXML (XmlStream& s,
36  XmlTagConstPtr tag,
37  VolConstBool& cancelFlag,
38  RunLog& log
39  );
40 
41 
42  virtual void WriteXML (const KKStr& varName,
43  ostream& o
44  ) const;
45 
46 
47  private:
48  virtual
49  void ParseCmdLineParameter (const KKStr& parameter,
50  const KKStr& value,
51  bool& parameterUsed,
52  RunLog& log
53  );
54 
55 
56 
57  FileDescPtr fileDesc;
58 
59  KKStr fileName;
60 
61  kkint32 k; /**< The number of nearest neighbors to process. */
62 
63  bool validParam;
64  }; /* ModelParamKnn */
65 
66  typedef ModelParamKnn::ModelParamKnnPtr ModelParamKnnPtr;
67 
70 }
71 
72 
73 
74 
75 #endif
__int32 kkint32
Definition: KKBaseTypes.h:88
ModelParam derived classes will implement their "XmlElement" helper class via this template...
Definition: ModelParam.h:260
virtual ModelParamKnnPtr Duplicate() const
virtual KKStr ToCmdLineStr(RunLog &log) const
Creates a Command Line String that represents these parameters.
XmlElementModelParamKnn * XmlElementModelParamKnnPtr
Definition: ModelParamKnn.h:69
XmlElementModelParamTemplate< ModelParamKnn > XmlElementModelParamKnn
Definition: ModelParamKnn.h:68
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
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of &#39;std::string&#39; strings.
Definition: KKStr.cpp:1082
ModelParamKnn * ModelParamKnnPtr
Definition: ModelParamKnn.h:11
virtual void WriteXML(const KKStr &varName, ostream &o) const
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)
ModelParamKnn(const ModelParamKnn &_param)
virtual void ReadXML(XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log)
Abstract Base class for Machine Learning parameters.
Definition: ModelParam.h:35
virtual ModelParamTypes ModelParamType() const
Definition: ModelParamKnn.h:26
volatile const bool VolConstBool
Definition: KKBaseTypes.h:163