21 #if !defined(_MLCLASS_) 28 #if !defined(_FILEDESC_) 33 #if !defined(_FEATUREVECTOR_) 40 #if !defined(_FEATURENUMLIST_) 45 #if !defined(_TRAININGPROCESS2_) 50 #if !defined(_CLASSIFIER2_) 55 #if !defined(_MODELPARAMDUAL_) 60 #if !defined(_TRAININGCONFIGURATION2_) 114 MLClassPtr knownClass,
115 MLClassPtr& predClass1,
116 MLClassPtr& predClass2,
119 double& probOfKnownClass,
120 double& predClass1Prob,
121 double& predClass2Prob,
123 bool& knownClassOneOfTheWinners,
136 KKStr& classifier1Desc,
137 KKStr& classifier2Desc,
147 double* _probabilities,
169 double* _probabilities,
176 double** crossProbTable,
183 bool _alreadyNormalized,
211 MLClassPtr predClass,
213 double& predClassProb,
Base class to all Learning Algorithms.
Provides a detailed description of the attributes of a dataset.
TrainingProcess2Ptr trainer2
TrainingConfiguration2Ptr config2
FeatureVector * FeatureVectorPtr
XmlElementModelTemplate< ModelDual > XmlElementModelDual
Keeps track of selected features.
virtual ClassProbListPtr ProbabilitiesByClass(FeatureVectorPtr example, RunLog &log)
virtual void WriteXML(const KKStr &varName, ostream &o) const
virtual ModelTypes ModelType() const
void ReconcileProbAndVotes(Classifier2Ptr classifier, MLClassPtr predClass, FeatureVectorPtr encodedExample, double &predClassProb, kkint32 &predClassVotes)
Represents a "Class" in the Machine Learning Sense.
virtual void ProbabilitiesByClassDual(FeatureVectorPtr example, KKStr &classifier1Desc, KKStr &classifier2Desc, ClassProbListPtr &classifier1Results, ClassProbListPtr &classifier2Results, RunLog &log)
Only applied to ModelDual classifier.
Classifier2Ptr classifier1
ModelParamDualPtr Param()
TrainingProcess2Ptr Trainer1()
void DeleteExistingClassifiers()
virtual KKStr Description() const
Container class for FeatureVector derived objects.
FeatureNumList * FeatureNumListPtr
virtual void RetrieveCrossProbTable(MLClassList &classes, double **crossProbTable, RunLog &log)
virtual MLClassPtr Predict(FeatureVectorPtr example, RunLog &log)
XmlTag const * XmlTagConstPtr
Manages the reading and writing of objects in a simple XML format. For a class to be supported by Xml...
virtual ModelDualPtr Duplicate() const
XmlElementModelDual * XmlElementModelDualPtr
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
ClassProbList * ClassProbListPtr
TrainingProcess2Ptr Trainer2()
Classifier2Ptr classifier2
virtual void Predict(FeatureVectorPtr example, MLClassPtr knownClass, MLClassPtr &predClass1, MLClassPtr &predClass2, kkint32 &predClass1Votes, kkint32 &predClass2Votes, double &probOfKnownClass, double &predClass1Prob, double &predClass2Prob, kkint32 &numOfWinners, bool &knownClassOneOfTheWinners, double &breakTie, RunLog &log)
ModelParamDual * ModelParamDualPtr
Will implement the Dual Classifier Model.
TrainingConfiguration2Ptr config1
ModelDual(const ModelDual &_model)
virtual ~ModelDual()
Frees any memory allocated by, and owned by the ModelDual.
virtual void ReadXML(XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log)
To be implemented by derived classes; the parent classes fields will be updated by the derived class ...
virtual kkint32 MemoryConsumedEstimated() const
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
virtual kkint32 NumOfSupportVectors() const
Maintains a list of MLClass instances.
virtual void ProbabilitiesByClass(FeatureVectorPtr example, const MLClassList &_mlClasses, kkint32 *_votes, double *_probabilities, RunLog &log)
FeatureVectorList * FeatureVectorListPtr
Represents a Feature Vector of a single example, labeled or unlabeled.
virtual void ProbabilitiesByClass(FeatureVectorPtr _example, const MLClassList &_mlClasses, double *_probabilities, RunLog &_log)
Derives predicted probabilities by class.
MLClassPtr ReconcilePredictions(MLClassPtr pred1, MLClassPtr pred2, RunLog &log)
TrainingProcess2Ptr trainer1
FactoryFVProducer * FactoryFVProducerPtr
ModelDual(const KKStr &_name, const ModelParamDual &_param, FactoryFVProducerPtr _factoryFVProducer)
ModelDual(FactoryFVProducerPtr _factoryFVProducer)
volatile const bool VolConstBool
virtual void TrainModel(FeatureVectorListPtr _trainExamples, bool _alreadyNormalized, bool _takeOwnership, VolConstBool &_cancelFlag, RunLog &_log)
Performs operations such as FeatureEncoding, and Normalization. The actual training of models occurs ...