KSquare Utilities
FeatureFileIOArff.h
Go to the documentation of this file.
1 #ifndef _FEATUREFILEIOARFF_
2 #define _FEATUREFILEIOARFF_
3 /**
4  ************************************************************************************************
5  * @author Kurt Kramer *
6  * Date: 2009-04-16 *
7  ************************************************************************************************
8  */
9 
10 
11 #include "FeatureFileIO.h"
12 
13 
14 namespace KKMLL
15 {
16 
17 /**
18  * @class KKMLL::FeatureFileIOArff
19  * @brief Support the writing of ARFF Formatted Feature Files.
20  * @details
21  * Supports the writing of the ARFF format as supported by the WEKA machine learning system
22  * The ARFF format is very similar to the C45 file format; but there is only one file that
23  * contains the file description and examples in it.
24  * see http://weka.wikispaces.com/ARFF+(book+version for description.
25  * @see FeatureFileIO
26  */
28 {
29 public:
31 
32 
34 
36 
37  static FeatureFileIOArffPtr Driver () {return &driver;}
38 
39 
40 
41 private:
42  virtual FileDescPtr GetFileDesc (const KKStr& _fileName,
43  istream& _in,
44  MLClassListPtr _classList,
45  kkint32& _estSize,
46  KKStr& _errorMessage,
47  RunLog& _log
48  );
49 
50 
51  virtual FeatureVectorListPtr LoadFile (const KKStr& _fileName,
52  const FileDescPtr _fileDesc,
53  MLClassList& _classes,
54  istream& _in,
55  kkint32 _maxCount, // Maximum # images to load.
56  VolConstBool& _cancelFlag,
57  bool& _changesMade,
58  KKStr& _errorMessage,
59  RunLog& _log
60  );
61 
62 
63  virtual void SaveFile (FeatureVectorList& _data,
64  const KKStr& _fileName,
65  FeatureNumListConst& _selFeatures,
66  ostream& _out,
67  kkuint32& _numExamplesWritten,
68  VolConstBool& _cancelFlag,
69  bool& _successful,
70  KKStr& _errorMessage,
71  RunLog& _log
72  );
73 
74 
75 
76 private:
77  static FeatureFileIOArff driver;
78 
79 };
80 
81 } /* namespace KKMLL */
82 
83 #endif
__int32 kkint32
Definition: KKBaseTypes.h:88
Support the writing of ARFF Formatted Feature Files.
FeatureNumList const FeatureNumListConst
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
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
Maintains a list of MLClass instances.
Definition: MLClass.h:233
FeatureFileIOArff * FeatureFileIOArffPtr
static FeatureFileIOArffPtr Driver()
volatile const bool VolConstBool
Definition: KKBaseTypes.h:163