20 #ifndef _COSTFACTORY_H_ 21 #define _COSTFACTORY_H_ 26 #include "ConfusionMatrix.h" 27 #include "base/Vector2d.h" 33 CostFactory(
unsigned short cv,
short verbose) : m_cv(cv), m_verbose(verbose){};
36 void setCv(
unsigned short cv){m_cv=cv;};
37 void setClassValueMap(
const std::string& classname,
short classvalue){ m_classValueMap[classname]=classvalue;};
38 std::map<std::string,short> getClassValueMap(){
return m_classValueMap;};
39 std::vector<std::string> getNameVector(){
return m_nameVector;};
40 void setNameVector(std::vector<std::string>& nameVector){m_nameVector=nameVector;};
41 int getClassIndex(std::string classname)
const {
return m_cm.getClassIndex(classname);};
43 void pushBackClassName(std::string classname){m_cm.pushBackClassName(classname,
true);};
45 void pushBackName(std::string classname){m_nameVector.push_back(classname);};
46 void setNcTraining(
const std::vector<unsigned int> nctraining){m_nctraining=nctraining;};
47 void setNcTest(
const std::vector<unsigned int> nctest){m_nctest=nctest;};
49 virtual double getCost(
const std::vector<
Vector2d<float> > &trainingFeatures)=0;
53 std::map<std::string,short> m_classValueMap;
54 std::vector<std::string> m_nameVector;
55 std::vector<unsigned int> m_nctraining;
56 std::vector<unsigned int> m_nctest;