KSquare Utilities
FeatureFileIOUCI.h
Go to the documentation of this file.
1 #ifndef _FEATUREFILEIOUCI_
2 #define _FEATUREFILEIOUCI
3 
4 #include "FeatureFileIO.h"
5 
6 namespace KKMLL
7 {
8 
9 
10  /**
11  @class FeatureFileIOUCI
12  @brief Supports the reading and writing of Feature data from a file format commonly used by many dataset's in the UCI repository.
13  @details
14  @code
15  * ************************************************************************************************
16  * * FeatureFileIOUCI Sub-classed from FeatureFileIO. It supports the reading and writing *
17  * * of many of the files found in the UCI repository. *
18  * * *
19  * * 1) One example per row. *
20  * * 2) Each field is separated by comma. *
21  * * 3) Each row has the same number of fields. *
22  * * 4) The last field is the ClassName. *
23  * * 5) Each field is numeric except the last one which is the ClassName *
24  * ************************************************************************************************
25  @endcode
26  @see FeatureFileIO
27  */
29  {
30  public:
32 
33  ~FeatureFileIOUCI ();
34 
36 
37  static FeatureFileIOUCIPtr Driver () {return &driver;}
38 
39  virtual FileDescPtr GetFileDesc (const KKStr& _fileName,
40  istream& _in,
41  MLClassListPtr _classList,
42  kkint32& _estSize,
43  KKStr& _errorMessage,
44  RunLog& _log
45  );
46 
47 
48  virtual FeatureVectorListPtr LoadFile (const KKStr& _fileName,
49  const FileDescPtr _fileDesc,
50  MLClassList& _classes,
51  istream& _in,
52  kkint32 _maxCount, // Maximum # images to load.
53  VolConstBool& _cancelFlag,
54  bool& _changesMade,
55  KKStr& _errorMessage,
56  RunLog& _log
57  );
58 
59 
60  virtual void SaveFile (FeatureVectorList& _data,
61  const KKStr& _fileName,
62  FeatureNumListConst& _selFeatures,
63  ostream& _out,
64  kkuint32& _numExamplesWritten,
65  VolConstBool& _cancelFlag,
66  bool& _successful,
67  KKStr& _errorMessage,
68  RunLog& _log
69  );
70 
71 
72 
73  private:
74  static FeatureFileIOUCI driver;
75  }; /* FeatureFileIOUCI*/
76 
77 } /* namespace KKMLL */
78 
79 #endif
__int32 kkint32
Definition: KKBaseTypes.h:88
static FeatureFileIOUCIPtr Driver()
virtual FileDescPtr GetFileDesc(const KKStr &_fileName, istream &_in, MLClassListPtr _classList, kkint32 &_estSize, KKStr &_errorMessage, RunLog &_log)
FeatureNumList const FeatureNumListConst
Supports the reading and writing of Feature data from a file format commonly used by many dataset's i...
unsigned __int32 kkuint32
Definition: KKBaseTypes.h:89
Container class for FeatureVector derived objects.
Base class for all FeatureFileIO classes.
Definition: FeatureFileIO.h:48
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of &#39;std::string&#39; strings.
Definition: KKStr.cpp:1082
FileDesc * FileDescPtr
virtual FeatureVectorListPtr LoadFile(const KKStr &_fileName, const FileDescPtr _fileDesc, MLClassList &_classes, istream &_in, kkint32 _maxCount, VolConstBool &_cancelFlag, bool &_changesMade, KKStr &_errorMessage, RunLog &_log)
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)
MLClassList * MLClassListPtr
Definition: MLClass.h:49
virtual void SaveFile(FeatureVectorList &_data, const KKStr &_fileName, FeatureNumListConst &_selFeatures, ostream &_out, kkuint32 &_numExamplesWritten, VolConstBool &_cancelFlag, bool &_successful, KKStr &_errorMessage, RunLog &_log)
Maintains a list of MLClass instances.
Definition: MLClass.h:233
FeatureFileIOUCI * FeatureFileIOUCIPtr
volatile const bool VolConstBool
Definition: KKBaseTypes.h:163