#include <yat/classifier/KNN_ReciprocalRank.h>
Public Member Functions | |
void | operator() (const utility::VectorBase &distance, const std::vector< size_t > &k_sorted, const Target &target, utility::VectorMutable &prediction) const |
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
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.