1 #if !defined(_MLCLASS_) 56 static std::map<MLClassListPtr,MLClassListPtr> existingClassLists;
101 const KKStr& newName,
102 bool& changeSuccessful
113 static void CreateBlocker ();
116 static bool needToRunFinalCleanUp;
121 MLClass (
const KKStr& _name);
123 MLClass (
const MLClass& mlClass);
127 void Name (
const KKStr& _name);
140 void CountFactor (
float _countFactor) {countFactor = _countFactor;}
150 void Mandatory (
bool _mandatory) {mandatory = _mandatory;}
177 void Summarize (
bool _summarize) {summarize = _summarize;}
184 void UnDefined (
bool _unDefined) {unDefined = _unDefined;}
203 bool storedOnDataBase;
219 #define _MLClass_Defined_ 399 void AddMLClassToNameIndex (
MLClassPtr _mlClass);
404 const KKStr& oldName,
405 const KKStr& newName,
409 typedef std::map<KKStr,MLClassPtr> NameIndex;
418 void Owner (
bool _owner) {KKQueue<MLClass>::Owner (_owner);}
420 bool undefinedLoaded;
427 #define _MLClassList_Defined_ 431 std::ostream& operator<< ( std::ostream& os,
530 std::map<kkint16, MLClassPtr> shortIdx;
536 #define _MLClassIndexList_Defined_ 566 const KKStr& varName,
597 const KKStr& varName,
static void WriteXML(const MLClass &mlClass, const KKStr &varName, std::ostream &o)
__int16 kkint16
16 bit signed integer.
void StoredOnDataBase(bool _storedOnDataBase)
MLClassPtr Parent() const
MLClassPtr GetUnKnownClass()
Return a pointer to the MLClass object that represents the unknown Class in the list.
MLClassIndexList * MLClassIndexListPtr
static MLClassListPtr MergeClassList(const MLClassList &list1, const MLClassList &list2)
Maintains a list of classes and their associated integer index.
virtual void ReadXML(XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log)
KKStr ToCommaDelimitedStr() const
GoalKeeper * GoalKeeperPtr
bool StoredOnDataBase() const
MLClassPtr GetNoiseClass() const
KKStr ToCommaDelString() const
Returns string consisting of all contained classes indicating ClassIndex assigned to each class...
kkint16 GetClassIndex(MLClassPtr c)
Returns the corresponding index to the class 'c'; if not in list will return -1.
KKStr ExtractHTMLTableHeader() const
Will generate a HTML formatted string that can be used in a HTML table.
MLClassIndexList(const MLClassIndexList &_list)
unsigned __int16 kkuint16
16 bit unsigned integer.
float CountFactor() const
static void ChangeNameOfClass(MLClassPtr mlClass, const KKStr &newName, bool &changeSuccessful)
Changes the name of an existing class verifying that a duplicate does not get created.
Represents a "Class" in the Machine Learning Sense.
void ExtractTwoTitleLines(KKStr &titleLine1, KKStr &titleLine2) const
Using the class names create two title lines where we split names by "_" characters between the two l...
static void WriteXML(const MLClassList &mlClassList, const KKStr &varName, std::ostream &o)
MLClassList operator-(const MLClassList &right) const
bool operator!=(const MLClassList &right) const
static KKStr GetClassNameFromDirName(const KKStr &subDir)
static MLClassPtr GetUnKnownClassStatic()
MLClassPtr TakeOwnership()
kkint32 MemoryConsumedEstimated() const
bool operator==(const MLClassList &right) const
XmlElementMLClassNameList(XmlTagPtr tag, XmlStream &s, VolConstBool &cancelFlag, RunLog &log)
virtual MLClassPtr LookUpByName(const KKStr &_name) const
Returns a pointer of MLClass object with name (_name); if none in list will then return NULL...
const KKStr & ParentName() const
void Parent(MLClassPtr _parent)
virtual void WriteXML(const KKStr &varName, std::ostream &o) const
static void FinalCleanUp()
Call this as the last thing the application does, will delete all existing instances of 'MLClass'...
void CountFactor(float _countFactor)
void Mandatory(bool _mandatory)
KKStr ToCommaDelimitedQuotedStr() const
MLClassPtr GetMLClass(kkint16 classIndex)
Locates the MLClass that was assigned classIndex.
void Description(const KKStr &_description)
MLClassIndexList(const MLClassList &_classes)
void Save(KKStr _fileName, bool &_successfull)
XmlElementMLClass(XmlTagPtr tag, XmlStream &s, VolConstBool &cancelFlag, RunLog &log)
static MLClassListPtr BuildListFromDelimtedStr(const KKStr &s, char delimiter)
XmlElementTemplate< MLClassIndexList > XmlElementMLClassIndexList
MLClassList & operator+=(const MLClassList &right)
virtual MLClassPtr PopFromFront()
MLClassList & operator-=(const MLClassList &right)
void AddClass(MLClassPtr _ic, bool &_dupEntry)
MLClassListPtr ExtractMandatoryClasses() const
KKStr ToTabDelimitedStr() const
virtual ~MLClassIndexList()
virtual void Clear()
Clears the contents of this list and updates nameIndex structure.
XmlTag const * XmlTagConstPtr
MLClassListPtr TakeOwnership()
Manages the reading and writing of objects in a simple XML format. For a class to be supported by Xml...
virtual ~XmlElementMLClass()
kkuint16 NumHierarchialLevels() const
virtual void PushOnBack(MLClassPtr mlClass)
MLClassListPtr Value() const
static void ResetAllParentsToAllClasses()
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
MLClassList(const KKStr &fileName, bool &successfull)
Construct a MLClassList object from the contents of a file.
void ExtractThreeTitleLines(KKStr &titleLine1, KKStr &titleLine2, KKStr &titleLine3) const
Using the class names create three title lines where we split names by "_" characters between the thr...
KKB::kkuint16 NumHierarchialLevels() const
void AddClassIndexAssignment(MLClassPtr _ic, kkint16 _classIndex, bool &_dupEntry)
XmlElementMLClassIndexList * XmlElementMLClassIndexListPtr
MLClassListPtr ExtractListOfClassesForAGivenHierarchialLevel(kkint32 level)
const KKStr & UpperName() const
MLClassList & operator=(const MLClassList &right)
void ParseClassIndexList(const KKStr &s, RunLog &log)
const KKStr & Name() const
void ClassId(kkint32 _classId)
virtual MLClassPtr LookUpByClassId(kkint32 _classId) const
static MLClassPtr CreateNewMLClass(const KKStr &_name, kkint32 _classId=-1)
Static method used to create a new instance of a MLClass object.
void WriteXML(const KKStr &varName, std::ostream &o) const
MLClassList(const MLClassList &_mlClasses)
Copy constructor; will copy list but not own the contents.
friend std::ostream & operator<<(std::ostream &os, const Matrix &matrix)
void Summarize(bool _summarize)
virtual MLClassPtr PopFromBack()
void ExtractThreeTitleLines(KKStr &titleLine1, KKStr &titleLine2, KKStr &titleLine3, kkint32 fieldWidth) const
static MLClassListPtr BuildListOfDecendents(MLClassPtr parent)
KKStr & operator=(const KKStr &src)
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
void Load(const KKStr &_fileName, bool &_successfull)
virtual ~XmlElementMLClassNameList()
MLClassList * MLClassListPtr
void WriteXML(const KKStr &varName, std::ostream &o) const
virtual MLClassPtr GetMLClassPtr(const KKStr &_name)
return pointer to instance with '_name'; if none exists, create one and add to list.
static MLClassListPtr GlobalClassList()
void UnDefined(bool _unDefined)
kkint32 MemoryConsumedEstimated() const
const KKStr & Description() const
MLClassListPtr ExtractSummarizeClasses() const
XmlElementMLClass * XmlElementMLClassPtr
Maintains a list of MLClass instances.
virtual void PushOnFront(MLClassPtr mlClass)
virtual void AddMLClass(MLClassPtr _mlClass)
Will only write the ClassName rather than complete MLClass instances.
static MLClassPtr GetByClassId(kkint32 _classId)
MLClassPtr MLClassForGivenHierarchialLevel(KKB::kkuint16 level) const
bool IsAnAncestor(MLClassPtr c) const
MLClassList globalClassList
XmlElementMLClassNameList * XmlElementMLClassNameListPtr
volatile const bool VolConstBool