27 #if !defined(_CLASSPROB_) 46 #if !defined(_MLCLASS_
) 55 #if !defined(_TRAININGCONFIGURATION2_) 61 #if !defined(_TrainingProcess2_Defined_) 67 #if !defined(_TrainingProcess2List_Defined_) 86 bool Abort ()
const {
return abort;}
93 MLClassPtr& predClass1,
94 MLClassPtr& predClass2,
97 double& knownClassProb,
98 double& predClass1Prob,
99 double& predClass2Prob,
106 bool& knownClassOneOfTheWinners
112 bool& knownClassOneOfTheWinners,
156 MLClassPtr & predClass,
181 double* probabilities
189 KKStr& classifier1Desc,
190 KKStr& classifier2Desc,
197 double** crossProbTable
208 typedef std::map<MLClassPtr, Classifier2Ptr> ClassClassifierIndexType;
209 typedef std::pair<MLClassPtr,
Classifier2Ptr> ClassClassifierPair;
210 typedef std::multimap<Classifier2Ptr,MLClassPtr> ClassifierClassIndexType;
214 void BuildSubClassifierIndex ();
220 bool& knownClassOneOfTheWinners
227 bool& knownClassOneOfTheWinners,
233 MLClassListPtr PredictionsThatHaveSubClassifier (
ClassProbListPtr predictions);
251 KKStr configRootName;
255 bool featuresAlreadyNormalized;
259 MLClassListPtr mlClasses;
264 MLClassPtr noiseMLClass;
271 ClassClassifierIndexType classClassifierIndex;
272 ClassifierClassIndexType classifierClassIndex;
274 ModelPtr trainedModel;
276 ModelOldSVMPtr trainedModelOldSVM;
282 MLClassPtr unKnownMLClass;
286 #define _Classifier2_Defined_ 301 #define _Classifier2List_Defined_ MLClassPtr ClassifyAExample(FeatureVector &example, kkint32 &numOfWinners, bool &knownClassOneOfTheWinners)
virtual ~Classifier2List()
SVM_SelectionMethod SelectionMethod() const
FeatureVector * FeatureVectorPtr
const KKStr & ConfigRootName() const
#define _FeatureVector_Defined_
Classifier2List(bool _owner)
void ProbabilitiesByClassDual(FeatureVectorPtr example, KKStr &classifier1Desc, KKStr &classifier2Desc, ClassProbListPtr &classifier1Results, ClassProbListPtr &classifier2Results)
Classifier2List * Classifier2ListPtr
std::vector< ProbNamePair > FindWorstSupportVectors(FeatureVectorPtr example, kkint32 numToFind, MLClassPtr c1, MLClassPtr c2)
For a given two class pair return the names of the 'numToFind' worst S/V's.
Classifier2Ptr LookUpByName(const KKStr &rootName) const
virtual kkint32 MemoryConsumedEstimated() const
ClassProbList const * PriorProbability() const
Returns the distribution of the training data used to build the classifier.
std::vector< KKStr > SupportVectorNames(MLClassPtr c1, MLClassPtr c2)
void PredictRaw(FeatureVectorPtr example, MLClassPtr &predClass, double &dist)
void ClassifyAExample(FeatureVector &example, MLClassPtr &predClass1, MLClassPtr &predClass2, kkint32 &predClass1Votes, kkint32 &predClass2Votes, double &knownClassProb, double &predClass1Prob, double &predClass2Prob, kkint32 &numOfWinners, double &breakTie)
Used to record probability for a specified class; and a list of classes.
#define _FeatureVectorList_Defined_
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
ClassProbList * ClassProbListPtr
Classifier2(TrainingProcess2Ptr _trainer, RunLog &_log)
Classifier2 * Classifier2Ptr
TrainingProcess2 * TrainingProcess2Ptr
MLClassPtr ClassifyAExample(FeatureVector &example, double &probability, kkint32 &numOfWinners, bool &knownClassOneOfTheWinners, double &breakTie)
std::vector< ProbNamePair > FindWorstSupportVectors2(FeatureVectorPtr example, kkint32 numToFind, MLClassPtr c1, MLClassPtr c2)
For a given two class pair return the names of the 'numToFind' worst S/V's.
void ProbabilitiesByClass(const MLClassList &classes, FeatureVectorPtr example, kkint32 *votes, double *probabilities)
For a given feature vector return back the probabilities and votes for each class.
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
ClassProbListPtr ProbabilitiesByClass(FeatureVectorPtr example)
void RetrieveCrossProbTable(MLClassList &classes, double **crossProbTable)
TrainingConfiguration2 * TrainingConfiguration2Ptr
Maintains a list of MLClass instances.
Represents a Feature Vector of a single example, labeled or unlabeled.
Classifier2 * Classifier2Ptr
TrainingProcess2List * TrainingProcess2ListPtr
MLClassPtr ClassifyAExample(FeatureVector &example)