29 using namespace KKMLL;
55 _log.Level (10) << endl << endl
56 <<
"FeatureFileIORoberts::LoadFile ***ERROR*** ARFF read Functionality not implemented." << endl
59 _errorMessage
= "ROBERTS read functionality not implemented.";
78 _log.Level (10) << endl << endl
79 <<
"FeatureFileIORoberts::LoadFile ***ERROR*** ARFF read Functionality not implemented." << endl
82 _errorMessage
= "ROBERTS read functionality not implemented.";
89 const KKStr& _fileName,
99 _log.Level (20) <<
"FeatureFileIORoberts::SaveFile FileName[" << _fileName <<
"]" << endl;
101 _numExamplesWritten = 0;
109 KKStr namesFileName = _fileName
+ ".names";
111 ofstream nf (namesFileName.Str ());
115 for (x = 0; x < classes->QueueSize (); x++)
117 if (x > 0) nf <<
" ";
118 nf << classes->IdxToPtr (x)->Name ();
134 for (y = 0; y < attr->Cardinality (); y++)
135 nf <<
" " << attr->GetNominalValue (y);
147 FeatureVectorPtr example = NULL;
150 for (idx = 0; (idx < _data.QueueSize ()) && (!_cancelFlag); idx++)
152 example = _data.IdxToPtr (idx);
169 _numExamplesWritten++;
virtual FileDescPtr GetFileDesc(const KKStr &_fileName, istream &_in, MLClassListPtr _classList, kkint32 &_estSize, KKStr &_errorMessage, RunLog &_log)
virtual void SaveFile(FeatureVectorList &_data, const KKStr &_fileName, FeatureNumListConst &_selFeatures, ostream &_out, kkuint32 &_numExamplesWritten, VolConstBool &_cancelFlag, bool &_successful, KKStr &_errorMessage, RunLog &_log)
const KKStr & GetNominalValue(kkint32 code) const
Returns the nominal value for the given ordinal value.
float FeatureData(kkint32 featureNum) const
MLClassListPtr ExtractListOfClasses() const
KKStr & operator=(const char *src)
Supports the writing of Feature Data to a file that can then be read by OpenDT.
const FileDescPtr FileDesc() const
FeatureNumList const FeatureNumListConst
KKStr operator+(const char *right) const
unsigned __int32 kkuint32
Container class for FeatureVector derived objects.
kkuint16 operator[](kkint32 idx) const
Returns back the selected feature.
kkint32 NumOfFeatures() const
Base class for all FeatureFileIO classes.
virtual FeatureVectorListPtr LoadFile(const KKStr &_fileName, const FileDescPtr _fileDesc, MLClassList &_classes, istream &_in, kkint32 _maxCount, VolConstBool &_cancelFlag, bool &_changesMade, KKStr &_errorMessage, RunLog &_log)
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
AttributeType Type() const
std::ostream &__cdecl operator<<(std::ostream &os, const KKStr &str)
const KKMLL::AttributePtr * CreateAAttributeTable() const
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
MLClassList * MLClassListPtr
const KKStr & ClassName() const
Name of class that this example is assigned to.
Maintains a list of MLClass instances.
FeatureFileIO(const KKStr &_driverName, bool _canRead, bool _canWrite)
volatile const bool VolConstBool