source: trunk/yat/classifier/KNN_Uniform.cc @ 1142

Last change on this file since 1142 was 1142, checked in by Markus Ringnér, 14 years ago

Refs #335, fixed for NCC, working on KNN

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 531 bytes
RevLine 
[1112]1// $Id: KNN_Uniform.cc 1142 2008-02-25 14:32:35Z markus $
2
3#include "KNN_Uniform.h"
4#include "Target.h"
5
6#include "yat/utility/VectorBase.h"
7#include "yat/utility/VectorMutable.h"
8
9#include <vector>
10
11namespace theplu {
12namespace yat {
13namespace classifier {
14
15  void KNN_Uniform::operator()(const utility::VectorBase& distance,
16                               const std::vector<size_t> k_sorted, 
17                               const Target& target, 
18                               utility::VectorMutable& prediction) const
19  {           
[1142]20    for(size_t j=0;j<k_sorted.size();j++) 
[1112]21      prediction(target(k_sorted[j]))+=1.0;           
22  }
23
24}}}
Note: See TracBrowser for help on using the repository browser.