source: trunk/c++_tools/classifier/FeatureSelectorIR.cc @ 608

Last change on this file since 608 was 608, checked in by Peter, 15 years ago

set properties

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date ID
File size: 920 bytes
Line 
1// $Id$
2
3#include "FeatureSelectorIR.h"
4
5#include "FeatureSelector.h"
6#include "InputRanker.h"
7
8#include <algorithm>
9
10namespace theplu {
11namespace classifier {
12
13
14  FeatureSelectorIR::FeatureSelectorIR(statistics::Score& score, size_t N, 
15                                       size_t first)
16    : FeatureSelector(N, first), score_(score)
17  {
18  }
19
20
21
22  FeatureSelectorIR::FeatureSelectorIR(const FeatureSelectorIR& other)
23    : FeatureSelector(other), score_(other.score_)
24  {
25  }
26
27
28
29  FeatureSelectorIR& FeatureSelectorIR::operator=(const FeatureSelectorIR& other)
30  {
31    FeatureSelector::operator=(other);
32    return *this;
33  }
34
35
36  void FeatureSelectorIR::update(const DataLookup2D& data, const Target& target)
37  {
38    InputRanker ir = InputRanker(data, target, score_);
39    features_.resize(N_);
40    std::copy(ir.rank().begin()+first_, ir.rank().begin()+first_+N_,
41              features_.begin());
42   
43  }
44
45
46} // end of namespace classifier
47} // end of namespace theplu
Note: See TracBrowser for help on using the repository browser.