604 |
29 Aug 06 |
peter |
// $Id$ |
604 |
29 Aug 06 |
peter |
2 |
|
675 |
10 Oct 06 |
jari |
3 |
/* |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2006 Jari Häkkinen, Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2007 Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2010, 2012 Peter Johansson |
675 |
10 Oct 06 |
jari |
8 |
|
1437 |
25 Aug 08 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
675 |
10 Oct 06 |
jari |
10 |
|
675 |
10 Oct 06 |
jari |
The yat library is free software; you can redistribute it and/or |
675 |
10 Oct 06 |
jari |
modify it under the terms of the GNU General Public License as |
1486 |
09 Sep 08 |
jari |
published by the Free Software Foundation; either version 3 of the |
675 |
10 Oct 06 |
jari |
License, or (at your option) any later version. |
675 |
10 Oct 06 |
jari |
15 |
|
675 |
10 Oct 06 |
jari |
The yat library is distributed in the hope that it will be useful, |
675 |
10 Oct 06 |
jari |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
675 |
10 Oct 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
675 |
10 Oct 06 |
jari |
General Public License for more details. |
675 |
10 Oct 06 |
jari |
20 |
|
675 |
10 Oct 06 |
jari |
You should have received a copy of the GNU General Public License |
1487 |
10 Sep 08 |
jari |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
675 |
10 Oct 06 |
jari |
23 |
*/ |
675 |
10 Oct 06 |
jari |
24 |
|
2881 |
18 Nov 12 |
peter |
25 |
#include <config.h> |
2881 |
18 Nov 12 |
peter |
26 |
|
604 |
29 Aug 06 |
peter |
27 |
#include "FeatureSelector.h" |
624 |
05 Sep 06 |
peter |
28 |
#include "MatrixLookup.h" |
624 |
05 Sep 06 |
peter |
29 |
#include "MatrixLookupWeighted.h" |
604 |
29 Aug 06 |
peter |
30 |
|
604 |
29 Aug 06 |
peter |
31 |
#include <list> |
604 |
29 Aug 06 |
peter |
32 |
|
604 |
29 Aug 06 |
peter |
33 |
namespace theplu { |
680 |
11 Oct 06 |
jari |
34 |
namespace yat { |
604 |
29 Aug 06 |
peter |
35 |
namespace classifier { |
604 |
29 Aug 06 |
peter |
36 |
|
604 |
29 Aug 06 |
peter |
37 |
|
604 |
29 Aug 06 |
peter |
38 |
FeatureSelector::FeatureSelector(size_t N, size_t first) |
604 |
29 Aug 06 |
peter |
39 |
: first_(first), N_(N) |
604 |
29 Aug 06 |
peter |
40 |
{ |
604 |
29 Aug 06 |
peter |
41 |
} |
604 |
29 Aug 06 |
peter |
42 |
|
604 |
29 Aug 06 |
peter |
43 |
|
604 |
29 Aug 06 |
peter |
44 |
FeatureSelector::~FeatureSelector() |
604 |
29 Aug 06 |
peter |
45 |
{ |
604 |
29 Aug 06 |
peter |
46 |
} |
604 |
29 Aug 06 |
peter |
47 |
|
604 |
29 Aug 06 |
peter |
48 |
|
1134 |
23 Feb 08 |
peter |
49 |
const utility::Index FeatureSelector::features(void) const |
720 |
26 Dec 06 |
jari |
50 |
{ |
720 |
26 Dec 06 |
jari |
51 |
return features_; |
720 |
26 Dec 06 |
jari |
52 |
} |
720 |
26 Dec 06 |
jari |
53 |
|
720 |
26 Dec 06 |
jari |
54 |
|
1204 |
05 Mar 08 |
peter |
55 |
const MatrixLookup FeatureSelector::get(const MatrixLookup& matrix) |
604 |
29 Aug 06 |
peter |
56 |
{ |
1204 |
05 Mar 08 |
peter |
57 |
return MatrixLookup(matrix, features_,true); |
604 |
29 Aug 06 |
peter |
58 |
} |
604 |
29 Aug 06 |
peter |
59 |
|
624 |
05 Sep 06 |
peter |
60 |
|
4200 |
19 Aug 22 |
peter |
61 |
const MatrixLookupWeighted |
624 |
05 Sep 06 |
peter |
62 |
FeatureSelector::get(const MatrixLookupWeighted& matrix) |
624 |
05 Sep 06 |
peter |
63 |
{ |
4200 |
19 Aug 22 |
peter |
64 |
return MatrixLookupWeighted(matrix, features_, |
2223 |
19 Mar 10 |
peter |
65 |
yat::utility::Index(matrix.columns())); |
624 |
05 Sep 06 |
peter |
66 |
} |
624 |
05 Sep 06 |
peter |
67 |
|
680 |
11 Oct 06 |
jari |
68 |
}}} // of namespace classifier, yat, and theplu |