57 std::string target_class,
const std::vector<double>
point)
71 size_t dims = point.size();
77 std::string cname = iter->first;
80 for (
size_t i = 0; i < cpl.size(); i++) {
82 for (
size_t j = 0; j < dims; j++) {
83 diff += std::fabs(cpl[i][j] - point[j]);
90 }
else if (diff < min_diff) {
NearestNeighborClassifier()
void addTrainingPoint(std::string target_class, const std::vector< double > point)
std::string classifyPoint(const std::vector< double > point)
bool load(const std::string filename)
~NearestNeighborClassifier()
void save(const std::string filename)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
std::vector< CPoint > CPointList