1 #if !defined(_CLASSPROB_) 17 #if !defined(_MLCLASS_
) 41 #define _ClassProb_Defined_ 94 void MergeIn (MLClassPtr target,
104 void MergeIn (MLClassPtr target,
131 typedef std::map<MLClassPtr,ClassProbPtr> MLClassIndexType;
132 typedef std::pair<MLClassPtr,
ClassProbPtr> MLClassIndexPair;
139 MLClassIndexType classIndex;
143 #define _ClassProbList_Defined_
void ReadXML(XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log)
ClassProbList * ClassProbListPtr
kkint32 MemoryConsumedEstimated() const
void MergeIn(const ClassProbPtr cp)
Adds the Prediction in 'cp' into this list.
virtual void PushOnBack(ClassProbPtr cp)
kkint32 LookUpPlace(MLClassPtr targetClass) const
Returns the position that 'targetClass' has in the order; good time to use would be after sorting by ...
unsigned __int32 kkuint32
void WriteXML(const KKStr &varName, std::ostream &o) const
virtual void PushOnFront(ClassProbPtr cp)
const ClassProbPtr LookUp(MLClassPtr targetClass) const
void SortByProbability(bool highToLow=true)
Used to record probability for a specified class; and a list of classes.
XmlTag const * XmlTagConstPtr
Manages the reading and writing of objects in a simple XML format. For a class to be supported by Xml...
void MergeIn(MLClassPtr target, double probability, float votes)
Adds the prediction of 'target' with 'probability' into this list.
XmlElementTemplate< ClassProbList > XmlElementClassProbList
virtual void DeleteEntry(kkuint32 idx)
ClassProbList(bool owner)
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
ClassProbList * ClassProbListPtr
ClassProbList(const ClassProbList &pairList)
void AddIn(const ClassProbListPtr otherPredictions)
Adds the contents of 'otherPredictions' to this list.
void SortByVotes(bool highToLow=true)
virtual void DeleteEntry(ClassProbPtr cp)
void MergeIn(MLClassPtr target, const ClassProbListPtr subPredictions)
Merges in the predictions in 'subPredictions' by replacing the entry in our list with label 'target' ...
ClassProb(const ClassProb &_pair)
static ClassProbListPtr CreateFromXMLStream(std::istream &i)
void NormalizeToOne()
Will normalize the list of predictions such that the total probability will equal 1...
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
ClassProb(MLClassPtr _classLabel, double _probability, float _votes)
XmlElementClassProbList * XmlElementClassProbListPtr
volatile const bool VolConstBool