yat  0.14.5pre
Public Member Functions | List of all members
theplu::yat::classifier::KNN_Uniform Struct Reference

A model of the concept Neighbor Weighting Method to be used with KNN to weight the votes of the k nearest neighbors of a sample. More...

#include <yat/classifier/KNN_Uniform.h>

Public Member Functions

void operator() (const utility::VectorBase &distance, const std::vector< size_t > &k_sorted, const Target &target, utility::VectorMutable &prediction) const
 

Detailed Description

A model of the concept Neighbor Weighting Method to be used with KNN to weight the votes of the k nearest neighbors of a sample.

KNN_Uniform weights the nearest neighbours uniformly so the total vote for a class is equal to the number of nearest neighbors belonging to the class.

Member Function Documentation

void theplu::yat::classifier::KNN_Uniform::operator() ( const utility::VectorBase distance,
const std::vector< size_t > &  k_sorted,
const Target target,
utility::VectorMutable prediction 
) const

The total vote for each class is calculated and returned in prediction.


The documentation for this struct was generated from the following file:

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5