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/Matrix.h" 31 #include "yat/utility/Vector.h" 32 #include "yat/utility/yat_assert.h" 34 #include <boost/concept_check.hpp> 42 namespace classifier {
62 template <
typename Distance>
104 template <
typename Distance>
106 : matrix_(data), target_(target)
112 template <
typename Distance>
114 const Distance& dist)
115 : matrix_(data), target_(target), distance_(dist)
122 template <
typename Distance>
128 template <
typename Distance>
138 for (
size_t i=0; i<dist.rows(); ++i)
139 for (
size_t j=i+1; j<dist.rows(); ++j) {
140 dist(i,j) = dist(j,i) = distance_(matrix_.
begin_column(i),
146 for(
size_t i=0; i<target_.
size(); i++) {
149 for(
size_t j=0; j<target_.
size(); j++) {
152 if(dist(i,j)<mindist) {
157 if(target_(i)==target_(neighbor))
162 igp_(i)/=
static_cast<double>(target_.
size(i));
167 template <
typename Distance>
General view into utility::Matrix.
Definition: MatrixLookup.h:70
size_t columns(void) const
void resize(size_t, double init_value=0)
Resize Vector.
Class for containing sample labels.
Definition: Target.h:47
The Department of Theoretical Physics namespace as we define it.
IGP(const MatrixLookup &, const Target &)
Definition: IGP.h:105
Class for In Group Proportions (IGP)
Definition: IGP.h:63
virtual ~IGP()
Definition: IGP.h:123
T max(const T &a, const T &b, const T &c)
Definition: stl_utility.h:697
This is the yat interface to GSL vector.
Definition: Vector.h:59
const utility::Vector & score(void) const
Definition: IGP.h:168
const_column_iterator end_column(size_t) const
Concept check for a Distance.
Definition: concept_check.h:278
Interface to GSL matrix.
Definition: Matrix.h:74
const_column_iterator begin_column(size_t) const
size_t nof_classes(void) const