1 #ifndef _theplu_yat_classifier_igp_
2 #define _theplu_yat_classifier_igp_
27 #include "MatrixLookup.h"
29 #include "yat/utility/concept_check.h"
30 #include "yat/utility/Vector.h"
31 #include "yat/utility/yat_assert.h"
33 #include <boost/concept_check.hpp>
41 namespace classifier {
51 template <
typename Distance>
93 template <
typename Distance>
95 : matrix_(data), target_(target)
101 template <
typename Distance>
103 : matrix_(data), target_(target), distance_(dist)
110 template <
typename Distance>
115 template <
typename Distance>
118 YAT_ASSERT(target_.size()==matrix_.columns());
123 for(
size_t i=0; i<target_.size(); i++) {
126 for(
size_t j=0; j<target_.size(); j++) {
129 double dist = distance_(matrix_.begin_column(i), matrix_.end_column(i),
130 matrix_.begin_column(j));
136 if(target_(i)==target_(neighbor))
140 for(
size_t i=0; i<target_.nof_classes(); i++) {
141 igp_(i)/=
static_cast<double>(target_.size(i));
146 template <
typename Distance>