yat  0.10.4pre
Public Member Functions
theplu::yat::classifier::KNN_ReciprocalRank 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 </scratch/bob/jari/tmp/pristine/yat-0.10.x/yat/classifier/KNN_ReciprocalRank.h>

List of all members.

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_ReciprocalRank weights the vote of a nearest neighbor with its reciprocal rank. The class of the nearest neighbor gets the vote 1/1, the class of the second nearest neighbor gets the vote 1/2, and so on


Member Function Documentation

void theplu::yat::classifier::KNN_ReciprocalRank::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 Mon Nov 11 2013 09:41:45 for yat by  doxygen 1.8.1